2 Replies Latest reply on Mar 27, 2007 6:57 PM by Janos Biro

    BUG: MTOM with JBossWS 1.2.0SP1 server and Axis2 client

    Janos Biro Newbie

      Hi,

      I have a possible bug report:

      JBoss AS 4.0.5
      JBossWS 1.2.0 SP1
      EJB3
      Axis2 client with MTOM enabled

      I exposed an EJB3 exactly as it is described in JBossWS Guide as WS (with MTOM enabled)

      Endpoint:

      @Remote
      @WebService(targetNamespace = "http://org.jboss.ws/xop/doclit")
      @SOAPBinding(style = SOAPBinding.Style.DOCUMENT, parameterStyle = SOAPBinding.ParameterStyle.BARE)
      @BindingType(value="http://schemas.xmlsoap.org/wsdl/soap/http?mtom=true")
      public interface ETI_Receiver {
      
       public void downloadRelationships(DataHandler attachedFile);
      
      }
      


      Bean
      @Stateless
      @WebService(endpointInterface="ETI_Receiver")
      public class ETI_ReceiverBean implements ETI_Receiver{
      
      
       public void downloadRelationships(DataHandler attachedFile) {
      
       }
      
      
      }
      



      Client code (with Axis2 stub generated from the WSDL published during deployment of EJB3 by JBossWS)

      
       ETI_ReceiverBeanServiceStub emstub = new ETI_ReceiverBeanServiceStub();
       Options options = new Options();
      
       options.setProperty(Constants.Configuration.ENABLE_MTOM, Constants.VALUE_TRUE);
       //options.setProperty(Constants.Configuration.CACHE_ATTACHMENTS, Constants.VALUE_TRUE);
       //options.setProperty(Constants.Configuration.ATTACHMENT_TEMP_DIR, new File("c:\\"));
       //options.setProperty(Constants.Configuration.FILE_SIZE_THRESHOLD,100000);
       //options.setProperty(Constants.Configuration.ENABLE_SWA, Constants.VALUE_TRUE);
       options.setTo(new EndpointReference(uri));
       emstub._getServiceClient().setOptions(options);
      
       ws.jboss.org.xop.doclit.DownloadRelationships drs = new ws.jboss.org.xop.doclit.DownloadRelationships();
      
       DataSource ds;
      
       ds = new FileDataSource("d:\\x.zip");
       DataHandler dataHandler = new DataHandler(ds);
      
       drs.setDownloadRelationships(dataHandler);
      
       try {
       emstub.downloadRelationships(drs);
      
       } catch (RemoteException e) {
       // TODO Auto-generated catch block
       e.printStackTrace();
       }
      
      


      Without enabling MTOM at Axis2 side everything is perfect, the attachment is sent, but after enabling MTOM (see the code above)
      JbossWS drops an exception with message "multipart/related stream invalid, no root part was found"

      2007-03-27 22:45:13,281 INFO [org.jboss.system.server.Server] JBoss (MX MicroKernel) [4.0.5.GA (build: CVSTag=Branch_4_0 date=200610162339)] Started in 45s:938ms
      2007-03-27 22:47:35,796 DEBUG [org.jboss.ws.core.server.AbstractServiceEndpointServlet] doPost: /ETI_Framework/ETI_ReceiverBean
      2007-03-27 22:47:35,796 DEBUG [org.jboss.ws.core.soap.MessageContextAssociation] pushMessageContext: org.jboss.ws.core.jaxws.handler.SOAPMessageContextJAXWS@6076f4 (Thread http-0.0.0.0-8080-1)
      2007-03-27 22:47:35,812 DEBUG [org.jboss.ws.core.server.ServiceEndpoint] BEGIN handleRequest: jboss.ws:context=ETI_Framework,endpoint=ETI_ReceiverBean
      2007-03-27 22:47:35,843 DEBUG [org.jboss.ws.core.soap.MessageFactoryImpl] createMessage: [contentType=multipart/related;
       boundary=MIMEBoundaryurn_uuid_38281D50CC3CDBE79011750284556091;
       type="application/xop+xml";
       start="<0.urn:uuid:38281D50CC3CDBE79011750284556092@apache.org>";
       start-info="text/xml"; charset=UTF-8]
      2007-03-27 22:47:35,859 DEBUG [org.jboss.ws.metadata.umdm.EndpointMetaData] Configure SOAPBinding
      2007-03-27 22:47:35,859 ERROR [org.jboss.ws.core.jaxws.SOAPFaultHelperJAXWS] SOAP request exception
      java.lang.IllegalArgumentException: multipart/related stream invalid, no root part was found
       at org.jboss.ws.core.soap.attachment.MultipartRelatedDecoder.decodeMultipartRelatedMessage(MultipartRelatedDecoder.java:156)
       at org.jboss.ws.core.soap.MessageFactoryImpl.createMessage(MessageFactoryImpl.java:211)
       at org.jboss.ws.core.soap.MessageFactoryImpl.createMessage(MessageFactoryImpl.java:171)
       at org.jboss.ws.core.server.ServiceEndpoint.handleRequest(ServiceEndpoint.java:185)
       at org.jboss.ws.core.server.ServiceEndpointManager.processSOAPRequest(ServiceEndpointManager.java:440)
       at org.jboss.ws.core.server.AbstractServiceEndpointServlet.doPost(AbstractServiceEndpointServlet.java:114)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
       at org.jboss.ws.core.server.AbstractServiceEndpointServlet.service(AbstractServiceEndpointServlet.java:75)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
       at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
       at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
       at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
       at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
       at java.lang.Thread.run(Thread.java:595)
      2007-03-27 22:47:35,859 DEBUG [javax.xml.soap.FactoryLoader] Load from Service API META-INF/services/javax.xml.soap.MessageFactory: org.jboss.ws.core.soap.MessageFactoryImpl
      2007-03-27 22:47:35,906 DEBUG [org.jboss.ws.core.jaxws.SOAPFaultHelperJAXWS] Cannot obtain fault meta data for: class java.lang.IllegalArgumentException
      2007-03-27 22:47:35,921 DEBUG [org.jboss.ws.core.server.ServiceEndpoint] END handleRequest: jboss.ws:context=ETI_Framework,endpoint=ETI_ReceiverBean
      2007-03-27 22:47:35,937 DEBUG [org.jboss.ws.core.soap.MessageContextAssociation] popMessageContext: org.jboss.ws.core.jaxws.handler.SOAPMessageContextJAXWS@6076f4 (Thread http-0.0.0.0-8080-1)
      
      


      Note: The Axis2 client works perfectly also with MTOM enabled if you use an Axis2 endpoint and not the JbossWS exposed EJB3.

      Is it already a known issue or should I report a bug?

      Bye,
      Janos


        • 1. Re: BUG: MTOM with JBossWS 1.2.0SP1 server and Axis2 client
          Janos Biro Newbie

          I tried with SoapUI client,
          In this case JBossWS does not drop an exception, but the transmitted file has filesize 0 if I enable MTOM enabled in SoapUI request

          • 2. Re: BUG: MTOM with JBossWS 1.2.0SP1 server and Axis2 client
            Janos Biro Newbie

            Using SoapUI as client I collected the following trace at JBossWS side:

             2007-03-28 00:17:59,296 DEBUG [org.jboss.ws.core.server.ServiceEndpoint] BEGIN handleRequest: jboss.ws:context=ETI-ETI_Framework,endpoint=ETI_ReceiverBean
            2007-03-28 00:17:59,296 DEBUG [org.jboss.ws.core.soap.MessageFactoryImpl] createMessage: [contentType=multipart/related; type="application/xop+xml";
             start="<rootpart@soapui.org>"; startinfo="text/xml; action=\"\"";
             boundary="----=_Part_16_1798874.1175033879281"]
            2007-03-28 00:17:59,312 DEBUG [org.jboss.ws.core.soap.attachment.SwapableMemoryDataSource] Using memory buffer, size = 707
            2007-03-28 00:17:59,312 DEBUG [org.jboss.ws.core.soap.attachment.SwapableMemoryDataSource] Using memory buffer, size = 81
            2007-03-28 00:17:59,312 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerDelegateJAXWS] callRequestHandlerChain: PRE
            2007-03-28 00:17:59,312 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerResolverImpl] initHandlerChain: PRE
            2007-03-28 00:17:59,312 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerResolverImpl] Clear handler map: {}
            2007-03-28 00:17:59,312 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerResolverImpl] initHandlerChain: ENDPOINT
            2007-03-28 00:17:59,312 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerResolverImpl] Clear handler map: {}
            2007-03-28 00:17:59,312 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerResolverImpl] initHandlerChain: POST
            2007-03-28 00:17:59,312 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerResolverImpl] Clear handler map: {}
            2007-03-28 00:17:59,312 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerResolverImpl] getHandlerChain: [type=PRE,info=[service={http://siemens.com/ws}ETI_ReceiverBeanService,port={http://siemens.com/ws}EMServicesPort,binding=http://schemas.xmlsoap.org/wsdl/soap/http?mtom=true]]
            2007-03-28 00:17:59,312 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerChainExecutor] Create a handler executor: []
            2007-03-28 00:17:59,312 DEBUG [org.jboss.ws.core.soap.SOAPMessageDispatcher] getDispatchDestination: {http://siemens.com/ws}downloadRelationships
            2007-03-28 00:17:59,312 DEBUG [org.jboss.ws.core.jaxws.binding.SOAP11BindingJAXWS] unbindRequestMessage: {http://siemens.com/ws}downloadRelationships
            2007-03-28 00:17:59,312 DEBUG [org.jboss.ws.core.EndpointInvocation] setRequestParamValue: [name={http://siemens.com/ws/types}downloadRelationships,value=org.jboss.ws.core.soap.SOAPBodyElementDoc]
            2007-03-28 00:17:59,312 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerDelegateJAXWS] callRequestHandlerChain: ENDPOINT
            2007-03-28 00:17:59,312 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerResolverImpl] initHandlerChain: PRE
            2007-03-28 00:17:59,312 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerResolverImpl] Clear handler map: {}
            2007-03-28 00:17:59,312 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerResolverImpl] initHandlerChain: ENDPOINT
            2007-03-28 00:17:59,312 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerResolverImpl] Clear handler map: {}
            2007-03-28 00:17:59,312 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerResolverImpl] initHandlerChain: POST
            2007-03-28 00:17:59,312 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerResolverImpl] Clear handler map: {}
            2007-03-28 00:17:59,312 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerResolverImpl] getHandlerChain: [type=ENDPOINT,info=[service={http://siemens.com/ws}ETI_ReceiverBeanService,port={http://siemens.com/ws}EMServicesPort,binding=http://schemas.xmlsoap.org/wsdl/soap/http?mtom=true]]
            2007-03-28 00:17:59,312 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerChainExecutor] Create a handler executor: []
            2007-03-28 00:17:59,312 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerDelegateJAXWS] callRequestHandlerChain: POST
            2007-03-28 00:17:59,312 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerResolverImpl] initHandlerChain: PRE
            2007-03-28 00:17:59,312 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerResolverImpl] Clear handler map: {}
            2007-03-28 00:17:59,312 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerResolverImpl] initHandlerChain: ENDPOINT
            2007-03-28 00:17:59,312 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerResolverImpl] Clear handler map: {}
            2007-03-28 00:17:59,312 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerResolverImpl] initHandlerChain: POST
            2007-03-28 00:17:59,312 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerResolverImpl] Clear handler map: {}
            2007-03-28 00:17:59,312 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerResolverImpl] getHandlerChain: [type=POST,info=[service={http://siemens.com/ws}ETI_ReceiverBeanService,port={http://siemens.com/ws}EMServicesPort,binding=http://schemas.xmlsoap.org/wsdl/soap/http?mtom=true]]
            2007-03-28 00:17:59,312 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerChainExecutor] Create a handler executor: []
            2007-03-28 00:17:59,312 DEBUG [org.jboss.ws.integration.jboss42.ServiceEndpointInvokerEJB3] invokeServiceEndpoint: downloadRelationships
            2007-03-28 00:17:59,312 DEBUG [org.jboss.ws.core.EndpointInvocation] getRequestPayload
            2007-03-28 00:17:59,312 DEBUG [org.jboss.ws.core.EndpointInvocation] getRequestParamValue: {http://siemens.com/ws/types}downloadRelationships
            2007-03-28 00:17:59,312 DEBUG [org.jboss.ws.core.soap.SOAPContentElement] -----------------------------------
            2007-03-28 00:17:59,312 DEBUG [org.jboss.ws.core.soap.SOAPContentElement] Transitioning from XML_VALID to OBJECT_VALID
            2007-03-28 00:17:59,312 DEBUG [org.jboss.ws.core.soap.XMLContent] getObjectValue [xmlType={http://siemens.com/ws}downloadRelationships,javaType=class com.siemens.icm.nm.rc.eti.framework.common.generated.wsdl.DownloadRelationshipsType]
            2007-03-28 00:17:59,312 DEBUG [org.jboss.ws.core.jaxws.JAXBDeserializer] deserialize: [xmlName={http://siemens.com/ws/types}downloadRelationships,xmlType={http://siemens.com/ws}downloadRelationships]
            2007-03-28 00:17:59,312 DEBUG [org.jboss.ws.core.jaxws.JAXBDeserializer] deserialized: com.siemens.icm.nm.rc.eti.framework.common.generated.wsdl.DownloadRelationshipsType
            2007-03-28 00:17:59,312 DEBUG [org.jboss.ws.core.soap.XMLContent] objectValue: com.siemens.icm.nm.rc.eti.framework.common.generated.wsdl.DownloadRelationshipsType
            2007-03-28 00:17:59,312 DEBUG [org.jboss.ws.core.soap.SOAPContentElement] -----------------------------------
            2007-03-28 00:17:59,312 DEBUG [org.jboss.ws.core.EndpointInvocation] transformPayloadValue: org.jboss.ws.core.soap.SOAPBodyElementDoc -> com.siemens.icm.nm.rc.eti.framework.common.generated.wsdl.DownloadRelationshipsType
            2007-03-28 00:17:59,312 DEBUG [org.jboss.ws.core.jaxrpc.ParameterWrapping] unwrapRequestParameters: com.siemens.icm.nm.rc.eti.framework.common.generated.wsdl.DownloadRelationshipsType
            2007-03-28 00:17:59,312 INFO [STDOUT] 0
            2007-03-28 00:17:59,312 DEBUG [org.jboss.ws.core.EndpointInvocation] setReturnValue: null
            


            Additonal information:
            - I tried to send a file with size 81 bytes.
            - The [STDOUT] 0 means the filesize of the received attachment (0).
            - It can be seen that I set the binding type properly
            getHandlerChain: [type=POST,info=[service={http://siemens.com/ws}ETI_ReceiverBeanService,port={http://siemens.com/ws}EMServicesPort,binding=http://schemas.xmlsoap.org/wsdl/soap/http?mtom=true]]



            Do you have any idea what is the problem?