Deployment fails with "IllegalArgumentException: Empty module specification" when Dependencies is empty in a jars manifest in JBoss EAP 6.x

Solution Verified - Updated

Environment

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

Issue

  • Deployment fails with "IllegalArgumentException: Empty module specification" in JBoss EAP 6.x.
ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC000001: Failed to start service jboss.deployment.unit."example.war".STRUCTURE: org.jboss.msc.service.StartException in service jboss.deployment.unit."example.war".STRUCTURE: JBAS018733: Failed to process phase STRUCTURE of deployment "example.war"
	at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:184) [jboss-as-server-7.5.18.Final-redhat-1.jar:7.5.18.Final-redhat-1]
	at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:2064) [jboss-msc-1.1.7.SP1-redhat-1.jar:1.1.7.SP1-redhat-1]
	at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1987) [jboss-msc-1.1.7.SP1-redhat-1.jar:1.1.7.SP1-redhat-1]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [rt.jar:1.8.0_161]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [rt.jar:1.8.0_161]
	at java.lang.Thread.run(Thread.java:748) [rt.jar:1.8.0_161]
Caused by: java.lang.IllegalArgumentException: Empty module specification
	at org.jboss.modules.ModuleIdentifier.fromString(ModuleIdentifier.java:169) [jboss-modules.jar:1.3.10.Final-redhat-1]
	at org.jboss.as.server.deployment.module.ManifestDependencyProcessor.deploy(ManifestDependencyProcessor.java:92) [jboss-as-server-7.5.18.Final-redhat-1.jar:7.5.18.Final-redhat-1]
	at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:177) [jboss-as-server-7.5.18.Final-redhat-1.jar:7.5.18.Final-redhat-1]
	... 5 more

Resolution

  • To resolve this issue, remove the empty Dependencies line in META-INF/MANIFEST.MF of your application. For example:

    Manifest-Version: 1.0
    Archiver-Version: Plexus Archiver
    Created-By: Apache Maven
    Dependencies:               // <-- remove this line
    Build-Jdk: 1.7.0_10
    
  • Same issue was reported in the upstream JIRA Content from issues.jboss.org is not included.WFLY-232, which was already fixed in the upstream and JBoss EAP 7.x. So, the bugzilla This content is not included.BZ#1539985 is opened to backport the fix to the future release of JBoss EAP 6.4. When it's fixed, the empty Dependencies is simply ignored and the application will be able to be deployed successfully without the exception.

Components
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.