gpt4 book ai didi

java - Jboss 7.2.2 应用程序部署问题

转载 作者:行者123 更新时间:2023-12-02 00:24:37 27 4
gpt4 key购买 nike

我正在同一个 jboss 7.2.2 上部署 3 个应用程序,如下所述:

a.ear
|+ META-INF
|+ applications.xml and jboss-deployment-structure.xml
|+ a.war
|+ web pages and JSP /JSF pages
|+ WEB-INF
|+ web.xml, jboss-web.xml etc.
|+ lib
|+ tag library JARs
|+ classes
|+ servlets and other classes used by web pages
|+ a.jar
|+ EJB3 bean classes
|+ META-INF
|+ ejb-jar.xml and persistence.xml
|+ lib
|+ a1.jar, a2.jar etc.

b.ear - It is using some of the libraries generated from a.ear( a1.jar, a2.jar)
|+ META-INF
|+ applications.xml and jboss-deployment-structure.xml
|+ b.war
|+ web pages and JSP /JSF pages
|+ WEB-INF
|+ web.xml, jboss-web.xml etc.
|+ lib
|+ tag library JARs
|+ classes
|+ servlets and other classes used by web pages
|+ b.jar
|+ EJB3 bean classes
|+ META-INF
|+ ejb-jar.xml and persistence.xml
|+ lib
|+ a1.jar, a2.jar, b1.jar, b2.jar etc.

c.ear - It is using some of the libraries generated from a.ear and b.ear( a1.jar, a2.jar, b1.jar, b2.jar)
|+ META-INF
|+ applications.xml and jboss-deployment-structure.xml
|+ c.war
|+ web pages and JSP /JSF pages
|+ WEB-INF
|+ web.xml, jboss-web.xml etc.
|+ lib
|+ tag library JARs
|+ classes
|+ servlets and other classes used by web pages
|+ c.jar
|+ EJB3 bean classes
|+ META-INF
|+ ejb-jar.xml and persistence.xml
|+ lib
|+ a1.jar, a2.jar, b1.jar, b2.jar, c1.jar, c2.jar etc.

当我部署前两只耳朵时,它部署成功,没有任何问题,但是当我尝试部署 c.ear 时,由于相同 API 的多个引用,它给了我相同的类强制转换异常。我希望 jboss 应该只选择我在 E​​ar lib 文件夹中给出的 jar,而不是从部署中选择。我怎样才能做到这一点?如何从 jboss-deployment-struct 中排除此部署(a.ear 和 b.ear)?

你能帮我解决这个问题吗?

最佳答案

Hello ,您可以使用JBoss部署结构XML文件来排除类/包,您可以使用排除路径:

<exclude path="***" />排除类/包。以及<exclude-set>

示例:

<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
<deployment>
<exclusions>
<module name="sun.jdk" />
</exclusions>
<dependencies>
<module name="sun.jdk">
<imports>
<include-set>
<path name="example/"/>
</include-set>
<exclude-set>
<path name="path/"/>
</exclude-set>
</imports>
</module>
</dependencies>
</deployment>
</jboss-deployment-structure>

关于java - Jboss 7.2.2 应用程序部署问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58059471/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com