请考虑以下jboss-deployment-structure.xml
耳内META-INF
的结构
<!-- Make sub deployments not isolated so they can see each others classes without a Class-Path entry (default is true) -->
<ear-subdeployments-isolated>false</ear-subdeployments-isolated>
<deployment>
<!-- Exclusions allow you to prevent the server from automatically adding some dependencies -->
<exclusions>
<module name="org.apache.xerces" />
</exclusions>
</deployment>
<sub-deployment name="mySubDeployment.war">
<exclusions>
<module name="org.apache.log4j" />
</exclusions>
<dependencies>
<system>
<paths>
<path name="com/sun/org/apache/xerces/internal/dom"/>
<path name="com/sun/org/apache/xerces/internal/xni"/>
<path name="com/sun/org/apache/xerces/internal/jaxp"/>
</paths>
</system>
</dependencies>
</sub-deployment>
鉴于此,我已从部署(第11行)中排除了默认org.apache.xerces
模块,并在xercesImpl.jar
文件夹或耳中部署了自定义APP-INF/lib
。此外,我还为mySubDeployment.war
子部署添加了路径依赖关系。
将为mySubDeployment.war
加载xerces的类别?来自WildFly的默认com.apache.xerces
模块或APP-INF/lib
中部署的自定义jar?
在子部署中添加路径依赖项的确切含义是什么?是否会忽略主要部署下的排除(即org.apache.xerces)?
答案 0 :(得分:1)
你不应该真的需要这些路径。您还必须为每个sub-deployment排除xerces。
APP-INF
目录也不是标准的Java EE目录。您需要将库放在EAR的/lib
目录中。