0

我正在从 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>

我的战争中还有一个 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]"},
4

1 回答 1

0

据我了解,你有耳朵并参与其中。并且您将 jboss-deployment-description.xml 添加到您的战争中。但是这个文件应该放在顶层部署中,即在你的情况下。

https://docs.jboss.org/author/display/AS7/Class+Loading+in+AS7

于 2018-01-30T14:40:53.457 回答