我有两只耳朵(
ear01-0.0.1型-快照.ear
,
)应用程序和它们都使用一个公共库(
普通-0.0.1-快照.jar
野蝇14
但即使使用部署描述符,在EAR部署期间也会出现异常:
java.lang.NoClassDefFoundError: Failed to link ki/wildfly_deps/ejbs01/EchoBean01
我使用此CLI添加新模块:
module add --name=ki.wildfly_deps.common --resources=common-0.0.1-SNAPSHOT.jar
现在罐子在里面
$JBOSS_HOME/modules/ki/wildfly_deps/common/main
这个罐子不应该在文件夹中
$JBOSS_HOME/modules/system/layers/base/ki/wildfly_deps/common/main
除了其他模块?
添加模块后
像这样:
<?xml version='1.0' encoding='UTF-8'?>
<module xmlns="urn:jboss:module:1.1" name="ki.wildfly_deps.common">
<resources>
<resource-root path="common-0.0.1-SNAPSHOT.jar"/>
</resources>
</module>
jboss部署-结构.xml
从每个EAR声明对上述公共库的依赖关系:
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<deployment>
<dependencies>
<module name="ki.wildfly_deps.common" />
</dependencies>
</deployment>
我应该指定必须从公共模块导入的包吗?
<jboss-deployment-structure
xmlns="urn:jboss:deployment-structure:1.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<deployment>
<dependencies>
<module name="ki.wildfly_deps.common" //>
<imports>
<include path="META-INF**" />
<include path="ki.wildfly_deps.common**" />
</imports>
</module>
</dependencies>
</deployment>