Announcement Announcement Module
Collapse
No announcement yet.
Problem with MTOM example Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem with MTOM example

    Hi,
    I tried to run the mtom example (from Spring-WS 1.5.7, with JBoss 5.0.1 and Sun's JDK 1.6.0_10) and I am getting an exception in both the client and the server sides.

    In the client side I get an org.springframework.ws.client.WebServiceTransportE xception that points out an "internal server error" (500).

    In the JBoss log I get this:

    2009-07-08 14:40:26 [INFO ] [org.apache.catalina.core.ApplicationContext.log(Ap plicationContext.java:639)]
    Initializing Spring FrameworkServlet 'spring-ws'
    2009-07-08 14:40:28 [DEBUG] [org.jboss.ws.core.soap.MessageFactoryImpl.createMe ssage(MessageFactoryImpl.java:213)]
    createMessage: [contentType=Multipart/Related; start-info="text/xml";
    type="application/xop+xml";
    boundary="----=_Part_0_4414010.1247056825632"]
    2009-07-08 14:40:28 [DEBUG] [org.jboss.ws.core.soap.attachment.SwapableMemoryDa taSource.load(SwapableMemoryDataSource.java:135)]
    Using memory buffer, size = 462
    2009-07-08 14:40:28 [DEBUG] [org.jboss.ws.core.soap.attachment.SwapableMemoryDa taSource.load(SwapableMemoryDataSource.java:135)]
    Using memory buffer, size = 18364
    2009-07-08 14:40:28 [DEBUG] [org.jboss.ws.extensions.xop.XOPContext.replaceXOPI nclude(XOPContext.java:322)]
    Replace xop:Include on element [xmlName=image]
    2009-07-08 14:40:28 [ERROR] [org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:276)]
    Servlet.service() para servlet spring-ws lanzó excepción
    java.lang.NullPointerException
    at org.jboss.ws.extensions.xop.XOPContext.getAttachme ntByCID(XOPContext.java:380)
    at org.jboss.ws.extensions.xop.XOPContext.replaceXOPI nclude(XOPContext.java:330)
    at org.jboss.ws.extensions.xop.XOPContext.inlineXOPDa ta(XOPContext.java:165)
    at org.jboss.ws.core.soap.SOAPFactoryImpl.createEleme nt(SOAPFactoryImpl.java:140)
    at org.jboss.ws.core.soap.SOAPFactoryImpl.createEleme nt(SOAPFactoryImpl.java:101)
    at org.jboss.ws.core.soap.EnvelopeBuilderDOM.buildBod yElementDefault(EnvelopeBuilderDOM.java:376)
    at org.jboss.ws.core.soap.EnvelopeBuilderDOM.buildSOA PBodyElement(EnvelopeBuilderDOM.java:292)
    at org.jboss.ws.core.soap.EnvelopeBuilderDOM.buildSOA PBody(EnvelopeBuilderDOM.java:222)
    at org.jboss.ws.core.soap.EnvelopeBuilderDOM.build(En velopeBuilderDOM.java:154)
    at org.jboss.ws.core.soap.EnvelopeBuilderDOM.build(En velopeBuilderDOM.java:96)
    at org.jboss.ws.core.soap.MessageFactoryImpl.createMe ssage(MessageFactoryImpl.java:283)
    at org.jboss.ws.core.soap.MessageFactoryImpl.createMe ssage(MessageFactoryImpl.java:193)
    at org.springframework.ws.soap.saaj.SaajSoapMessageFa ctory.createWebServiceMessage(SaajSoapMessageFacto ry.java:168)
    at org.springframework.ws.transport.AbstractWebServic eConnection.receive(AbstractWebServiceConnection.j ava:86)
    at org.springframework.ws.transport.support.WebServic eMessageReceiverObjectSupport.handleConnection(Web ServiceMessageReceiverObjectSupport.java:86)
    at org.springframework.ws.transport.http.WebServiceMe ssageReceiverHandlerAdapter.handle(WebServiceMessa geReceiverHandlerAdapter.java:57)
    at org.springframework.ws.transport.http.MessageDispa tcherServlet.doService(MessageDispatcherServlet.ja va:230)
    at org.springframework.web.servlet.FrameworkServlet.p rocessRequest(FrameworkServlet.java:571)
    at org.springframework.web.servlet.FrameworkServlet.d oPost(FrameworkServlet.java:511)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:637)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:717)
    at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:206)
    at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doF ilter(ReplyHeaderFilter.java:96)
    at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:235)
    at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:191)
    at org.jboss.web.tomcat.security.SecurityAssociationV alve.invoke(SecurityAssociationValve.java:190)
    at org.jboss.web.tomcat.security.JaccContextValve.inv oke(JaccContextValve.java:92)
    at org.jboss.web.tomcat.security.SecurityContextEstab lishmentValve.process(SecurityContextEstablishment Valve.java:126)
    at org.jboss.web.tomcat.security.SecurityContextEstab lishmentValve.invoke(SecurityContextEstablishmentV alve.java:70)
    at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:102)
    at org.jboss.web.tomcat.service.jca.CachedConnectionV alve.invoke(CachedConnectionValve.java:158)
    at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:330)
    at org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:829)
    at org.apache.coyote.http11.Http11Protocol$Http11Conn ectionHandler.process(Http11Protocol.java:601)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run( JIoEndpoint.java:447)
    at java.lang.Thread.run(Thread.java:619)



    I used Wireshark to see the messages sent back and forth:

    The request is something like this (I find it correct, isn't it?):

    POST /mtom/services HTTP/1.1
    Accept-Encoding: gzip
    Accept: text/xml, text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
    SOAPAction: ""
    Content-Type: Multipart/Related; start-info="text/xml"; type="application/xop+xml"; boundary="----=_Part_0_4414010.1247056825632"
    Cache-Control: no-cache
    Pragma: no-cache
    User-Agent: Java/1.6.0_10
    Host: localhost:8080
    Connection: keep-alive
    Content-Length: 19147

    ------=_Part_0_4414010.1247056825632
    Content-Type: application/xop+xml; charset=utf-8; type="text/xml"

    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Header/><SOAP-ENV:Body><ns2:StoreImageRequest xmlns:ns2="http://www.springframework.org/spring-ws/samples/mtom"><ns2:name>spring-ws-logo.png</ns2:name><ns2:image><xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include" href="cid:6af0843d-fd6b-4c4d-90be-e1ed283cab41%40www.springframework.org"/></ns2:image></ns2:StoreImageRequest></SOAP-ENV:Body></SOAP-ENV:Envelope>
    ------=_Part_0_4414010.1247056825632
    Content-Type: image/png
    Content-ID: <[email protected]>
    Content-Transfer-Encoding: binary

    [... attachment bytes of the PNG image ...]
    ------=_Part_0_4414010.1247056825632--



    (Please see next post)

  • #2
    Problem with MTOM example (II)

    The response I see with Wireshark is something like this:

    HTTP/1.1 500 Error Interno del Servidor
    Server: Apache-Coyote/1.1
    Content-Type: text/html;charset=utf-8
    Content-Length: 5778
    Date: Wed, 08 Jul 2009 12:40:28 GMT
    Connection: close

    and some HTML code which includes the following:

    <pre>org.springframework.web.util.NestedServletExc eption: Request processing failed; nested exception is org.jboss.ws.WSException: Failed to inline XOP data
    org.springframework.web.servlet.FrameworkServlet.p rocessRequest(FrameworkServlet.java:583)
    org.springframework.web.servlet.FrameworkServlet.d oPost(FrameworkServlet.java:511)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:637)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:717)
    org.jboss.web.tomcat.filters.ReplyHeaderFilter.doF ilter(ReplyHeaderFilter.java:96)
    </pre></p><p><b>causa raíz</b> <pre>org.jboss.ws.WSException: Failed to inline XOP data
    org.jboss.ws.extensions.xop.XOPContext.replaceXOPI nclude(XOPContext.java:342)
    org.jboss.ws.extensions.xop.XOPContext.inlineXOPDa ta(XOPContext.java:165)
    org.jboss.ws.core.soap.SOAPFactoryImpl.createEleme nt(SOAPFactoryImpl.java:140)
    org.jboss.ws.core.soap.SOAPFactoryImpl.createEleme nt(SOAPFactoryImpl.java:101)
    org.jboss.ws.core.soap.EnvelopeBuilderDOM.buildBod yElementDefault(EnvelopeBuilderDOM.java:376)
    org.jboss.ws.core.soap.EnvelopeBuilderDOM.buildSOA PBodyElement(EnvelopeBuilderDOM.java:292)
    org.jboss.ws.core.soap.EnvelopeBuilderDOM.buildSOA PBody(EnvelopeBuilderDOM.java:222)
    org.jboss.ws.core.soap.EnvelopeBuilderDOM.build(En velopeBuilderDOM.java:154)
    org.jboss.ws.core.soap.EnvelopeBuilderDOM.build(En velopeBuilderDOM.java:96)
    org.jboss.ws.core.soap.MessageFactoryImpl.createMe ssage(MessageFactoryImpl.java:283)
    org.jboss.ws.core.soap.MessageFactoryImpl.createMe ssage(MessageFactoryImpl.java:193)
    org.springframework.ws.soap.saaj.SaajSoapMessageFa ctory.createWebServiceMessage(SaajSoapMessageFacto ry.java:168)
    org.springframework.ws.transport.AbstractWebServic eConnection.receive(AbstractWebServiceConnection.j ava:86)
    org.springframework.ws.transport.support.WebServic eMessageReceiverObjectSupport.handleConnection(Web ServiceMessageReceiverObjectSupport.java:86)
    org.springframework.ws.transport.http.WebServiceMe ssageReceiverHandlerAdapter.handle(WebServiceMessa geReceiverHandlerAdapter.java:57)
    org.springframework.ws.transport.http.MessageDispa tcherServlet.doService(MessageDispatcherServlet.ja va:230)
    org.springframework.web.servlet.FrameworkServlet.p rocessRequest(FrameworkServlet.java:571)
    org.springframework.web.servlet.FrameworkServlet.d oPost(FrameworkServlet.java:511)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:637)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:717)
    org.jboss.web.tomcat.filters.ReplyHeaderFilter.doF ilter(ReplyHeaderFilter.java:96)
    </pre></p><p><b>causa raíz</b> <pre>java.lang.NullPointerException
    org.jboss.ws.extensions.xop.XOPContext.getAttachme ntByCID(XOPContext.java:380)
    org.jboss.ws.extensions.xop.XOPContext.replaceXOPI nclude(XOPContext.java:330)
    ...</pre>



    First of all I thought the problem is due to the difference between the CID used in the SOAP request:
    cid:6af0843d-fd6b-4c4d-90be-e1ed283cab41%40www.springframework.org
    and the one used in the attachment:
    <[email protected]>
    but, according to some RFC (http://www.ietf.org/rfc/rfc2111.txt) that is ok.

    I've been wandering around in the forum (and some Google) and I haven't found anything like this.
    Moreover, I found that XOPContext class in several places in the JBoss installation:
    server/default/deployers/jbossws.deployer/jbossws-native-core.jar
    server/all/deployers/jbossws.deployer/jbossws-native-core.jar
    server/standard/deployers/jbossws.deployer/jbossws-native-core.jar
    client/jbossws-native-core.jar

    I can also say that I algo got the exception in that XOPContext.getAttachmentByCID in another example I tried before (something I did using the MTOM example as a basis). First, I thought I was doing something wrong but now I don't know what to think of this.

    Any idea?

    Thanks!

    Comment

    Working...
    X