title: JBOSS 7.1.1 Spring CXF error
body: <p>I have a problem with one application deploy on JBOSS 7.1.1.
  The application using Spring, Struts 2, JPA ...
  But my problem is on Web Service deployment</p>
  
  <p>My web.xml Config :</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"&gt;
      &lt;!-- ###################### SPRING ########################## --&gt;
  &lt;context-param&gt;
      &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
      &lt;param-value&gt;WEB-INF/applicationContext.xml&lt;/param-value&gt;
  &lt;/context-param&gt;
  
  &lt;context-param&gt;
      &lt;param-name&gt;webAppRootKey&lt;/param-name&gt;
      &lt;param-value&gt;Gestionwebco-war&lt;/param-value&gt;
  &lt;/context-param&gt;
  
  &lt;!-- Le listener Spring --&gt;
  &lt;listener&gt;
      &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt;
  &lt;/listener&gt;
  
  
  &lt;!-- ###################### SPRING SECURITY ########################## --&gt;
  
  &lt;!-- Filtre Spring Security --&gt;
  &lt;filter&gt;
      &lt;filter-name&gt;springSecurityFilterChain&lt;/filter-name&gt;
      &lt;filter-class&gt;org.springframework.web.filter.DelegatingFilterProxy&lt;/filter-class&gt;
  &lt;/filter&gt;
  
  &lt;!-- Mapping Spring Security --&gt;
  &lt;filter-mapping&gt;
      &lt;filter-name&gt;springSecurityFilterChain&lt;/filter-name&gt;
      &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
  &lt;/filter-mapping&gt;
  
  &lt;!-- Le listener Spring security --&gt;
  &lt;listener&gt;
      &lt;listener-class&gt;org.springframework.security.web.session.HttpSessionEventPublisher&lt;/listener-class&gt;
  &lt;/listener&gt;
  
  &lt;!-- ###################### ENCODING UTF-8 ########################## --&gt;
  
  &lt;!-- Filtre Encoding UTF-8 --&gt;
  &lt;filter&gt;
      &lt;filter-name&gt;encodingFilter&lt;/filter-name&gt;
      &lt;filter-class&gt;org.springframework.web.filter.CharacterEncodingFilter&lt;/filter-class&gt;
      &lt;init-param&gt;
          &lt;param-name&gt;encoding&lt;/param-name&gt;
          &lt;param-value&gt;UTF-8&lt;/param-value&gt;
      &lt;/init-param&gt;
      &lt;init-param&gt;
          &lt;param-name&gt;forceEncoding&lt;/param-name&gt;
          &lt;param-value&gt;true&lt;/param-value&gt;
      &lt;/init-param&gt;
  &lt;/filter&gt;
  &lt;!-- Mapping du filtre encoding --&gt;
  &lt;filter-mapping&gt;
      &lt;filter-name&gt;encodingFilter&lt;/filter-name&gt;
      &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
  &lt;/filter-mapping&gt;
  </code></pre>
  
  <p></p>
  
  <p>My Jboss-deployment.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;jboss-deployment-structure&gt;
  &lt;deployment&gt;
      &lt;dependencies&gt;
          &lt;module name="org.springframework.spring" slot="snowdrop"&gt;
              &lt;imports&gt;
                  &lt;include path="META-INF**" /&gt;
                  &lt;include path="org**" /&gt;
              &lt;/imports&gt;
          &lt;/module&gt;
          &lt;module name="org.apache.cxf"&gt;
              &lt;imports&gt;
                  &lt;include path="**"/&gt;
              &lt;/imports&gt;
          &lt;/module&gt;
      &lt;/dependencies&gt;
  &lt;/deployment&gt;
  </code></pre>
  
  <p></p>
  
  <p>My application-context.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;beans xmlns="http://www.springframework.org/schema/beans"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jaxws="http://cxf.apache.org/jaxws"
  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd"&gt;  
  &lt;import resource="classpath:META-INF/cxf/cxf.xml" /&gt;
  &lt;import resource="classpath:META-INF/cxf/cxf-servlet.xml" /&gt;
  
  &lt;import resource="classpath:spring-dao.xml" /&gt;
  
  &lt;import resource="classpath:spring-process.xml" /&gt;
  
  &lt;import resource="classpath:spring-web.xml" /&gt;
  
  &lt;import resource="classpath:spring-security.xml"/&gt;
  
  &lt;jaxws:endpoint id="testServiceEndPoint" implementor="#testService" address="/TestService" /&gt;
  </code></pre>
  
  <p></p>
  
  <p>My spring-web.xml</p>
  
  <pre><code>&lt;bean id="testService" class="services.impl.TestService"&gt;&lt;/bean&gt;
  </code></pre>
  
  <p>My Interface :</p>
  
  <pre><code>package services;import javax.jws.WebMethod;
  import javax.jws.WebParam;
  import javax.jws.WebResult;
  import javax.jws.WebService;
  @WebService(name = "TestService", targetNamespace = "http://localhost:8080/gestion/")
  public interface ITestService {
      @WebMethod
      @WebResult(name = "reponse")
      public abstract String getNom(@WebParam(name = "nom") String nom);
  }
  </code></pre>
  
  <p>And my impl :</p>
  
  <pre><code>package services.impl;
  import javax.jws.WebService;
  import org.springframework.transaction.annotation.Transactional;
  import services.ITestService;
  @WebService(endpointInterface = "services.ITestService", targetNamespace = "http://localhost:8080/gestion/")
  @Transactional(timeout = 1800)
  public class TestService implements ITestService {
      public String getNom(String nom) {
          return "Salut "+nom;
      }
  }
  </code></pre>
  
  <p>And JBOSS log :</p>
  
  <pre><code>15:20:59,472 WARN  [org.jboss.modules] (MSC service thread 1-5) Failed to define class org.apache.cxf.jaxws.spring.NamespaceHandler in Module "org.apache.cxf:main" from local module loader @6564dbd5 (roots: /Users/mowmow/Documents/Projet pro/jboss-as-7.1.1.Final/modules): java.lang.LinkageError: Failed to link org/apache/cxf/jaxws/spring/NamespaceHandler (Module "org.apache.cxf:main" from local module loader @6564dbd5 (roots: /Users/mowmow/Documents/Projet pro/jboss-as-7.1.1.Final/modules))
  at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:396)
  at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:243)
  at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:73)
  at org.jboss.modules.Module.loadModuleClass(Module.java:517)
  at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:182)
  at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)
  at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)
  at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
  at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)
  at org.springframework.util.ClassUtils.forName(ClassUtils.java:258) [spring-core.jar:3.1.4.RELEASE]
  at org.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver.resolve(DefaultNamespaceHandlerResolver.java:124) [spring-beans.jar:3.1.4.RELEASE]
  at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1418) [spring-beans.jar:3.1.4.RELEASE]
  at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1413) [spring-beans.jar:3.1.4.RELEASE]
  at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:184) [spring-beans.jar:3.1.4.RELEASE]
  at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.doRegisterBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:140) [spring-beans.jar:3.1.4.RELEASE]
  at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:111) [spring-beans.jar:3.1.4.RELEASE]
  at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:493) [spring-beans.jar:3.1.4.RELEASE]
  at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390) [spring-beans.jar:3.1.4.RELEASE]
  at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334) [spring-beans.jar:3.1.4.RELEASE]
  at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302) [spring-beans.jar:3.1.4.RELEASE]
  at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:174) [spring-beans.jar:3.1.4.RELEASE]
  at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:209) [spring-beans.jar:3.1.4.RELEASE]
  at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180) [spring-beans.jar:3.1.4.RELEASE]
  at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:125) [spring-web.jar:3.1.4.RELEASE]
  at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:94) [spring-web.jar:3.1.4.RELEASE]
  at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:131) [spring-context.jar:3.1.4.RELEASE]
  at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:530) [spring-context.jar:3.1.4.RELEASE]
  at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:444) [spring-context.jar:3.1.4.RELEASE]
  at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:388) [spring-web.jar:3.1.4.RELEASE]
  at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:293) [spring-web.jar:3.1.4.RELEASE]
  at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111) [spring-web.jar:3.1.4.RELEASE]
  at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3392) [jbossweb-7.0.13.Final.jar:]
  at org.apache.catalina.core.StandardContext.start(StandardContext.java:3850) [jbossweb-7.0.13.Final.jar:]
  at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
  at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
  at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
  at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) [classes.jar:1.6.0_65]
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) [classes.jar:1.6.0_65]
  at java.lang.Thread.run(Thread.java:695) [classes.jar:1.6.0_65]Caused by: java.lang.NoClassDefFoundError: org/springframework/beans/factory/xml/NamespaceHandlerSupport
  at java.lang.ClassLoader.defineClass1(Native Method) [classes.jar:1.6.0_65]
  at java.lang.ClassLoader.defineClassCond(ClassLoader.java:637) [classes.jar:1.6.0_65]
  at java.lang.ClassLoader.defineClass(ClassLoader.java:621) [classes.jar:1.6.0_65]
  at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141) [classes.jar:1.6.0_65]
  at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:327)
  at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:391)
  ... 38 moreCaused by: java.lang.ClassNotFoundException: org.springframework.beans.factory.xml.NamespaceHandlerSupport from [Module "org.apache.cxf:main" from local module loader @6564dbd5 (roots: /Users/mowmow/Documents/Projet pro/jboss-as-7.1.1.Final/modules)]
  at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)
  at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)
  at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)
  at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:423)
  at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
  at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)
  ... 44 more 15:20:59,488 ERROR [org.springframework.web.context.ContextLoader] (MSC service thread 1-5) Context initialization failed: org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from ServletContext resource [/WEB-INF/applicationContext.xml]; nested exception is org.springframework.beans.FatalBeanException: NamespaceHandler class [org.apache.cxf.jaxws.spring.NamespaceHandler] for namespace [http://cxf.apache.org/jaxws] not found; nested exception is java.lang.ClassNotFoundException: org.apache.cxf.jaxws.spring.NamespaceHandler from [Module "deployment.Gestion-web-co-web.war:main" from Service Module Loader]
  at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:412) [spring-beans.jar:3.1.4.RELEASE]
  at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334) [spring-beans.jar:3.1.4.RELEASE]
  at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302) [spring-beans.jar:3.1.4.RELEASE]
  at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:174) [spring-beans.jar:3.1.4.RELEASE]
  at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:209) [spring-beans.jar:3.1.4.RELEASE]
  at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180) [spring-beans.jar:3.1.4.RELEASE]
  at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:125) [spring-web.jar:3.1.4.RELEASE]
  at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:94) [spring-web.jar:3.1.4.RELEASE]
  at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:131) [spring-context.jar:3.1.4.RELEASE]
  at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:530) [spring-context.jar:3.1.4.RELEASE]
  at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:444) [spring-context.jar:3.1.4.RELEASE]
  at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:388) [spring-web.jar:3.1.4.RELEASE]
  at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:293) [spring-web.jar:3.1.4.RELEASE]
  at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111) [spring-web.jar:3.1.4.RELEASE]
  at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3392) [jbossweb-7.0.13.Final.jar:]
  at org.apache.catalina.core.StandardContext.start(StandardContext.java:3850) [jbossweb-7.0.13.Final.jar:]
  at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
  at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
  at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
  at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) [classes.jar:1.6.0_65]
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) [classes.jar:1.6.0_65]
  at java.lang.Thread.run(Thread.java:695) [classes.jar:1.6.0_65]Caused by: org.springframework.beans.FatalBeanException: NamespaceHandler class [org.apache.cxf.jaxws.spring.NamespaceHandler] for namespace [http://cxf.apache.org/jaxws] not found; nested exception is java.lang.ClassNotFoundException: org.apache.cxf.jaxws.spring.NamespaceHandler from [Module "deployment.Gestion-web-co-web.war:main" from Service Module Loader]
  at org.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver.resolve(DefaultNamespaceHandlerResolver.java:135) [spring-beans.jar:3.1.4.RELEASE]
  at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1418) [spring-beans.jar:3.1.4.RELEASE]
  at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1413) [spring-beans.jar:3.1.4.RELEASE]
  at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:184) [spring-beans.jar:3.1.4.RELEASE]
  at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.doRegisterBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:140) [spring-beans.jar:3.1.4.RELEASE]
  at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:111) [spring-beans.jar:3.1.4.RELEASE]
  at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:493) [spring-beans.jar:3.1.4.RELEASE]
  at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390) [spring-beans.jar:3.1.4.RELEASE]
  ... 21 moreCaused by: java.lang.ClassNotFoundException: org.apache.cxf.jaxws.spring.NamespaceHandler from [Module "deployment.Gestion-web-co-web.war:main" from Service Module Loader]
  at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)
  at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)
  at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)
  at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
  at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)
  at org.springframework.util.ClassUtils.forName(ClassUtils.java:258) [spring-core.jar:3.1.4.RELEASE]
  at org.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver.resolve(DefaultNamespaceHandlerResolver.java:124) [spring-beans.jar:3.1.4.RELEASE]
  ... 28 more
  </code></pre>
  
  <p>Any solution ?</p>