Code Eater
Code Eater

Reputation: 21

Jboss Deployment Failure - ClassNotFoundException

I encountered ClassNotFoundException during deploying a war file to my jboss server. I think it is related to log4j since it returns "Deployment error processing SCI for JAR: log4j-web-2.2.jar" error. However, the web app works properly on apache tomcat on eclipse. I have no idea of how to solve it. Thank you in advance.

Log:

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

Upvotes: 2

Views: 6461

Answers (2)

If you're using Jakarta EE 9 or 10, you'll have to upgrade your version of Wildfly to a version that supports Jakarta EE > 9. In my case, I had the stable release of version 26 that supported Jakarta EE 8, and not 9. So I upgraded to the beta version (version 27) of Wildfly that came with support for Jakarta EE >= 9 out of the box. If you can't find the war file, generate it using the maven command mvn -e -U clean install

Upvotes: 0

Sampada
Sampada

Reputation: 2991

From the log it looks like jboss needs a jar in your WAR's WEB-INF/lib - this is what it mean when it says java.lang.ClassNotFoundException: # from [Module "deployment.WarTest.war:main" from Service Module Loader]

There is a detailed discussion here: https://issues.apache.org/jira/browse/LOG4J2-890

Upvotes: 1

Related Questions