"ClassNotFoundException" when trying to deploy war application which contains invalid class references
Issue
I have my deployment abc.ear, which contains example.war.
Inside example.war, there are some Struts taglib descriptor .tld files. When trying to deploy this application. I get java.lang.ClassNotFoundException as follows:
12:39:12,013 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC000001: Failed to start service jboss.deployment.subunit."abc.ear"."example.war".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.subunit."abc.ear"."example.war".POST_MODULE: JBAS018733: Failed to process phase POST_MODULE of subdeployment "example.war" of deployment "abc.ear"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:166) [jboss-as-server-7.4.0.Final-redhat-19.jar:7.4.0.Final-redhat-19]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1980) [jboss-msc-1.1.5.Final-redhat-1.jar:1.1.5.Final-redhat-1]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1913) [jboss-msc-1.1.5.Final-redhat-1.jar:1.1.5.Final-redhat-1]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_65]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_65]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_65]
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: java.lang.ClassNotFoundException: com.example.jsptags.WriteTag from [Module "deployment.abc.ear.example.war:main" from Service Module Loader]
at org.jboss.as.jaxrs.deployment.JaxrsComponentDeployer.deploy(JaxrsComponentDeployer.java:79)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:159) [jboss-as-server-7.4.0.Final-redhat-19.jar:7.4.0.Final-redhat-19]
... 5 more
Caused by: java.lang.ClassNotFoundException: com.example.jsptags.WriteTag from [Module "deployment.abc.ear.example.war:main" from Service Module Loader]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:213) [jboss-modules.jar:1.3.3.Final-redhat-1]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:459) [jboss-modules.jar:1.3.3.Final-redhat-1]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:408) [jboss-modules.jar:1.3.3.Final-redhat-1]
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:389) [jboss-modules.jar:1.3.3.Final-redhat-1]
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:134) [jboss-modules.jar:1.3.3.Final-redhat-1]
at org.jboss.as.jaxrs.deployment.JaxrsComponentDeployer.deploy(JaxrsComponentDeployer.java:77)
... 6 more
12:39:12,019 ERROR [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS015870: Deploy of deployment "abc.ear" was rolled back with the following failure message:
{"JBAS014671: Failed services" => {"jboss.deployment.subunit.\"abc.ear\".\"example.war\".POST_MODULE" => "org.jboss.msc.service.StartException in service jboss.deployment.subunit.\"abc.ear\".\"example.war\".POST_MODULE: JBAS018733: Failed to process phase POST_MODULE of subdeployment \"example.war\" of deployment \"abc.ear\"
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: java.lang.ClassNotFoundException: com.example.jsptags.WriteTag from [Module \"deployment.abc.ear.example.war:main\" from Service Module Loader]
Caused by: java.lang.ClassNotFoundException: com.example.jsptags.WriteTag from [Module \"deployment.abc.ear.example.war:main\" from Service Module Loader]"}}
Environment
- Red Hat JBoss Enterprise Application Platform
- 6.x
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
