title: Unable to deploy Spring Ws on WAS 8 - class conflicts?
body: <p>I am trying to deploy a Spring-Ws application on WAS 8 with the below configuration:</p>
  
  <p><strong>Web.xml</strong></p>
  
  <pre><code>&lt;context-param&gt;
      &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
      &lt;param-value&gt;/WEB-INF/xxx-servlet.xml&lt;/param-value&gt;
  &lt;/context-param&gt;
  
  &lt;context-param&gt;
      &lt;param-name&gt;log4jConfigLocation&lt;/param-name&gt;
      &lt;param-value&gt;/WEB-INF/log4j.properties&lt;/param-value&gt;
  &lt;/context-param&gt;
  
  &lt;listener&gt;
      &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt;
  &lt;/listener&gt;
  
  &lt;servlet&gt;
      &lt;servlet-name&gt;xxx-services&lt;/servlet-name&gt;
      &lt;servlet-class&gt;org.springframework.ws.transport.http.MessageDispatcherServlet&lt;/servlet-class&gt;
      &lt;init-param&gt;
          &lt;param-name&gt;transformWsdlLocations&lt;/param-name&gt;
          &lt;param-value&gt;true&lt;/param-value&gt;
      &lt;/init-param&gt;
      &lt;init-param&gt;
          &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
          &lt;param-value&gt;&lt;/param-value&gt;
      &lt;/init-param&gt;
      &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
  &lt;/servlet&gt;
  
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;xxx-services&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/endpoints/*&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  
  &lt;resource-ref&gt;
      &lt;description&gt;MGI Data Source&lt;/description&gt;
      &lt;res-ref-name&gt;jdbc/xxxDB&lt;/res-ref-name&gt;
      &lt;res-type&gt;javax.sql.DataSource&lt;/res-type&gt;
      &lt;res-auth&gt;Container&lt;/res-auth&gt;
  &lt;/resource-ref&gt;
  </code></pre>
  
  <p><strong>Spring-Context.xml</strong></p>
  
  <pre><code>&lt;sws:annotation-driven /&gt;
  
  &lt;context:component-scan
      base-package="com.xxx.webservices.endpoints,com.xxx.webservices.service,com.xxx.webservices.dao" /&gt;
  
  
  &lt;bean id="validatingInterceptor"
      class="org.springframework.ws.soap.server.endpoint.interceptor.PayloadValidatingInterceptor"&gt;
      &lt;property name="schemas"&gt;
          &lt;list&gt;
              &lt;value&gt;WEB-INF/classes/schemas/CodeDetails.xsd&lt;/value&gt;
              &lt;value&gt;WEB-INF/classes/schemas/GetAccountRangeConfig.xsd&lt;/value&gt;
              &lt;value&gt;WEB-INF/classes/schemas/GetCABExceptionTerms.xsd&lt;/value&gt;
              &lt;value&gt;WEB-INF/classes/schemas/SaveAccountRangeConfig.xsd&lt;/value&gt;
          &lt;/list&gt;
      &lt;/property&gt;
      &lt;property name="validateRequest" value="true" /&gt;
  &lt;/bean&gt;
  
  &lt;bean id="testService"
      class="org.springframework.ws.wsdl.wsdl11.DefaultWsdl11Definition"
      lazy-init="true"&gt;
      &lt;property name="schemaCollection"&gt;
          &lt;bean
              class="org.springframework.xml.xsd.commons.CommonsXsdSchemaCollection"&gt;
              &lt;property name="inline" value="true" /&gt;
              &lt;property name="xsds"&gt;
                  &lt;list&gt;
                      &lt;value&gt;WEB-INF/classes/schemas/CodeDetails.xsd&lt;/value&gt;
                      &lt;value&gt;WEB-INF/classes/schemas/GetAccountRangeConfig.xsd&lt;/value&gt;
                      &lt;value&gt;WEB-INF/classes/schemas/GetCABExceptionTerms.xsd&lt;/value&gt;
                      &lt;value&gt;WEB-INF/classes/schemas/SaveAccountRangeConfig.xsd&lt;/value&gt;
                  &lt;/list&gt;
              &lt;/property&gt;
          &lt;/bean&gt;
      &lt;/property&gt;
      &lt;property name="portTypeName" value="TestService" /&gt;
      &lt;property name="serviceName" value="TestService" /&gt;
      &lt;property name="locationUri"
          value="/endpoints" /&gt;
  &lt;/bean&gt;
  
  &lt;bean id="exceptionResolver"
      class="org.springframework.ws.soap.server.endpoint.SoapFaultMappingExceptionResolver"&gt;
      &lt;property name="defaultFault" value="SERVER" /&gt;
      &lt;property name="exceptionMappings"&gt;
          &lt;value&gt;
              org.springframework.oxm.ValidationFailureException=CLIENT,Invalid Request
          &lt;/value&gt;
  
      &lt;/property&gt;
  &lt;/bean&gt;
  
  &lt;bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean"&gt;
      &lt;property name="jndiName" value="java:comp/env/jdbc/xxxDB"/&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>When I build and deploy this WAR file onto WAS 8, I am getting the below error message:</p>
  
  <pre><code>SourceId: org.springframework.web.context.support.XmlWebApplicationContext.org.springframework.context.support.AbstractApplication
  </code></pre>
  
  <p>Context.refresh
    ExtendedMessage: Exception encountered during context initialization - cancelling refresh attemptorg.springframework.beans.factory
  .BeanCreationException: Error creating bean with name 'org.springframework.xml.xsd.commons.CommonsXsdSchemaCollection#0': Invocation
   of init method failed; nested exception is java.lang.NoSuchMethodError: org/apache/ws/commons/schema/XmlSchemaCollection.read(Lorg/
  xml/sax/InputSource;)Lorg/apache/ws/commons/schema/XmlSchema;
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.j
  ava:1553)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.jav
  a:539)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:
  475)
      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302)
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:72
  5)
      at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:7
  57)
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
      at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403)
      at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
      at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
      at com.ibm.ws.webcontainer.webapp.WebApp.notifyServletContextCreated(WebApp.java:1704)
      at com.ibm.ws.webcontainer.webapp.WebAppImpl.initialize(WebAppImpl.java:411)
      at com.ibm.ws.webcontainer.webapp.WebGroupImpl.addWebApplication(WebGroupImpl.java:88)
      at com.ibm.ws.webcontainer.VirtualHostImpl.addWebApplication(VirtualHostImpl.java:169)
      at com.ibm.ws.webcontainer.WSWebContainer.addWebApp(WSWebContainer.java:749)
      at com.ibm.ws.webcontainer.WSWebContainer.addWebApplication(WSWebContainer.java:634)
      at com.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerImpl.java:426)
      at com.ibm.ws.webcontainer.component.WebContainerImpl.start(WebContainerImpl.java:718)
      at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1177)
      at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:1370)
      at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:639)
      at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:968)
      at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:776)
      at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplicationDynamically(ApplicationMgrImpl.java:1379)
      at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:2189)
      at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:435)
      at com.ibm.ws.runtime.component.CompositionUnitImpl.start(CompositionUnitImpl.java:123)
      at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:378)
      at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.access$500(CompositionUnitMgrImpl.java:126)
      at com.ibm.ws.runtime.component.CompositionUnitMgrImpl$1.run(CompositionUnitMgrImpl.java:653)
      at com.ibm.ws.security.auth.ContextManagerImpl.runAs(ContextManagerImpl.java:5477)
      at com.ibm.ws.security.auth.ContextManagerImpl.runAsSystem(ContextManagerImpl.java:5603)
      at com.ibm.ws.security.core.SecurityContext.runAsSystem(SecurityContext.java:255)
      at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.startCompositionUnit(CompositionUnitMgrImpl.java:667)
      at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.startCompositionUnit(CompositionUnitMgrImpl.java:611)
      at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:1269)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:95)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:56)
      at java.lang.reflect.Method.invoke(Method.java:620)
      at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:88)
      at sun.reflect.GeneratedMethodAccessor48.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:56)
      at java.lang.reflect.Method.invoke(Method.java:620)
      at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:292)
      at javax.management.modelmbean.RequiredModelMBean$4.run(RequiredModelMBean.java:1261)
      at java.security.AccessController.doPrivileged(AccessController.java:311)
      at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:88)
      at javax.management.modelmbean.RequiredModelMBean.invokeMethod(RequiredModelMBean.java:1255)
      at javax.management.modelmbean.RequiredModelMBean.invoke(RequiredModelMBean.java:1093)
      at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:832)
      at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:814)
      at com.ibm.ws390.management.connector.corba.CorbaConnectorImpl.invoke(CorbaConnectorImpl.java:1073)
      at com.ibm.ws390.management.connector.corba._CorbaConnectorImplBase._invoke(_CorbaConnectorImplBase.java:416)
      at com.ibm.ws390.orb.CommonBridge.invoke(CommonBridge.java:1898)
      at com.ibm.ws390.orb.CommonBridge.getAndProcessWork(CommonBridge.java:725)
      at com.ibm.ws390.orb.CommonBridge.runApplicationThread(CommonBridge.java:614)
      at com.ibm.ws.util.ThreadPool$ZOSWorker.run(ThreadPool.java:2116)
  Caused by: java.lang.NoSuchMethodError: org/apache/ws/commons/schema/XmlSchemaCollection.read(Lorg/xml/sax/InputSource;)Lorg/apache/
  ws/commons/schema/XmlSchema;
      at org.springframework.xml.xsd.commons.CommonsXsdSchemaCollection.afterPropertiesSet(CommonsXsdSchemaCollection.java:140)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactor
  y.java:1612)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.j
  ava:1549)
      ... 60 more</p>
  
  <p>I searched through StackOverFlow, spent a lot of time researching on this issue in Google and tried changing the class loading strategy to Parent Last but still I am getting the same error. Here is the list of JARs inside my WEB-INF/lib:</p>
  
  <pre><code>aopalliance-1.0.jar
  commons-dbcp-1.2.2.jar
  commons-logging-1.1.3.jar
  commons-pool-1.3.jar
  jaxb-api-2.2.12.jar
  jaxb-core-2.2.11.jar
  jaxb-impl-2.2.11.jar
  log4j-1.2.17.jar
  ojdbc6-11.2.0.jar
  spring-aop-4.1.0.RC2.jar
  spring-beans-4.1.0.RC2.jar
  spring-context-4.1.0.RC2.jar
  spring-context-support-4.1.0.RC2.jar
  spring-core-4.1.0.RC2.jar
  spring-expression-4.1.0.RC2.jar
  spring-jdbc-4.1.0.RC2.jar
  spring-oxm-4.1.0.RC2.jar
  spring-secutiry-core-3.2.5.RELEASE.jar
  spring-tx-4.0.9.RELEASE.jar
  spring-web-4.1.0.RC2.jar
  spring-webmvc-4.1.0.RC2.jar
  spring-ws-core-2.2.1.RELEASE.jar
  spring-ws-security-2.2.1.RELEASE.jar
  spring-ws-test-2.2.1.RELEASE.jar
  spring-xml-2.2.1.RELEASE.jar
  xmlschema-core-2.2.1.RELEASE.jar
  xmlunit-1.5.jar
  </code></pre>
  
  <p>Has any body faced this issue? Any help would be greatly appreciated. Should I remove any other JAR? Am I missing something? </p>
  
  <p>I even tried mvn dependency:tree -Dverbose=true -Dincludes=org.apache.ws.xmlschema:xmlschema-core:: but nothing came up :(</p>