Jboss部署失败 - ClassNotFoundException

时间:2016-01-24 18:16:43

标签: deployment jboss jboss7.x war

在将war文件部署到我的jboss服务器时遇到了ClassNotFoundException。我认为它与log4j有关,因为它返回"部署错误处理JAR的SCI:log4j-web-2.2.jar"错误。但是,Web应用程序在eclipse上的apache tomcat上正常工作。我不知道如何解决它。提前谢谢。

日志:

12:32:52,002 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC00001: Failed to start service jboss.deployment.unit."WarTest.war".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.unit."WarTest.war".INSTALL: Failed to process phase INSTALL of deployment "WarTest.war"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:119) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_91]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_91]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_91]

Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: Deployment error processing SCI for JAR: log4j-web-2.2.jar
at org.jboss.as.web.deployment.ServletContainerInitializerDeploymentProcessor.loadSci(ServletContainerInitializerDeploymentProcessor.java:186)
at org.jboss.as.web.deployment.ServletContainerInitializerDeploymentProcessor.deploy(ServletContainerInitializerDeploymentProcessor.java:121)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
... 5 more

Caused by: java.lang.ClassNotFoundException: # from [Module "deployment.WarTest.war:main" from Service Module Loader]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)
at org.jboss.as.web.deployment.ServletContainerInitializerDeploymentProcessor.loadSci(ServletContainerInitializerDeploymentProcessor.java:183)
... 7 more

1 个答案:

答案 0 :(得分:0)

从日志中可以看出jboss需要在你的WAR的WEB-INF / lib中使用一个jar - 这就是它所说的java.lang.ClassNotFoundException: # from [Module "deployment.WarTest.war:main" from Service Module Loader]

这里有一个详细的讨论: https://issues.apache.org/jira/browse/LOG4J2-890