Using CXF2.7.0 build with WAR in WildFly 10
prabahard Mar 1, 2016 9:46 AMI have WAR module that uses CXF 2.7.0 library to generate client code (I can't upgrade to use WildFly 10 provided 3.1.4) right now for timing issues. So in order to pick the CXF from WEB-IN\lib folder, I have added following:
jboss-deployment-structure.xml
<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
<!-- Make sub deployments isolated by default, so they cannot see each others classes without a Class-Path entry -->
<ear-subdeployments-isolated>false</ear-subdeployments-isolated>
<!-- This corresponds to the top level deployment. For a war this is the war's module, for an ear -->
<!-- This is the top level ear module, which contains all the classes in the EAR's lib folder -->
<deployment>
<!-- exclude-subsystem prevents a subsystems deployment unit processors running on a deployment -->
<!-- which gives basically the same effect as removing the subsystem, but it only affects single deployment -->
<exclude-subsystems>
<subsystem name="jaxrs" />
<subsystem name="resteasy" />
</exclude-subsystems>
<!-- Exclusions allow you to prevent the server from automatically adding some dependencies -->
<exclusions>
<!-- Exclude Version cxf of JBOSS -->
<module name="org.apache.cxf" />
<!-- Exclude JAVA EE of JBOSS (javax.ws..) => Add dependency javax.annotation -->
<module name="javaee.api" />
<!-- Exclude RestEasy conflict (javax.ws.rs.ext.RunDelegate) -->
<module name="org.jboss.resteasy.resteasy-jackson-provider" />
<module name="org.jboss.as.jaxrs"/>
<module name="org.jboss.resteasy.resteasy-jaxrs"/>
<module name="org.jboss.resteasy.resteasy-cdi"/>
<module name="org.jboss.resteasy.jackson-provider"/>
<module name="org.jboss.resteasy.resteasy-atom-provider"/>
<module name="org.jboss.resteasy.resteasy-hibernatevalidator-provider"/>
<module name="org.jboss.resteasy.resteasy-jaxb-provider"/>
<module name="org.jboss.resteasy.resteasy-jettison-provider"/>
<module name="org.jboss.resteasy.resteasy-jsapi"/>
<module name="org.jboss.resteasy.resteasy-multipart-provider"/>
<module name="org.jboss.resteasy.resteasy-yaml-provider"/>
<module name="org.codehaus.jackson.jackson-core-asl"/>
<module name="org.codehaus.jackson.jackson-jaxrs"/>
<module name="org.codehaus.jackson.jackson-mapper-asl"/>
<module name="org.codehaus.jackson.jackson-xc"/>
<module name="org.codehaus.jettison"/>
<module name="javax.ws.rs.api"/>
</exclusions>
</deployment>
</jboss-deployment-structure>
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
id="WebApp_ID" version="2.5">
<display-name>Comcast Web</display-name>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<servlet>
<description></description>
<display-name>content</display-name>
<servlet-name>contentServlet</servlet-name>
<servlet-class>com.allconnect.comcast.quartz.ContentServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>contentServlet</servlet-name>
<url-pattern>/content</url-pattern>
</servlet-mapping>
</web-app>
Below is the stake trace i am getting during the deployment. Could someone can point me if I need to add anything to module exclusion list? Thanks
log trace
2016-03-01 06:55:14,784 INFO [org.hibernate.validator.internal.util.Version] (MSC service thread 1-5) HV000001: Hibernate Validator 5.2.3.Final
2016-03-01 06:55:15,032 WARN [org.jboss.modules] (MSC service thread 1-4) Failed to define class org.apache.cxf.ws.security.sts.provider.SecurityTokenServiceProvider in Module "deployment.cxf-web-0.0.1-SNAPSHOT.war:main" from Service Module Loader: java.lang.NoClassDefFoundError: Failed to link org/apache/cxf/ws/security/sts/provider/SecurityTokenServiceProvider (Module "deployment.cxf-web-0.0.1-SNAPSHOT.war:main" from Service Module Loader): javax/xml/ws/Provider
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:446)
at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:274)
at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:78)
at org.jboss.modules.Module.loadModuleClass(Module.java:605)
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:363)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:351)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:93)
at org.wildfly.extension.undertow.deployment.ServletContainerInitializerDeploymentProcessor.loadClassInfoSet(ServletContainerInitializerDeploymentProcessor.java:254)
at org.wildfly.extension.undertow.deployment.ServletContainerInitializerDeploymentProcessor.deploy(ServletContainerInitializerDeploymentProcessor.java:166)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:147)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)
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)
2016-03-01 06:55:15,037 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC000001: Failed to start service jboss.deployment.unit."cxf-web-0.0.1-SNAPSHOT.war".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.unit."cxf-web-0.0.1-SNAPSHOT.war".INSTALL: WFLYSRV0153: Failed to process phase INSTALL of deployment "cxf-web-0.0.1-SNAPSHOT.war"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:154)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)
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: java.lang.NoClassDefFoundError: Failed to link org/apache/cxf/ws/security/sts/provider/SecurityTokenServiceProvider (Module "deployment.cxf-web-0.0.1-SNAPSHOT.war:main" from Service Module Loader): javax/xml/ws/Provider
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:446)
at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:274)
at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:78)
at org.jboss.modules.Module.loadModuleClass(Module.java:605)
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:363)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:351)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:93)
at org.wildfly.extension.undertow.deployment.ServletContainerInitializerDeploymentProcessor.loadClassInfoSet(ServletContainerInitializerDeploymentProcessor.java:254)
at org.wildfly.extension.undertow.deployment.ServletContainerInitializerDeploymentProcessor.deploy(ServletContainerInitializerDeploymentProcessor.java:166)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:147)
... 5 more
2016-03-01 06:55:15,061 ERROR [org.jboss.as.controller.management-operation] (management task-8) WFLYCTL0013: Operation ("add") failed - address: ([("deployment" => "cxf-web-0.0.1-SNAPSHOT.war")]) - failure description: {
"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"cxf-web-0.0.1-SNAPSHOT.war\".INSTALL" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"cxf-web-0.0.1-SNAPSHOT.war\".INSTALL: WFLYSRV0153: Failed to process phase INSTALL of deployment \"cxf-web-0.0.1-SNAPSHOT.war\"
Caused by: java.lang.NoClassDefFoundError: Failed to link org/apache/cxf/ws/security/sts/provider/SecurityTokenServiceProvider (Module \"deployment.cxf-web-0.0.1-SNAPSHOT.war:main\" from Service Module Loader): javax/xml/ws/Provider"},
"WFLYCTL0180: Services with missing/unavailable dependencies" => [
"jboss.deployment.unit.\"cxf-web-0.0.1-SNAPSHOT.war\".batch.environment is missing [jboss.deployment.unit.\"cxf-web-0.0.1-SNAPSHOT.war\".beanmanager]",
"jboss.deployment.unit.\"cxf-web-0.0.1-SNAPSHOT.war\".weld.weldClassIntrospector is missing [jboss.deployment.unit.\"cxf-web-0.0.1-SNAPSHOT.war\".beanmanager]"
]
}
2016-03-01 06:55:15,066 ERROR [org.jboss.as.server] (management task-8) WFLYSRV0021: Deploy of deployment "cxf-web-0.0.1-SNAPSHOT.war" was rolled back with the following failure message:
{
"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"cxf-web-0.0.1-SNAPSHOT.war\".INSTALL" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"cxf-web-0.0.1-SNAPSHOT.war\".INSTALL: WFLYSRV0153: Failed to process phase INSTALL of deployment \"cxf-web-0.0.1-SNAPSHOT.war\"
Caused by: java.lang.NoClassDefFoundError: Failed to link org/apache/cxf/ws/security/sts/provider/SecurityTokenServiceProvider (Module \"deployment.cxf-web-0.0.1-SNAPSHOT.war:main\" from Service Module Loader): javax/xml/ws/Provider"},
"WFLYCTL0180: Services with missing/unavailable dependencies" => [
"jboss.deployment.unit.\"cxf-web-0.0.1-SNAPSHOT.war\".batch.environment is missing [jboss.deployment.unit.\"cxf-web-0.0.1-SNAPSHOT.war\".beanmanager]",
"jboss.deployment.unit.\"cxf-web-0.0.1-SNAPSHOT.war\".weld.weldClassIntrospector is missing [jboss.deployment.unit.\"cxf-web-0.0.1-SNAPSHOT.war\".beanmanager]"
]
}
2016-03-01 06:55:15,073 INFO [org.jboss.as.jpa] (ServerService Thread Pool -- 61) WFLYJPA0011: Stopping Persistence Unit (phase 1 of 2) Service 'cxf-web-0.0.1-SNAPSHOT.war#transactionalUnit'
2016-03-01 06:55:15,073 INFO [org.jboss.as.jpa] (ServerService Thread Pool -- 62) WFLYJPA0011: Stopping Persistence Unit (phase 1 of 2) Service 'cxf-web-0.0.1-SNAPSHOT.war#logicalUnit'
2016-03-01 06:55:15,338 INFO [org.jboss.as.server.deployment] (MSC service thread 1-5) WFLYSRV0028: Stopped deployment cxf-web-0.0.1-SNAPSHOT.war (runtime-name: cxf-web-0.0.1-SNAPSHOT.war) in 272ms
2016-03-01 06:55:15,339 INFO [org.jboss.as.controller] (management task-8) WFLYCTL0183: Service status report
WFLYCTL0184: New missing/unsatisfied dependencies:
service jboss.deployment.unit."cxf-web-0.0.1-SNAPSHOT.war".beanmanager (missing) dependents: [service jboss.deployment.unit."cxf-web-0.0.1-SNAPSHOT.war".batch.environment, service jboss.deployment.unit."cxf-web-0.0.1-SNAPSHOT.war".weld.weldClassIntrospector]
WFLYCTL0186: Services which failed to start: service jboss.deployment.unit."cxf-web-0.0.1-SNAPSHOT.war".INSTALL