在 Maven 中运行 org.mule.MuleServer 导致 SecurityException

发布于 2025-01-06 00:56:53 字数 4964 浏览 1 评论 0原文

我有以下 Maven 构建配置文件:

    <profile>
        <id>runMule</id>
        <activation>
            <property>
                <name>runMule</name>
            </property>
        </activation>
        <build>
            <plugins>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>exec-maven-plugin</artifactId>
                    <configuration>
                        <executable>java</executable>
                        <arguments>
                            <argument>-classpath</argument>
                            <classpath/>
                            <argument>org.mule.MuleServer</argument>
                            <argument>-config</argument>
                            <argument>mule-config.xml</argument>
                        </arguments>
                    </configuration>
                </plugin>
            </plugins>
        </build>
    </profile>

如果我执行:

mvn exec:exec -DrunMule

我以以下错误结束:

[INFO] --- exec-maven-plugin:1.2.1:exec (default-cli) @ acceptance-tests ---
INFO  2012-02-16 17:01:48,170 [main] org.mule.MuleServer: Mule Server starting...
Exception in thread "main" java.lang.ExceptionInInitializerError
at org.mule.MuleServer.shutdown(MuleServer.java:307)
at org.mule.MuleServer.run(MuleServer.java:211)
at org.mule.MuleServer.start(MuleServer.java:195)
at org.mule.MuleServer.main(MuleServer.java:166)
Caused by: java.lang.SecurityException: class "org.apache.commons.collections.ArrayStack"'s signer information does not match signer information of other classes in the same package
at java.lang.ClassLoader.checkCerts(ClassLoader.java:806)
at java.lang.ClassLoader.preDefineClass(ClassLoader.java:487)

我的依赖项列表是:

<dependencies>
    <dependency>
        <groupId>org.mule</groupId>
        <artifactId>mule-core</artifactId>
        <version>1.4.2</version>
    </dependency>
    <dependency>
        <groupId>org.jbehave</groupId>
        <artifactId>jbehave-spring</artifactId>
    </dependency>
    <dependency>
        <groupId>org.jbehave</groupId>
        <artifactId>jbehave-core</artifactId>
        <classifier>resources</classifier>
        <type>zip</type>
    </dependency>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
    </dependency>
    <dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpclient</artifactId>
    </dependency>
    <dependency>
        <groupId>commons-httpclient</groupId>
        <artifactId>commons-httpclient</artifactId>
    </dependency>
    <dependency>
        <groupId>org.apache.activemq</groupId>
        <artifactId>activemq-core</artifactId>
    </dependency>
    <dependency>
        <groupId>org.apache.xbean</groupId>
        <artifactId>xbean-spring</artifactId>
    </dependency>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>1.5.6</version>
    </dependency>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-log4j12</artifactId>
        <version>1.5.6</version>
    </dependency>
    <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>1.2.15</version>
    </dependency>
    <dependency>
        <groupId>net.sf.json-lib</groupId>
        <artifactId>json-lib</artifactId>
        <type>jar</type>
        <classifier>jdk15</classifier>
    </dependency>
    <dependency>
        <groupId>xom</groupId>
        <artifactId>xom</artifactId>
    </dependency>
    <dependency>
        <groupId>org.codehaus.jackson</groupId>
        <artifactId>jackson-core-asl</artifactId>
        <version>1.8.0</version>
    </dependency>
    <dependency>
        <groupId>org.codehaus.jackson</groupId>
        <artifactId>jackson-mapper-asl</artifactId>
        <version>1.9.3</version>
    </dependency>
</dependencies>

我认为这是 Maven 依赖项冲突,但我不确定。

知道是什么导致了错误吗?

I have the following maven build profile:

    <profile>
        <id>runMule</id>
        <activation>
            <property>
                <name>runMule</name>
            </property>
        </activation>
        <build>
            <plugins>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>exec-maven-plugin</artifactId>
                    <configuration>
                        <executable>java</executable>
                        <arguments>
                            <argument>-classpath</argument>
                            <classpath/>
                            <argument>org.mule.MuleServer</argument>
                            <argument>-config</argument>
                            <argument>mule-config.xml</argument>
                        </arguments>
                    </configuration>
                </plugin>
            </plugins>
        </build>
    </profile>

If I execute:

mvn exec:exec -DrunMule

I end with the following error:

[INFO] --- exec-maven-plugin:1.2.1:exec (default-cli) @ acceptance-tests ---
INFO  2012-02-16 17:01:48,170 [main] org.mule.MuleServer: Mule Server starting...
Exception in thread "main" java.lang.ExceptionInInitializerError
at org.mule.MuleServer.shutdown(MuleServer.java:307)
at org.mule.MuleServer.run(MuleServer.java:211)
at org.mule.MuleServer.start(MuleServer.java:195)
at org.mule.MuleServer.main(MuleServer.java:166)
Caused by: java.lang.SecurityException: class "org.apache.commons.collections.ArrayStack"'s signer information does not match signer information of other classes in the same package
at java.lang.ClassLoader.checkCerts(ClassLoader.java:806)
at java.lang.ClassLoader.preDefineClass(ClassLoader.java:487)

My dependency list is:

<dependencies>
    <dependency>
        <groupId>org.mule</groupId>
        <artifactId>mule-core</artifactId>
        <version>1.4.2</version>
    </dependency>
    <dependency>
        <groupId>org.jbehave</groupId>
        <artifactId>jbehave-spring</artifactId>
    </dependency>
    <dependency>
        <groupId>org.jbehave</groupId>
        <artifactId>jbehave-core</artifactId>
        <classifier>resources</classifier>
        <type>zip</type>
    </dependency>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
    </dependency>
    <dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpclient</artifactId>
    </dependency>
    <dependency>
        <groupId>commons-httpclient</groupId>
        <artifactId>commons-httpclient</artifactId>
    </dependency>
    <dependency>
        <groupId>org.apache.activemq</groupId>
        <artifactId>activemq-core</artifactId>
    </dependency>
    <dependency>
        <groupId>org.apache.xbean</groupId>
        <artifactId>xbean-spring</artifactId>
    </dependency>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>1.5.6</version>
    </dependency>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-log4j12</artifactId>
        <version>1.5.6</version>
    </dependency>
    <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>1.2.15</version>
    </dependency>
    <dependency>
        <groupId>net.sf.json-lib</groupId>
        <artifactId>json-lib</artifactId>
        <type>jar</type>
        <classifier>jdk15</classifier>
    </dependency>
    <dependency>
        <groupId>xom</groupId>
        <artifactId>xom</artifactId>
    </dependency>
    <dependency>
        <groupId>org.codehaus.jackson</groupId>
        <artifactId>jackson-core-asl</artifactId>
        <version>1.8.0</version>
    </dependency>
    <dependency>
        <groupId>org.codehaus.jackson</groupId>
        <artifactId>jackson-mapper-asl</artifactId>
        <version>1.9.3</version>
    </dependency>
</dependencies>

I think it is a maven dependency conflict, but I'm not sure.

Any idea what is causing the error?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

难如初 2025-01-13 00:56:53

我同意,这看起来像是依赖冲突。你有日食吗?如果这样做,您可以在 pom.xml 的“依赖关系层次结构”选项卡中看到冲突。这是我的依赖层次结构的屏幕截图。

I agree, this looks like a dependency conflict. Do you have eclipse? If you do you can see the conflicts in the "Dependency hierarchy" tab of your pom. Here is a screenshot of my dependency hierarchy.

痕至 2025-01-13 00:56:53

请留意其他人:)您已经在使用maven,运行“mvn dependency:tree”和“mvn dependency:list”来解决依赖问题,这样您也可以在此处发布结果。

Please be mindful of others :) You're already using maven, run 'mvn dependency:tree' and 'mvn dependency:list' to troubleshoot dependency issues, this way you can also post results here.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文