2012-12-10 90 views
0

我有使用JAXB作爲編組的Web服務。當我將它放在Tomcat服務器上時,一切正常,解析,發送響應 - 都很好。當我改變到JBoss 4.2.3我得到了以下異常:將SOAP Web Service從tomcat遷移到Jboss 4.2.3

java.lang.ClassCastException: org.jboss.ws.core.soap.TextImpl cannot be cast to org.w3c.dom.Comment 
    at org.apache.xml.serializer.TreeWalker.startNode(TreeWalker.java:287) ~[na:2.7.0] 
    at org.apache.xml.serializer.TreeWalker.traverse(TreeWalker.java:143) ~[na:2.7.0] 
    at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:389) ~[na:4.2.3.GA (build: SVNTag=JBoss_4_2_3_GA date=200807181439)] 
    at org.springframework.ws.server.endpoint.AbstractLoggingInterceptor.logMessageSource(AbstractLoggingInterceptor.java:149) ~[spring-ws-core-2.1.1.RELEASE.jar:na] 
    at org.springframework.ws.server.endpoint.AbstractLoggingInterceptor.handleRequest(AbstractLoggingInterceptor.java:89) ~[spring-ws-core-2.1.1.RELEASE.jar:na] 
    at org.springframework.ws.server.endpoint.interceptor.DelegatingSmartEndpointInterceptor.handleRequest(DelegatingSmartEndpointInterceptor.java:78) ~[spring-ws-core-2.1.1.RELEASE.jar:na] 
    at org.springframework.ws.server.MessageDispatcher.dispatch(MessageDispatcher.java:224) [spring-ws-core-2.1.1.RELEASE.jar:na] 
    at org.springframework.ws.server.MessageDispatcher.receive(MessageDispatcher.java:173) [spring-ws-core-2.1.1.RELEASE.jar:na] 
    at org.springframework.ws.transport.support.WebServiceMessageReceiverObjectSupport.handleConnection(WebServiceMessageReceiverObjectSupport.java:88) [spring-ws-core-2.1.1.RELEASE.jar:na] 
    at org.springframework.ws.transport.http.WebServiceMessageReceiverHandlerAdapter.handle(WebServiceMessageReceiverHandlerAdapter.java:59) [spring-ws-core-2.1.1.RELEASE.jar:na] 
    at org.springframework.ws.transport.http.MessageDispatcherServlet.doService(MessageDispatcherServlet.java:221) [spring-ws-core-2.1.1.RELEASE.jar:na] 
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882) [spring-webmvc-3.1.2.RELEASE.jar:3.1.2.RELEASE] 
    at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:789) [spring-webmvc-3.1.2.RELEASE.jar:3.1.2.RELEASE] 
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:710) [servlet-api.jar:4.2.3.GA (build: SVNTag=JBoss_4_2_3_GA date=200807181439)] 
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) [servlet-api.jar:4.2.3.GA (build: SVNTag=JBoss_4_2_3_GA date=200807181439)] 
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) [tmp1688167291209800062jbossweb.jar:4.2.3.GA (build: SVNTag=JBoss_4_2_3_GA date=200807181439)] 
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [tmp1688167291209800062jbossweb.jar:4.2.3.GA (build: SVNTag=JBoss_4_2_3_GA date=200807181439)] 
    at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96) [tmp124843923712011984jbossweb-service.jar:4.2.3.GA (build: SVNTag=JBoss_4_2_3_GA date=200807181439)] 
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) [tmp1688167291209800062jbossweb.jar:4.2.3.GA (build: SVNTag=JBoss_4_2_3_GA date=200807181439)] 
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [tmp1688167291209800062jbossweb.jar:4.2.3.GA (build: SVNTag=JBoss_4_2_3_GA date=200807181439)] 
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230) [tmp1688167291209800062jbossweb.jar:4.2.3.GA (build: SVNTag=JBoss_4_2_3_GA date=200807181439)] 
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) [tmp1688167291209800062jbossweb.jar:4.2.3.GA (build: SVNTag=JBoss_4_2_3_GA date=200807181439)] 
    at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182) [tmp124843923712011984jbossweb-service.jar:4.2.3.GA (build: SVNTag=JBoss_4_2_3_GA date=200807181439)] 
    at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84) [tmp124843923712011984jbossweb-service.jar:4.2.3.GA (build: SVNTag=JBoss_4_2_3_GA date=200807181439)] 
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) [tmp1688167291209800062jbossweb.jar:4.2.3.GA (build: SVNTag=JBoss_4_2_3_GA date=200807181439)] 
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [tmp1688167291209800062jbossweb.jar:4.2.3.GA (build: SVNTag=JBoss_4_2_3_GA date=200807181439)] 
    at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157) [tmp124843923712011984jbossweb-service.jar:4.2.3.GA (build: SVNTag=JBoss_4_2_3_GA date=200807181439)] 
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [tmp1688167291209800062jbossweb.jar:4.2.3.GA (build: SVNTag=JBoss_4_2_3_GA date=200807181439)] 
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262) [tmp1688167291209800062jbossweb.jar:4.2.3.GA (build: SVNTag=JBoss_4_2_3_GA date=200807181439)] 
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844) [tmp1688167291209800062jbossweb.jar:4.2.3.GA (build: SVNTag=JBoss_4_2_3_GA date=200807181439)] 
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) [tmp1688167291209800062jbossweb.jar:4.2.3.GA (build: SVNTag=JBoss_4_2_3_GA date=200807181439)] 
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446) [tmp1688167291209800062jbossweb.jar:4.2.3.GA (build: SVNTag=JBoss_4_2_3_GA date=200807181439)] 
    at java.lang.Thread.run(Thread.java:722) [na:1.7.0_09] 

源端點

@PayloadRoot(localPart = "chain", namespace = "http://jakisadres.com/caservice") 
    @ResponsePayload 
    public ChainResponse getChain(@RequestPayload Chain param) { 

     ChainResponse response = new ChainResponse(); 
     response.setChainResult("cos"); 
     return response; 
    } 

的DispatcherServlet

<sws:annotation-driven/> 

    <context:annotation-config /> 

    <bean class="org.springframework.ws.server.endpoint.mapping.PayloadRootAnnotationMethodEndpointMapping"> 
     <description>An endpoint mapping strategy that looks for @Endpoint and @PayloadRoot annotations.</description> 
    </bean> 

    <sws:interceptors> 
     <bean class="org.springframework.ws.soap.server.endpoint.interceptor.SoapEnvelopeLoggingInterceptor"/> 
    </sws:interceptors> 


    <bean id="marshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller"> 
      <property name="contextPath" value="pl.signet.famoc.ws.jaxb.marshaller" /> 
    </bean> 
<bean id="messageFactory" class="org.springframework.ws.soap.saaj.SaajSoapMessageFactory"/> 

    <bean class="org.springframework.ws.transport.http.WebServiceMessageReceiverHandlerAdapter" 
      p:messageFactory-ref="messageFactory"/> 

    <bean class="org.springframework.ws.transport.http.WsdlDefinitionHandlerAdapter"/> 

任何線索我失去了什麼?

+0

添加一些與您的錯誤相關的來源。 – Ami

+0

我道歉,編輯。 – Grzzzzzzzzzzzzz

回答

0

好的,所以我得到了答案,問題在於JBOSS的Classloader。服務器的實現包含一些在我的項目依賴關係之前使用的類,這就是爲什麼JBOSS使用默認解析器javax.xml.bind來解析JAXB。