Classloading Trouble
alambley Aug 2, 2016 11:45 AMI am currently working on migrating a project to Wildfly 10 and have hit an issue with a .war that I am deploying. The deployment fails with the following MyWar.war.failed...
{"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"MyWar.war\".POST_MODULE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"MyWar.war\".POST_MODULE: WFLYSRV0153: Failed to process phase POST_MODULE of deployment \"MyWar.war\"
Caused by: java.lang.RuntimeException: WFLYSRV0177: Error getting reflective information for class a.b.c.d.e.MyWar with ClassLoader ModuleClassLoader for Module \"MyModule:main\" from local module loader @33e5ccce (finder: local module finder @5a42bbf4 (roots: Y:\\WildFly\\wildfly-10.0.0.Final\\modules,Y:\\WildFly\\wildfly-10.0.0.Final\\modules\\system\\layers\\base))
Caused by: java.lang.NoClassDefFoundError: javax/xml/datatype/DatatypeConfigurationException
Caused by: java.lang.ClassNotFoundException: javax.xml.datatype.DatatypeConfigurationException from [Module \"MyModule:main\" from local module loader @33e5ccce (finder: local module finder @5a42bbf4 (roots: Y:\\WildFly\\wildfly-10.0.0.Final\\modules,Y:\\WildFly\\wildfly-10.0.0.Final\\modules\\system\\layers\\base))]"}}
MyModule is a module filled with .jars that are required for the .war. Now javax/xml/datatype is in the JRE (jre/lib/rt.jar specifically), and from this error log it seems like MyModule does not have access to it. Now I tried adding rt.jar directly to the project as a module, but when I add it as a dependency to MyModule, I get a NullPointerException...
Caused by: java.lang.NullPointerException
at org.jboss.wsf.stack.cxf.metadata.MetadataBuilder.createDDEndpoint(MetadataBuilder.java:213)
at org.jboss.wsf.stack.cxf.metadata.MetadataBuilder.build(MetadataBuilder.java:83)
at org.jboss.wsf.stack.cxf.deployment.aspect.DescriptorDeploymentAspect.start(DescriptorDeploymentAspect.java:42)
at org.jboss.as.webservices.deployers.AspectDeploymentProcessor.deploy(AspectDeploymentProcessor.java:73)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:147)
... 5 more
Can anyone spread some insight into this? I'm pretty naive at this and it's had me stuck for a while.