ClassNotFoundException when using --runtime-name argument for deployment

151 views
Skip to first unread message

Christian Winkler

unread,
May 29, 2024, 6:06:02 AM5/29/24
to WildFly

I need to use the --runtime-name argument when deploying an application for giving a stable name for HA singleton deployment which uses the runtime-name (deployment) for distinguishing singleton deployments. The default - the WAR's filename - does not work because our WAR filename contains a version number. A new version would thus form a different singleton.

So I deploy (WildFly 27.0.1) using a command-line like: ./jboss-cli.sh --connect --command="deploy MyApp-1.0.0.war --name=MyApp-1.0.0.war --runtime-name=MyApp --force"

When using the filename as runtime-name (or omitting the --runtime-name arg), the application loads without issue.

But when I use a runtime-name that is different from the filename of the WAR file, the application does not start because none of the included classes is found. I.e., I get ClassNotFoundException for any class contained in the WAR.

Am I doing something wrong?


2024-05-28 15:15:11,201 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC000001: Failed to start service jboss.deployment.unit.MyApp.POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.unit.MyApp.POST_MODULE: WFLYSRV0153: Failed to process phase POST_MODULE of deployment "MyApp" at org.jboss...@19.0.1.Final//org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:189) at org.jb...@1.4.13.Final//org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1739) at org.jb...@1.4.13.Final//org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1701) at org.jb...@1.4.13.Final//org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1559) at org.jbos...@2.4.0.Final//org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35) at org.jbos...@2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1990) at org.jbos...@2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486) at org.jbos...@2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377) at java.base/java.lang.Thread.run(Thread.java:833) Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: java.lang.ClassNotFoundException:com.my.app.server.reports.control.TabControl from [Module "deployment.MyApp" from Service Module Loader] at org.jbos...@27.0.1.Final//org.jboss.as.ejb3.deployment.processors.BusinessViewAnnotationProcessor.getEjbClass(BusinessViewAnnotationProcessor.java:260) at org.jbos...@27.0.1.Final//org.jboss.as.ejb3.deployment.processors.BusinessViewAnnotationProcessor.deploy(BusinessViewAnnotationProcessor.java:89) at org.jboss...@19.0.1.Final//org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:182) ... 8 more Caused by: java.lang.ClassNotFoundException:com.my.app.server.reports.control.TabControl from [Module "deployment.MyApp" from Service Module Loader] at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:200) at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:410) at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398) at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:116) at org.jbos...@27.0.1.Final//org.jboss.as.ejb3.deployment.processors.BusinessViewAnnotationProcessor.getEjbClass(BusinessViewAnnotationProcessor.java:258) ... 10 more



Brian Stansberry

unread,
May 30, 2024, 7:40:15 PM5/30/24
to WildFly
The runtime-name value needs to include the .war extension. WildFly's most basic deployment processors look to the file extension to determine what type of deployment it is. If the ones for a war don't see .war they assume it's not a war and don't process the deployment.
Message has been deleted

Christian Winkler

unread,
Jun 3, 2024, 3:51:15 AM6/3/24
to WildFly
Yes, adding .war extension to the runtime-name solves the issue.
Thanks for your help.
Reply all
Reply to author
Forward
0 new messages