0

我正在开发我们拥有的 maven-ising 和旧的 ant 应用程序。我在我的 pom 中添加了对 log4j-1.2.8 的依赖(因为它是编译所必需的)。但是,当我尝试在 jboss 上部署时(卡在 4.0.2 版),我得到以下信息:

org.jboss.deployment.DeploymentException: Failed to find module file: log4j-1.2.8.jar
at org.jboss.deployment.EARDeployer.init(EARDeployer.java:244)
at org.jboss.deployment.MainDeployer.init(MainDeployer.java:828)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:765)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:738)
at sun.reflect.GeneratedMethodAccessor48.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:592)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:121)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:127)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
at $Proxy8.deploy(Unknown Source)
at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:325)
at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:483)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:204)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:215)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:194)

我不确定谁设置了 jboss,我无法控制它的配置。但是,我可以看到它在各个位置都有以下 log4j jar:

/opt/jboss-4.0.2]$ find -L . -name '*log4j*.jar'
    ./client/log4j.jar
    ./server/minimal/lib/log4j.jar
    ./server/all/lib/log4j.jar
    ./server/default/lib/log4j-1.2.16.jar
    ./lib/log4j-boot.jar

有谁知道什么是设置错误?我知道旧的 ant 应用程序曾经在同一个 jboss 服务器上工作。我尝试在我的 pom 中使用各种版本的 log4j(即在 jboss 目录中找到的那些),甚至尝试添加对 jboss-logging 的依赖——但我只是在这里猜测。

干杯!

4

1 回答 1

1

考虑将您的log4j依赖项添加为<scope>provided</scope>,因为它由您的应用程序服务器提供,因此在您部署的工件中不需要。

于 2013-10-03T15:20:02.407 回答