title: JBoss 6 EAP JaxWsProxyFactoryBean NoClassDefFoundError
body: <p>I'm migrating an application from JBoss 6.1.0 JBoss EAP 4.2.xa.</p>
  
  <p>I know I have changed many things, one of the most important is that JBoss now includes most of the framework / most used libraries (modules), which is great (war files smaller).</p>
  
  <p>Now, I have two applications, both mounted with Spring / CXF and Maven2. One exposes a web services and the second for the first client.</p>
  
  <p>The problem is in the client application, at runtime, when I try to instantiate the proxy web service I get the following error:</p>
  
  <pre><code>------ java.lang.NoClassDefFoundError: org/apache/cxf/jaxws/JaxWsProxyFactoryBean 
  at es....MyFactory.getService_WSC(MyFactory.java:59) 
  ...
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) 
  ...
  at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:169)
  ...
  at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:920) 
  at java.lang.Thread.run(Thread.java:662) Caused by: java.lang.ClassNotFoundException: org.apache.cxf.jaxws.JaxWsProxyFactoryBean from [Module "deployment.myapp.war:main" from Service Module Loader] 
  at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:196) 
  at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:444) 
  at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:432) 
  at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:399) 
  at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:374) 
  at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:119) ... 21 more ------
  </code></pre>
  
  <p>In my pom.xml, I have the following (CXF as provided):</p>
  
  <pre><code>&lt;properties&gt;    
      &lt;cxf.version&gt;2.6.6&lt;/cxf.version&gt;
      &lt;cxf.scope&gt;provided&lt;/cxf.scope&gt;
  &lt;/properties&gt;
  
      &lt;!-- CXF --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.cxf&lt;/groupId&gt;
          &lt;artifactId&gt;cxf-rt-frontend-jaxws&lt;/artifactId&gt;
          &lt;version&gt;${cxf.version}&lt;/version&gt;
          &lt;scope&gt;${cxf.scope}&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.cxf&lt;/groupId&gt;
          &lt;artifactId&gt;cxf-rt-transports-http&lt;/artifactId&gt;
          &lt;version&gt;${cxf.version}&lt;/version&gt;
          &lt;exclusions&gt;
              &lt;exclusion&gt;
                  &lt;artifactId&gt;commons-logging&lt;/artifactId&gt;
                  &lt;groupId&gt;commons-logging&lt;/groupId&gt;
              &lt;/exclusion&gt;
          &lt;/exclusions&gt;
          &lt;scope&gt;${cxf.scope}&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.cxf&lt;/groupId&gt;
          &lt;artifactId&gt;cxf-rt-ws-security&lt;/artifactId&gt;
          &lt;version&gt;${cxf.version}&lt;/version&gt;
          &lt;scope&gt;${cxf.scope}&lt;/scope&gt;
      &lt;/dependency&gt;
  </code></pre>
  
  <p>Could include CXF libraries but presumably this is not necessary and that JBoss EAP 6 already has them?, Though, if this is so why do I get the error above NoClassDefFoundError -> Caused by: java.lang.ClassNotFoundException?</p>
  
  <p>Thank you!</p>