0 Replies Latest reply on Sep 18, 2014 9:08 AM by Mark Glass

    java.lang.ClassCastException: com.sun.xml.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl cannot be cast to org.jboss.ws.core.soap.MessageFactoryImpl

    Mark Glass Newbie

      I am using JBOSS 5.1 EAP in with JDK 1.6 in a RH Linux 5 platform. I created a web service with annotations, an entry in the web.xml declaring the web service class as a servlet I can obtain the WSDL after deploying but when I send a message using XMLSpy I get the following stack trace. Has anyone seen this before? Do you know how to fix it or a work-around?

       

      //THE POJO

      @WebService(serviceName="VoucherOrderServiceService", name="VoucherOrderService",targetNamespace="http://carolina.com/voucherOrderService")

      @SOAPBinding(style = SOAPBinding.Style.DOCUMENT)

      public class VoucherOrderService extends GenericService {

          private Logger logger = Logger.getLogger(VoucherOrderService.class.getName());

          private cbs.voucher.VoucherOrder voucherOrder;

          private boolean isSuccess = false;

       

       

          @WebMethod

          @RequestWrapper(localName = "VoucherOrderServiceRequestWrapper")

          @ResponseWrapper(localName = "VoucherOrderServiceResponseWrapper")

          @WebResult(name = "VoucherOrderServiceResponse")

          public boolean pushVoucherOrder(cbs.voucher.VoucherOrder voucherOrder) {

              this.voucherOrder = voucherOrder;

       

       

              return isSuccess;

          }

       

      }

       

      IN WEB.XML

          <servlet>

              <servlet-name>VoucherOrderServiceAsServlet</servlet-name>

              <servlet-class>cbs.voucher.voucherOrderService.VoucherOrderService</servlet-class>

          </servlet>

          <servlet-mapping>

              <servlet-name>VoucherOrderServiceAsServlet</servlet-name>

              <url-pattern>/VoucherOrderService/*</url-pattern>

          </servlet-mapping>

       

      STACK TRACE AFTER SENDING SOAP MESSAGE

      09:01:23,240 ERROR [SOAPFaultHelperJAXWS] SOAP request exception

      java.lang.ClassCastException: com.sun.xml.messaging.saaj.soap.ver1_1.Envelope1_1Impl cannot be cast to org.jboss.ws.core.soap.SOAPElementImpl

              at org.jboss.ws.core.soap.SOAPEnvelopeImpl.<init>(SOAPEnvelopeImpl.java:57)

              at org.jboss.ws.core.soap.EnvelopeBuilderDOM.build(EnvelopeBuilderDOM.java:136)

              at org.jboss.ws.core.soap.EnvelopeBuilderDOM.build(EnvelopeBuilderDOM.java:96)

              at org.jboss.ws.core.soap.MessageFactoryImpl.createMessage(MessageFactoryImpl.java:294)

              at org.jboss.ws.core.soap.MessageFactoryImpl.createMessage(MessageFactoryImpl.java:193)

              at org.jboss.wsf.stack.jbws.RequestHandlerImpl.processRequest(RequestHandlerImpl.java:449)

              at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleRequest(RequestHandlerImpl.java:293)

              at org.jboss.wsf.stack.jbws.RequestHandlerImpl.doPost(RequestHandlerImpl.java:203)

              at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:129)

              at org.jboss.wsf.common.servlet.AbstractEndpointServlet.service(AbstractEndpointServlet.java:85)

              at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

      ....

      09:01:23,249 ERROR [RequestHandlerImpl] Error processing web service request

      org.jboss.ws.WSException: java.lang.ClassCastException: com.sun.xml.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl cannot be cast to org.jboss.ws.core.soap.MessageFactoryImpl

              at org.jboss.ws.WSException.rethrow(WSException.java:68)

              at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleRequest(RequestHandlerImpl.java:330)

              at org.jboss.wsf.stack.jbws.RequestHandlerImpl.doPost(RequestHandlerImpl.java:203)

              at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:129)

              at org.jboss.wsf.common.servlet.AbstractEndpointServlet.service(AbstractEndpointServlet.java:85)

              at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

              at atg.servlet.pipeline.TailPipelineServlet.service(TailPipelineServlet.java:192)

              at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:157)

              at cbs.servlet.CBSPagesJumpServlet.service(CBSPagesJumpServlet.java:52)

              at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:157)

              at atg.servlet.pipeline.DispatcherPipelineServletImpl.service(DispatcherPipelineServletImpl.java:275)

              at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:157)

              at atg.servlet.http.CookieBufferServlet.service(CookieBufferServlet.java:119)

              at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:157)

              at atg.userprofiling.ExpiredPasswordServlet.service(ExpiredPasswordServlet.java:378)

              at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:157)

              at atg.servlet.pipeline.MimeTyperPipelineServlet.service(MimeTyperPipelineServlet.java:228)

              at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:157)