Topic
1 reply Latest Post - ‏2012-09-04T13:42:31Z by mburati
D7F4_Ranjeeth_PT
D7F4_Ranjeeth_PT
1 Post
ACCEPTED ANSWER

Pinned topic Websphere : ClassCastException ncompatible with javax.servle for Webservice

‏2012-09-01T06:22:18Z |
I am using WAS 7.0 Developer version. I am not able to get the wsdl file.
FFDC error log is attached.It works fine with jboss.

FFDC Error:
FFDC Exception:java.lang.ClassCastException SourceId:com.ibm.ws.webcontainer.webapp.WebAppServletManager.loadServlet ProbeId:213 Reporter:com.ibm.ws.webcontainer.servlet.ServletWrapper$1@6e986e98
java.lang.ClassCastException: com.railcorp.cncs.wims.eventmanagement.ws.WimsEventManagementWS incompatible with javax.servlet.Servlet
at com.ibm.ws.webcontainer.servlet.ServletWrapper$1.run(ServletWrapper.java:1682)
at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:118)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.loadServlet(ServletWrapper.java:1673)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.initialize(ServletWrapper.java:1581)
at com.ibm.wsspi.webcontainer.extension.WebExtensionProcessor.createServletWrapper(WebExtensionProcessor.java:98)

My web.xml:

<!-- Web Service -->
<servlet>
<servlet-name>WimsEventManagementWS</servlet-name>
<servlet-class>com.railcorp.cncs.wims.eventmanagement.ws.WimsEventManagementWS</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>WimsEventManagementWS</servlet-name>
<url-pattern>/WimsEventManagementWS</url-pattern>
</servlet-mapping>

WimsEventManagementWS is webservice created using @webservice and @webmethod annotation.

I am using struts 2.0 framework

The have the follwoing jar files in my lib.

commons-beanutils-1.7.0.jar,commons-digester-1.8.jar,commons-fileupload-1.1.1.jar, freemarker-2.3.8.jar,gson-1.7.1.jar,itext-2.0.8.jar,javaee-api-5.jar, jxl-2.6.10.jar,ognl-2.6.11.jar,retrotranslator-runtime-1.0.4.jar, struts2-core-2.1.8.1.jar,struts2-tiles-plugin-2.1.8.1.jar, tiles-api-2.1.0.jar,tiles-compat-2.1.0.jar,tiles-core-2.1.0.jar, tiles-jsp- 2.1.0.jar,tiles-servlet-2.1.0.jar,xwork-core-2.1.6.jar
Updated on 2012-09-04T13:42:31Z at 2012-09-04T13:42:31Z by mburati
  • mburati
    mburati
    352 Posts
    ACCEPTED ANSWER

    Re: Websphere : ClassCastException ncompatible with javax.servle for Webservice

    ‏2012-09-04T13:42:31Z  in response to D7F4_Ranjeeth_PT
    This forum is for the discussion of questions/issues around consuming web services with the IBM Web Experience Factory tooling, and as such is typically monitored by experts in that area.

    Your issue does not seem related to Web Experience Factory, so you may find more answers on a WAS WS forum.

    It does look like the main cause of that error is the following line in that stack trace:

    java.lang.ClassCastException: com.railcorp.cncs.wims.eventmanagement.ws.WimsEventManagementWS incompatible with javax.servlet.Servlet

    and a likely cause of that is a version mismatch between the version of the servlet API that the class was generated with vs the version you're trying to use it with.

    ..mb1