title: CXF - ClassCastException (SEIStub/ClientProxy)
body: <p>I'm trying to build a client jar file to access a webservice.  I'm including the jar in a servlet/war that makes the client webservice calls.  I'm getting the following error:</p>
  
  <pre><code>INFO: 2011 Apr 14 14:57:32,780 MDT [http-thread-pool-8181(4)] ERROR     my.package.ClientServlet - Caught exception
  java.lang.ClassCastException: com.sun.xml.ws.client.sei.SEIStub cannot be cast to org.apache.cxf.frontend.ClientProxy
  at org.apache.cxf.frontend.ClientProxy.getClient(ClientProxy.java:93)
  at my.package.Client.&lt;init&gt;(Client.java:54)
  at my.package.ClientServlet.testService(TestServlet.java:118)
  </code></pre>
  
  <p>I came across this post <a href="http://yaytay.wordpress.com/2010/03/06/lsned-29-persuading-jdk-6-to-use-cxf-classes-rather-than-its-own-avoiding-seistub/" rel="noreferrer">http://yaytay.wordpress.com/2010/03/06/lsned-29-persuading-jdk-6-to-use-cxf-classes-rather-than-its-own-avoiding-seistub/</a> which says to fix the problem you need to include <code>cxf-rt-frontend-jaxws</code> as a dependency, which I do.  So, that isn't the problem/solution in my case.</p>
  
  <p>My client jar pom has these dependencies:</p>
  
  <pre><code>&lt;properties&gt;
      &lt;cxf.version&gt;2.3.3&lt;/cxf.version&gt;
  &lt;/properties&gt;
  &lt;dependencies&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;/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;/dependency&gt;
  &lt;/dependencies&gt;
  </code></pre>
  
  <p>The servlet war contains the following in its lib:</p>
  
  <pre><code>asm-3.3.jar
  bcprov-jdk15-1.45.jar
  commons-logging-1.1.1.jar
  cxf-api-2.3.3.jar
  cxf-common-schemas-2.3.3.jar
  cxf-common-utilities-2.3.3.jar
  cxf-rt-bindings-soap-2.3.3.jar
  cxf-rt-bindings-xml-2.3.3.jar
  cxf-rt-core-2.3.3.jar
  cxf-rt-databinding-jaxb-2.3.3.jar
  cxf-rt-frontend-jaxws-2.3.3.jar
  cxf-rt-frontend-simple-2.3.3.jar
  cxf-rt-ws-addr-2.3.3.jar
  cxf-rt-ws-security-2.3.3.jar
  cxf-tools-common-2.3.3.jar
  geronimo-javamail_1.4_spec-1.7.1.jar
  jaxb-impl-2.1.13.jar
  log4j-1.2.14.jar
  neethi-2.0.4.jar
  my-client-cxf-1.0.jar
  serializer-2.7.1.jar
  slf4j-api-1.4.2.jar
  slf4j-log4j12-1.4.2.jar
  stax2-api-3.0.2.jar
  woodstox-core-asl-4.0.8.jar
  wsdl4j-1.6.2.jar
  wss4j-1.5.11.jar
  xalan-2.7.1.jar
  xml-resolver-1.2.jar
  XmlSchema-1.4.7.jar
  xmlsec-1.4.4.jar
  </code></pre>
  
  <p>I've also read some posts that talk about a <code>javax.xml.ws.spi.Provider</code> file, but haven't been able to find any references that detail what it should be named, contain and placed.</p>
  
  <p>Can anybody point me in the right direction?</p>