Application fails to deploy with ClassNotFoundException when using custom runtime-name and no extension in JBoss EAP 6 / 7

Solution Verified - Updated -

Issue

  • Application fails to deploy with ClassNotFoundException when using custom runtime-name and no extension in JBoss EAP 6 / 7
  • Our application was deploying successfully when it was deployed in the deployments directory, but it is failing to deploy when we deploy using the CLI or Management console with a custom runtime-name to remove the version number such as:
deploy reproducer-1.0.0.war --runtime-name=reproducer

And it is failing to start with ClassNotFoundException for classes which exist in the application's WEB-INF/classes directory:

16:50:12,636 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-6) MSC000001: Failed to start service jboss.deployment.unit.reproducer.POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.unit.reproducer.POST_MODULE: WFLYSRV0153: Failed to process phase POST_MODULE of deployment "reproducer"
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:172)
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:2032)
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1955)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: java.lang.ClassNotFoundException: test.ejb.TestSLSB from [Module "deployment.reproducer" from Service Module Loader]
    at org.jboss.as.ejb3.deployment.processors.BusinessViewAnnotationProcessor.getEjbClass(BusinessViewAnnotationProcessor.java:239)
    at org.jboss.as.ejb3.deployment.processors.BusinessViewAnnotationProcessor.deploy(BusinessViewAnnotationProcessor.java:89)
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:165)
    ... 5 more
Caused by: java.lang.ClassNotFoundException: test.ejb.TestSLSB from [Module "deployment.reproducer" from Service Module Loader]
    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:198)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:412)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:400)
    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:116)
    at org.jboss.as.ejb3.deployment.processors.BusinessViewAnnotationProcessor.getEjbClass(BusinessViewAnnotationProcessor.java:237)
    ... 7 more

16:50:12,640 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([("deployment" => "reproducer-1.0.0.war")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.reproducer.POST_MODULE" => "WFLYSRV0153: Failed to process phase POST_MODULE of deployment \"reproducer\"
    Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: java.lang.ClassNotFoundException: test.ejb.TestSLSB from [Module \"deployment.reproducer\" from Service Module Loader]
    Caused by: java.lang.ClassNotFoundException: test.ejb.TestSLSB from [Module \"deployment.reproducer\" from Service Module Loader]"}}

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 7.y
    • 6.y

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In