我正在覆盖Wildlfy 10模块中jar的服务器过滤器类。 这是一个快速而肮脏的解决方案:在我的自定义类中复制/粘贴类的内容,并改为引用我的自定义类。
我的父母pom是这样的:
<dependency>
<groupId>org.picketlink</groupId>
<artifactId>picketlink-api</artifactId>
<version>${picketlink-version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.picketlink</groupId>
<artifactId>picketlink-federation</artifactId>
<version>${picketlink-version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.picketlink</groupId>
<artifactId>picketlink-common</artifactId>
<version>${picketlink-version}</version>
<scope>provided</scope>
</dependency>
我在战争pom中有以下部分包含自定义类:
<dependency>
<groupId>org.picketlink</groupId>
<artifactId>picketlink-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.picketlink</groupId>
<artifactId>picketlink-federation</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.picketlink</groupId>
<artifactId>picketlink-common</artifactId>
<scope>provided</scope>
</dependency>
我的war中还有一个jboss-deployment-description.xml文件,其中已经引用了包含缺失类的包(这是关于如何将包用于其他内容的指令):
<jboss-deployment-structure>
<deployment>
<!-- You must configure the PicketLink dependency to your deployment. The dependency above is a reference to a static module
from JBoss EAP modules directory. -->
<dependencies>
<module name="org.picketlink"/>
<module name="org.picketlink.common"/>
</dependencies>
</deployment>
主包“org.picketlink”也在我耳朵的清单文件中打包战争:
<manifestEntries>
<Dependencies>
com.docapost.configuration,org.picketlink
</Dependencies>
</manifestEntries>
如果我没记错的话,这也是为了解决过去的一些过去的ClassNotFoundException。
pom中的jar版本与我的Wildfly中的版本相同(picketlink 2.7.0.Final)
在部署时,我从我的自定义类ZephirSPFilter获取异常:
Error getting reflective information for class com.docapost.zephir.filters.ZephirSPFilter with ClassLoader ModuleClassLoader
并且:
Caused by: java.lang.NoClassDefFoundError: org/picketlink/common/exceptions/ProcessingException
Caused by: java.lang.ClassNotFoundException: org.picketlink.common.exceptions.ProcessingException from [Module \"deployment.zephir-ear.ear.zephir-web.war:main\" from Service Module Loader]"},
答案 0 :(得分:0)
据我所知,你有耳朵并且包含在其里面。并且您在战争中添加了jboss-deployment-description.xml。但是这个文件应放在顶层部署中,即在你的情况下放在耳边。
请参阅https://docs.jboss.org/author/display/AS7/Class+Loading+in+AS7