title: Weblogic 10.3.6 and Spring WebServices ClassCast Exception
body: <p>I am trying to run spring-ws in weblogic 10.3.6 but I coulnd't have achieved to run it. Pom spring-ws  artifacts</p>
  
  <pre><code>    &lt;dependency&gt;
          &lt;groupId&gt;org.jvnet.jax-ws-commons.spring&lt;/groupId&gt;
          &lt;artifactId&gt;jaxws-spring&lt;/artifactId&gt;
          &lt;version&gt;1.9&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;!-- JAX-WS --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.sun.xml.ws&lt;/groupId&gt;
          &lt;artifactId&gt;jaxws-rt&lt;/artifactId&gt;
          &lt;version&gt;2.2.8&lt;/version&gt;
      &lt;/dependency&gt;  
  </code></pre>
  
  <p>web.xml  </p>
  
  <pre><code>&lt;listener&gt;
      &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt;
  &lt;/listener&gt;
  
  &lt;listener&gt;
      &lt;listener-class&gt;org.springframework.web.context.request.RequestContextListener&lt;/listener-class&gt;
  &lt;/listener&gt;
  
  &lt;listener&gt;
      &lt;listener-class&gt; com.sun.xml.ws.transport.http.servlet.WSServletContextListener &lt;/listener-class&gt;
  &lt;/listener&gt;  
  </code></pre>
  
  <p>servlets in web.xml</p>
  
  <pre><code>&lt;servlet&gt;
      &lt;servlet-name&gt;jaxws-servlet&lt;/servlet-name&gt;
      &lt;servlet-class&gt;
          com.sun.xml.ws.transport.http.servlet.WSSpringServlet
      &lt;/servlet-class&gt;
  &lt;/servlet&gt;
  
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;jaxws-servlet&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/process&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  </code></pre>
  
  <p>sun-jaxws.xml  </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;endpoints xmlns="http://java.sun.com/xml/ns/jax-ws/ri/runtime"
      version="2.0"&gt;
      &lt;endpoint name="AuthenticatorWebService"
          implementation="com.company.ws.ProcessWSImpl"
          url-pattern="/process" /&gt;
  &lt;/endpoints&gt;
  </code></pre>
  
  <p>weblogic.xml  </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;weblogic-web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                    xmlns="http://www.bea.com/ns/weblogic/weblogic-web-app"
                    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd http://www.bea.com/ns/weblogic/weblogic-web-app http://www.bea.com/ns/weblogic/weblogic-web-app.xsd"&gt;
      &lt;context-root&gt;/jobmonitor&lt;/context-root&gt;
      &lt;container-descriptor&gt;
          &lt;servlet-reload-check-secs&gt;-1&lt;/servlet-reload-check-secs&gt;
          &lt;resource-reload-check-secs&gt;-1&lt;/resource-reload-check-secs&gt;
          &lt;prefer-application-packages&gt;
              &lt;package-name&gt;antlr.*&lt;/package-name&gt;
              &lt;package-name&gt;javax.persistence.*&lt;/package-name&gt;
              &lt;package-name&gt;org.apache.commons.*&lt;/package-name&gt;
              &lt;package-name&gt;org.springframework.*&lt;/package-name&gt;
              &lt;package-name&gt;org.hibernate.*&lt;/package-name&gt;
              &lt;package-name&gt;org.stringtemplate.*&lt;/package-name&gt;
              &lt;package-name&gt;org.antlr.*&lt;/package-name&gt;
              &lt;package-name&gt;com.sun.xml.ws.*&lt;/package-name&gt;
          &lt;/prefer-application-packages&gt;
      &lt;/container-descriptor&gt;
      &lt;jsp-descriptor&gt;
          &lt;page-check-seconds&gt;-1&lt;/page-check-seconds&gt;
          &lt;verbose&gt;false&lt;/verbose&gt;
      &lt;/jsp-descriptor&gt;
  &lt;/weblogic-web-app&gt;  
  </code></pre>
  
  <p>I am getting following class cast exception:  </p>
  
  <pre><code>&lt;Nov 26, 2014 3:45:44 PM EET&gt; &lt;Warning&gt; &lt;HTTP&gt; &lt;BEA-101162&gt; &lt;User defined listener org.springframework.web.context.ContextLoaderListener failed: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.sun.xml.ws.transport.http.servlet.SpringBinding#0' defined in ServletContext resource [/WEB-INF/classes/applicationContext.xml]: Cannot create inner bean '(inner bean)' of type [org.jvnet.jax_ws_commons.spring.SpringService] while setting bean property 'service'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#45': FactoryBean threw exception on object creation; nested exception is com.sun.xml.ws.util.ServiceConfigurationError: com.sun.xml.ws.api.wsdl.writer.WSDLGeneratorExtension: Provider weblogic.wsee.jaxws.framework.policy.WSDLGeneratorExtension is specified in jar:file:/weblogic/fmw1036/Middleware/wlserver_10.3/server/lib/weblogic.jar!/META-INF/services/com.sun.xml.ws.api.wsdl.writer.WSDLGeneratorExtensionbut could not be instantiated: java.lang.ClassCastException: Cannot cast weblogic.wsee.jaxws.framework.policy.WSDLGeneratorExtension to com.sun.xml.ws.api.wsdl.writer.WSDLGeneratorExtension.
  org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.sun.xml.ws.transport.http.servlet.SpringBinding#0' defined in ServletContext resource [/WEB-INF/classes/applicationContext.xml]: Cannot create inner bean '(inner bean)' of type [org.jvnet.jax_ws_commons.spring.SpringService] while setting bean property 'service'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#45': FactoryBean threw exception on object creation; nested exception is com.sun.xml.ws.util.ServiceConfigurationError: com.sun.xml.ws.api.wsdl.writer.WSDLGeneratorExtension: Provider weblogic.wsee.jaxws.framework.policy.WSDLGeneratorExtension is specified in jar:file:/weblogic/fmw1036/Middleware/wlserver_10.3/server/lib/weblogic.jar!/META-INF/services/com.sun.xml.ws.api.wsdl.writer.WSDLGeneratorExtensionbut could not be instantiated: java.lang.ClassCastException: Cannot cast weblogic.wsee.jaxws.framework.policy.WSDLGeneratorExtension to com.sun.xml.ws.api.wsdl.writer.WSDLGeneratorExtension
          at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:282)
          at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:126)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1387)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1128)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
          Truncated. see log file for complete stacktrace
  Caused By: org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#45': FactoryBean threw exception on object creation; nested exception is com.sun.xml.ws.util.ServiceConfigurationError: com.sun.xml.ws.api.wsdl.writer.WSDLGeneratorExtension: Provider weblogic.wsee.jaxws.framework.policy.WSDLGeneratorExtension is specified in jar:file:/weblogic/fmw1036/Middleware/wlserver_10.3/server/lib/weblogic.jar!/META-INF/services/com.sun.xml.ws.api.wsdl.writer.WSDLGeneratorExtensionbut could not be instantiated: java.lang.ClassCastException: Cannot cast weblogic.wsee.jaxws.framework.policy.WSDLGeneratorExtension to com.sun.xml.ws.api.wsdl.writer.WSDLGeneratorExtension
          at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:149)
          at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:109)
          at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:275)
          at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:126)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1387)
          Truncated. see log file for complete stacktrace
  Caused By: com.sun.xml.ws.util.ServiceConfigurationError: com.sun.xml.ws.api.wsdl.writer.WSDLGeneratorExtension: Provider weblogic.wsee.jaxws.framework.policy.WSDLGeneratorExtension is specified in jar:file:/weblogic/fmw1036/Middleware/wlserver_10.3/server/lib/weblogic.jar!/META-INF/services/com.sun.xml.ws.api.wsdl.writer.WSDLGeneratorExtensionbut could not be instantiated: java.lang.ClassCastException: Cannot cast weblogic.wsee.jaxws.framework.policy.WSDLGeneratorExtension to com.sun.xml.ws.api.wsdl.writer.WSDLGeneratorExtension
          at com.sun.xml.ws.util.ServiceFinder.fail(ServiceFinder.java:278)
          at com.sun.xml.ws.util.ServiceFinder.access$600(ServiceFinder.java:153)
          at com.sun.xml.ws.util.ServiceFinder$LazyIterator.next(ServiceFinder.java:527)
          at com.sun.xml.ws.util.ServiceFinder$CompositeIterator.next(ServiceFinder.java:422)
          at com.sun.xml.ws.util.ServiceFinder.toArray(ServiceFinder.java:270)
          Truncated. see log file for complete stacktrace
  Caused By: java.lang.ClassCastException: Cannot cast weblogic.wsee.jaxws.framework.policy.WSDLGeneratorExtension to com.sun.xml.ws.api.wsdl.writer.WSDLGeneratorExtension
          at java.lang.Class.cast(Class.java:3133)
          at com.sun.xml.ws.util.ServiceFinder$LazyIterator.next(ServiceFinder.java:523)
          at com.sun.xml.ws.util.ServiceFinder$CompositeIterator.next(ServiceFinder.java:422)
          at com.sun.xml.ws.util.ServiceFinder.toArray(ServiceFinder.java:270)
          at com.sun.xml.ws.server.EndpointFactory.generateWSDL(EndpointFactory.java:652)
          Truncated. see log file for complete stacktrace
  &gt;
  Nov 26, 2014 3:45:45 PM com.sun.xml.ws.transport.http.servlet.WSServletContextListener contextDestroyed
  INFO: WSSERVLET13: JAX-WS context listener destroyed
  &lt;Nov 26, 2014 3:45:45 PM EET&gt; &lt;Error&gt; &lt;Deployer&gt; &lt;BEA-149231&gt; &lt;Unable to set the activation state to true for the application 'jobmonitor'.
  weblogic.application.ModuleException:
          at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1522)
          at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:486)
          at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
          at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
          at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
          Truncated. see log file for complete stacktrace
  Caused By: java.lang.ClassCastException: Cannot cast weblogic.wsee.jaxws.framework.policy.WSDLGeneratorExtension to com.sun.xml.ws.api.wsdl.writer.WSDLGeneratorExtension
          at java.lang.Class.cast(Class.java:3133)
          at com.sun.xml.ws.util.ServiceFinder$LazyIterator.next(ServiceFinder.java:523)
          at com.sun.xml.ws.util.ServiceFinder$CompositeIterator.next(ServiceFinder.java:422)
          at com.sun.xml.ws.util.ServiceFinder.toArray(ServiceFinder.java:270)
          at com.sun.xml.ws.server.EndpointFactory.generateWSDL(EndpointFactory.java:652)
          Truncated. see log file for complete stacktrace
  </code></pre>