gpt4 book ai didi

jboss7.x - JBoss AS 7 : Non-EJB dependency in another EAR

转载 作者:行者123 更新时间:2023-12-01 01:06:38 25 4
gpt4 key购买 nike

我有一个具有以下结构的 EAR:

ear.ear    
mywar.war
lib
jar1.jar
jar2.jar
jar3.jar

我在部署目录中有多个 WAR,我希望它们有 jar1.jar。来自ear.ear 的jar2.jar 和jar3.jar 作为依赖项。

这可能吗?

我已经尝试了以下 jboss-deployment-structure.xml 没有运气。
<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure>
<deployment>
<dependencies>
<module name="deployment.ear.ear.jar1.jar"/>
<module name="deployment.ear.ear.jar2.jar"/>
<module name="deployment.ear.ear.jar3.jar"/>
</dependencies>
</deployment>
</jboss-deployment-structure>

<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure>
<deployment>
<dependencies>
<module name="deployment.ear.ear.lib.jar1.jar"/>
<module name="deployment.ear.ear.lib.jar2.jar"/>
<module name="deployment.ear.ear.lib.jar3.jar"/>
</dependencies>
</deployment>
</jboss-deployment-structure>

是否可以在单独的 EAR 中拥有非 ejb JAR 依赖项?

最佳答案

您应该能够将依赖项放在 /lib 中。你耳朵的文件夹,你的 war 应该看到它们。

来自 JBoss AS7 文档:

Ear deployments are multi-module deployments. This means that not all classes inside an ear will necessarily have access to all other classes in the ear, unless explicit dependencies have been defined. By default the EAR/lib directory is a single module, and every WAR or EJB jar deployment is also a separate module. Sub deployments (wars and ejb-jars) always have a dependency on the parent module, which gives them access to classes in EAR/lib, however they do not always have an automatic dependency on each other



您还可以阅读有关 JBoss AS 7 中类加载的更多信息: https://docs.jboss.org/author/display/AS71/Class+Loading+in+AS7

关于jboss7.x - JBoss AS 7 : Non-EJB dependency in another EAR,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18249326/

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