4 Replies Latest reply on Oct 17, 2009 4:33 PM by Richard Opalka

    XOM fails in production but works in dev

    Waldo Nell Newbie

      I really need urgent help please. I have implemented a web service using XOM to transfer large files from the client to the web service. In dev this works fine, however in production I see no errors in the log file, yet the inputstream yields 0 bytes when reading the file.

      I am using jbossws-3.0.1-native-2.0.4.GA (build=200803312044) on JBoss 4.2.3 GA. Here are the log files:


      2009-10-17 00:12:44,525 DEBUG [org.jboss.wsf.stack.jbws.RequestHandlerImpl] doPost: /LicensingWSBeanService/WSServerLargeFileTransferBean
      2009-10-17 00:12:44,525 DEBUG [org.jboss.wsf.stack.jbws.RequestHandlerImpl] handleRequest: jboss.ws:context=LicensingWSBeanService,endpoint=WSServerLargeFileTransferBean
      2009-10-17 00:12:44,525 DEBUG [org.jboss.ws.core.soap.MessageContextAssociation] pushMessageContext: org.jboss.ws.core.jaxws.handler.SOAPMessageContextJAXWS@4964f4eb (Thread http-0.0.0.0-8080-1)
      2009-10-17 00:12:44,525 DEBUG [org.jboss.wsf.stack.jbws.RequestHandlerImpl] BEGIN handleRequest: jboss.ws:context=LicensingWSBeanService,endpoint=WSServerLargeFileTransferBean
      2009-10-17 00:12:44,525 DEBUG [org.jboss.ws.core.soap.MessageFactoryImpl] createMessage: [contentType=multipart/related; type="application/xop+xml";
      boundary="uuid:604b4c1b-9578-4a57-897e-fa68d07da32e";
      start-info="text/xml"]
      2009-10-17 00:12:44,541 DEBUG [org.jboss.ws.core.soap.attachment.SwapableMemoryDataSource] Using memory buffer, size = 325
      2009-10-17 00:12:44,556 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] setRepository, repository=org.jboss.mx.loading.HeirarchicalLoaderRepository3@2f57d162, cl=org.jboss.mx.loading.HeirarchicalLoaderRepository3$CacheClassLoader@7b04eff0{ url=null ,addedOrder=0}
      2009-10-17 00:12:44,583 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerDelegateJAXWS] callRequestHandlerChain: POST
      2009-10-17 00:12:44,584 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerResolverImpl] initHandlerChain: PRE
      2009-10-17 00:12:44,584 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerResolverImpl] addHandler:
      HandlerMetaDataJAXWS:
      type=PRE
      name=Recording Handler
      class=class org.jboss.wsf.framework.invocation.RecordingServerHandler
      params=[]
      protocols=##SOAP11_HTTP
      services=null
      ports=null
      2009-10-17 00:12:44,584 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerResolverImpl] initHandlerChain: ENDPOINT
      2009-10-17 00:12:44,584 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerResolverImpl] initHandlerChain: POST
      2009-10-17 00:12:44,584 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerResolverImpl] getHandlerChain: [type=POST,info=[service={http://webservice.licensing.sarad.co.za/}WSServerLargeFileTransferBeanService,port={http://webservice.licensing.sarad.co.za/}WSServerLargeFileTransferBeanPort,binding=http://schemas.xmlsoap.org/wsdl/soap/http?mtom=true]]
      2009-10-17 00:12:44,584 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerChainExecutor] Create a handler executor: []
      2009-10-17 00:12:44,584 DEBUG [org.jboss.ws.core.soap.SOAPMessageDispatcher] getDispatchDestination: {http://webservice.licensing.sarad.co.za/}uploadApplicationUpdates
      2009-10-17 00:12:44,584 DEBUG [org.jboss.ws.core.jaxws.binding.SOAP11BindingJAXWS] unbindRequestMessage: {http://webservice.licensing.sarad.co.za/}uploadApplicationUpdates
      2009-10-17 00:12:44,584 DEBUG [org.jboss.ws.core.EndpointInvocation] setRequestParamValue: [name={http://webservice.licensing.sarad.co.za/}uploadApplicationUpdates,value=org.jboss.ws.core.soap.SOAPBodyElementDoc]
      2009-10-17 00:12:44,584 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerDelegateJAXWS] callRequestHandlerChain: ENDPOINT
      2009-10-17 00:12:44,584 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerResolverImpl] getHandlerChain: [type=ENDPOINT,info=[service={http://webservice.licensing.sarad.co.za/}WSServerLargeFileTransferBeanService,port={http://webservice.licensing.sarad.co.za/}WSServerLargeFileTransferBeanPort,binding=http://schemas.xmlsoap.org/wsdl/soap/http?mtom=true]]
      2009-10-17 00:12:44,584 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerChainExecutor] Create a handler executor: []
      2009-10-17 00:12:44,584 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerDelegateJAXWS] callRequestHandlerChain: PRE
      2009-10-17 00:12:44,584 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerResolverImpl] getHandlerChain: [type=PRE,info=[service={http://webservice.licensing.sarad.co.za/}WSServerLargeFileTransferBeanService,port={http://webservice.licensing.sarad.co.za/}WSServerLargeFileTransferBeanPort,binding=http://schemas.xmlsoap.org/wsdl/soap/http?mtom=true]]
      2009-10-17 00:12:44,585 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerChainExecutor] Create a handler executor: []
      2009-10-17 00:12:44,585 DEBUG [org.jboss.ws.core.EndpointInvocation] getRequestPayload
      2009-10-17 00:12:44,585 DEBUG [org.jboss.ws.core.EndpointInvocation] getRequestParamValue: {http://webservice.licensing.sarad.co.za/}uploadApplicationUpdates
      2009-10-17 00:12:44,585 DEBUG [org.jboss.ws.core.soap.SOAPContentElement] -----------------------------------
      2009-10-17 00:12:44,585 DEBUG [org.jboss.ws.core.soap.SOAPContentElement] Transitioning from XML_VALID to OBJECT_VALID
      2009-10-17 00:12:44,585 DEBUG [org.jboss.ws.core.soap.XMLContent] getObjectValue [xmlType={http://webservice.licensing.sarad.co.za/}uploadApplicationUpdates,javaType=class za.co.sarad.licensing.webservice.jaxws.UploadApplicationUpdates]
      2009-10-17 00:12:44,587 DEBUG [org.jboss.ws.core.jaxws.JAXBDeserializer] deserialize: [xmlName={http://webservice.licensing.sarad.co.za/}uploadApplicationUpdates,xmlType={http://webservice.licensing.sarad.co.za/}uploadApplicationUpdates]
      2009-10-17 00:12:44,588 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] setRepository, repository=org.jboss.mx.loading.HeirarchicalLoaderRepository3@2f57d162, cl=org.jboss.mx.loading.HeirarchicalLoaderRepository3$CacheClassLoader@3b4768cc{ url=null ,addedOrder=0}
      2009-10-17 00:12:44,589 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] setRepository, repository=org.jboss.mx.loading.HeirarchicalLoaderRepository3@2f57d162, cl=org.jboss.mx.loading.HeirarchicalLoaderRepository3$CacheClassLoader@4d31477b{ url=null ,addedOrder=0}
      2009-10-17 00:12:44,617 DEBUG [org.jboss.ws.core.jaxws.JAXBDeserializer] deserialized: za.co.sarad.licensing.webservice.jaxws.UploadApplicationUpdates
      2009-10-17 00:12:44,617 DEBUG [org.jboss.ws.core.soap.XMLContent] objectValue: za.co.sarad.licensing.webservice.jaxws.UploadApplicationUpdates
      2009-10-17 00:12:44,617 DEBUG [org.jboss.ws.core.soap.SOAPContentElement] -----------------------------------
      2009-10-17 00:12:44,617 DEBUG [org.jboss.ws.core.EndpointInvocation] transformPayloadValue: org.jboss.ws.core.soap.SOAPBodyElementDoc -> za.co.sarad.licensing.webservice.jaxws.UploadApplicationUpdates
      2009-10-17 00:12:44,619 DEBUG [org.jboss.ws.core.jaxrpc.ParameterWrapping] unwrapRequestParameters: za.co.sarad.licensing.webservice.jaxws.UploadApplicationUpdates
      2009-10-17 00:12:44,619 DEBUG [org.jboss.wsf.framework.DefaultSPIProvider] provide SPI 'class org.jboss.wsf.spi.invocation.WebServiceContextFactory'
      2009-10-17 00:12:44,620 DEBUG [org.jboss.wsf.framework.DefaultSPIProvider] class org.jboss.wsf.spi.invocation.WebServiceContextFactory Implementation: org.jboss.wsf.container.jboss42.WebServiceContextFactoryImpl@315a5aff
      2009-10-17 00:12:44,624 INFO [STDOUT] ..........1
      2009-10-17 00:12:44,624 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] setRepository, repository=org.jboss.mx.loading.HeirarchicalLoaderRepository3@2f57d162, cl=org.jboss.mx.loading.HeirarchicalLoaderRepository3$CacheClassLoader@5c4e0c39{ url=null ,addedOrder=0}
      2009-10-17 00:12:44,625 INFO [STDOUT] ..........2
      2009-10-17 00:12:44,625 INFO [STDOUT] .........3
      2009-10-17 00:12:44,625 INFO [STDOUT] tmpfile = /tmp/ws_dump1540207851695323714dump
      2009-10-17 00:12:54,627 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] setRepository, repository=org.jboss.mx.loading.HeirarchicalLoaderRepository3@2f57d162, cl=org.jboss.mx.loading.HeirarchicalLoaderRepository3$CacheClassLoader@6808aa2d{ url=null ,addedOrder=0}
      2009-10-17 00:12:54,628 INFO [STDOUT] vInputStream.available() = >0<


      Here is the WS code:

      @WebService
      @BindingType(value = SOAPBinding.SOAP11HTTP_MTOM_BINDING)
      @MTOM(enabled = true)
      @Stateless
      @WebContext(contextRoot = "/LicensingWSBeanService")
      public class WSServerLargeFileTransferBean {
      
       @WebMethod
       public boolean uploadApplicationUpdates(String pKey, int pClientBuildNumber, @XmlMimeType("application/octet-stream") DataHandler pDataHandler) {
       try {
       Security.validate(pKey);
      
       System.out.println("..........1");
      
       Object vDataContent = pDataHandler.getContent();
       if (!(vDataContent instanceof InputStream))
       throw new RuntimeFailureException("DataHandler is not an InputStream!");
      
       System.out.println("..........2");
      
       InputStream vInputStream = (InputStream)vDataContent;
       BufferedInputStream vBIS = new BufferedInputStream(vInputStream);
      
       System.out.println(".........3");
      
       File vTmpFile = File.createTempFile("ws_dump", "dump");
      
       System.out.println("tmpfile = "+vTmpFile.getCanonicalPath());
       try {
       byte[] vBuf = new byte[10240];
       int vLen;
       FileOutputStream vFOS = new FileOutputStream(vTmpFile);
      
       try {
       System.out.println("vInputStream.available() = >" + vInputStream.available() + "<");
       while ((vLen = vBIS.read(vBuf, 0, vBuf.length)) != -1) {
       System.out.println("vLen = >" + vLen + "<");
       vFOS.write(vBuf, 0, vLen);
       }
      ...
      


      and the client code:

       boolean vRes = vWSServerLargeFileTransfer.uploadApplicationUpdates(Security.generateKey(), vClientBuildNumber, new DataHandler(vTestFile, "application/octet-stream"));
      


      Any ideas?