[JBossWS] - MTOM enabled WS using SSB throws OOME
by kazcor
Dear all,
I'm trying to get a webservice up an running that is capable of receiving large documents, so I decided to give MTOM/XOP a try. Although I seem to have done everything necessary, I still get OutOfMemoryExceptions on both, client and server side.
Here is what I've done so far:
The service:
| @WebService
| @BindingType(value = SOAPBinding.SOAP11HTTP_MTOM_BINDING)
| @MTOM(enabled = true)
| @Stateless
| public class SampleService {
|
| public void sendDocument(@XmlMimeType(value = "application/octet-stream") DataHandler document) {
|
| if (document != null) {
| try {
| InputStream in = document.getInputStream();
| File f = File.createTempFile("mtom", ".dat", new File("/tmp"));
| if (f.exists() && f.canWrite()) {
| FileOutputStream fout = new FileOutputStream(f);
| byte[] buffer = new byte[4096];
| int rLines = -1;
| while ((rLines = in.read(buffer)) > 0) {
| fout.write(buffer, 0, rLines);
| }
| fout.close();
| in.close();
| }
| } catch (Exception e) {
| e.printStackTrace();
| }
| }
| }
|
| }
|
Deploys fine. After doing wsconsume on the WSDL I end up with this client:
| public class TestClient {
|
| public static void main(String[] args) {
|
| if (args.length != 1) {
| System.err.println("usage: java -jar TestMTOM-client.jar <fileToSend>");
| return;
| }
|
| File fin = new File(args[0]);
| if (!fin.exists()) {
| System.err.println("No such file: "+args[0]);
| return;
| }
|
| SampleServiceService service = new SampleServiceService();
| SampleService port = service.getSampleServicePort();
| SOAPBinding binding = (SOAPBinding)((BindingProvider)port).getBinding();
| binding.setMTOMEnabled(true);
|
| DataHandler handler = new DataHandler(new FileDataSource(fin));
| port.sendDocument(handler);
| }
| }
|
Logfile and final exception with DEBUG set on org.jboss and org.jboss.management after the client was invoked with a 100MB file (and using -Xmx512m to prevent OOME on client-side):
anonymous wrote :
| 13:05:45,032 DEBUG [DefaultSPIProvider] provide SPI 'class org.jboss.wsf.spi.management.EndpointRegistryFactory'
| 13:05:45,033 DEBUG [DefaultSPIProvider] class org.jboss.wsf.spi.management.EndpointRegistryFactory Implementation: org.jboss.wsf.stack.jbws.EndpointRegistryFactoryImpl@4d4f6e
| 13:05:45,049 DEBUG [RequestHandlerImpl] doPost: /TestMTOM/SampleService
| 13:05:45,050 DEBUG [RequestHandlerImpl] handleRequest: jboss.ws:context=TestMTOM,endpoint=SampleService
| 13:05:45,070 DEBUG [MessageContextAssociation] pushMessageContext: org.jboss.ws.core.jaxws.handler.SOAPMessageContextJAXWS@104f889 (Thread http-127.0.0.1-8080-1)
| 13:05:45,080 DEBUG [RequestHandlerImpl] BEGIN handleRequest: jboss.ws:context=TestMTOM,endpoint=SampleService
| 13:05:45,130 DEBUG [MessageFactoryImpl] createMessage: [contentType=multipart/related;
| start="<rootpart*16c428f3-1021-43de-af64-aecc25b7fe93(a)example.jaxws.sun.com>";
| type="application/xop+xml";
| boundary="uuid:16c428f3-1021-43de-af64-aecc25b7fe93";
| start-info="text/xml"]
| 13:05:45,740 DEBUG [DefaultSPIProvider] provide SPI 'class org.jboss.wsf.spi.management.ServerConfigFactory'
| 13:05:45,748 DEBUG [DefaultSPIProvider] class org.jboss.wsf.spi.management.ServerConfigFactory Implementation: org.jboss.wsf.framework.management.ServerConfigFactoryImpl@8fc809
| 13:05:53,229 DEBUG [SwapableMemoryDataSource] Using swap file, location = file:/usr/home/kazcor/Apps/jboss-4.2.3.GA/server/default/tmp/jbossws/JBossWSattachment52750.dat size = 139810362
| 13:05:58,690 DEBUG [HandlerDelegateJAXWS] callRequestHandlerChain: POST
| 13:05:58,697 DEBUG [HandlerResolverImpl] initHandlerChain: PRE
| 13:05:58,777 DEBUG [HandlerResolverImpl] addHandler:
| HandlerMetaDataJAXWS:
| type=PRE
| name=Recording Handler
| class=class org.jboss.wsf.framework.invocation.RecordingServerHandler
| params=[]
| protocols=##SOAP11_HTTP
| services=null
| ports=null
| 13:05:58,786 DEBUG [HandlerResolverImpl] initHandlerChain: ENDPOINT
| 13:05:58,794 DEBUG [HandlerResolverImpl] initHandlerChain: POST
| 13:05:58,808 DEBUG [HandlerResolverImpl] getHandlerChain: [type=POST,info=[service={http://mtom.test.openlimit.com/}SampleServiceSer...]
| 13:05:58,816 DEBUG [HandlerChainExecutor] Create a handler executor: []
| 13:05:58,826 DEBUG [SOAPMessageDispatcher] getDispatchDestination: {http://mtom.test.openlimit.com/}sendDocument
| 13:05:58,834 DEBUG [SOAP11BindingJAXWS] unbindRequestMessage: {http://mtom.test.openlimit.com/}sendDocument
| 13:05:58,846 DEBUG [EndpointInvocation] setRequestParamValue: [name={http://mtom.test.openlimit.com/}sendDocument,value=org.jboss.ws.cor...]
| 13:05:58,861 DEBUG [HandlerDelegateJAXWS] callRequestHandlerChain: ENDPOINT
| 13:05:58,868 DEBUG [HandlerResolverImpl] getHandlerChain: [type=ENDPOINT,info=[service={http://mtom.test.openlimit.com/}SampleServic...]
| 13:05:58,876 DEBUG [HandlerChainExecutor] Create a handler executor: []
| 13:05:58,883 DEBUG [HandlerDelegateJAXWS] callRequestHandlerChain: PRE
| 13:05:58,890 DEBUG [HandlerResolverImpl] getHandlerChain: [type=PRE,info=[service={http://mtom.test.openlimit.com/}SampleServiceServ...]
| 13:05:58,897 DEBUG [HandlerChainExecutor] Create a handler executor: []
| 13:05:58,907 DEBUG [EndpointInvocation] getRequestPayload
| 13:05:58,914 DEBUG [EndpointInvocation] getRequestParamValue: {http://mtom.test.openlimit.com/}sendDocument
| 13:05:58,922 DEBUG [SOAPContentElement] -----------------------------------
| 13:05:58,929 DEBUG [SOAPContentElement] Transitioning from XML_VALID to OBJECT_VALID
| 13:05:58,936 DEBUG [XMLContent] getObjectValue [xmlType={http://mtom.test.openlimit.com/}sendDocument,javaType=class com.openlimit.test.mtom.jaxws.SendDocument]
| 13:05:58,949 DEBUG [JAXBDeserializer] deserialize: [xmlName={http://mtom.test.openlimit.com/}sendDocument,xmlType={http://mto...]
| 13:06:03,792 DEBUG [HandlerDelegateJAXWS] closeHandlerChain
| 13:06:03,800 DEBUG [HandlerChainExecutor] close
| 13:06:03,807 DEBUG [HandlerDelegateJAXWS] closeHandlerChain
| 13:06:03,814 DEBUG [HandlerChainExecutor] close
| 13:06:03,821 DEBUG [HandlerDelegateJAXWS] closeHandlerChain
| 13:06:03,829 DEBUG [HandlerChainExecutor] close
| 13:06:03,836 DEBUG [RequestHandlerImpl] END handleRequest: jboss.ws:context=TestMTOM,endpoint=SampleService
| 13:06:03,844 DEBUG [MessageContextAssociation] popMessageContext: org.jboss.ws.core.jaxws.handler.SOAPMessageContextJAXWS@104f889 (Thread http-127.0.0.1-8080-1)
| 13:06:04,179 ERROR [[SampleService]] Servlet.service() for servlet SampleService threw exception
| java.lang.OutOfMemoryError: Java heap space
|
Seems to me like it is indeed transferred using XOP and that a swapfile is generated for the incoming request. However, afterwards on deserialization something goes wrong - I hope the former swapped attachment doesn't get deserialized in memory at this point?
Tested with:
JBoss 4.2.3GA (default settings -Xms128m -Xmx512m)
JDK 1.5.0_14-p8
JBossWS (native) 3.1.1GA
Any ideas what I've missed?
Thanks in advance,
Max
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4230012#4230012
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4230012
16 years, 8 months
[JBossWS] - Deployment has no classloader associated exception
by p_repetti
Hello
I applied JBossWS Native 2.0.3 GA over JBoss AS 4.2.2 GA to solve an interaction problem with a remote Axis2 WS.
As a side effect one of my other WSs does not work any more. When one of its operations is invoked it fails with the following exception:
java.lang.IllegalStateException: Deployment has no classloader associated
at org.jboss.wsf.stack.jbws.RequestHandlerImpl.doPost(RequestHandlerImpl.java:183)
at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:124)
at org.jboss.wsf.stack.jbws.EndpointServlet.service(EndpointServlet.java:84)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
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.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
at java.lang.Thread.run(Thread.java:619)
ANy help will be highly valuable.
Thanks
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4229988#4229988
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4229988
16 years, 8 months
[JBossWS] - Re: Tracing wsconsume
by angusm
Peter,
Contents of myconsume.bat:
| @echo off
|
| @if not "%ECHO%" == "" echo %ECHO%
| @if "%OS%" == "Windows_NT" setlocal
|
| set DIRNAME=.\
| if "%OS%" == "Windows_NT" set DIRNAME=%~dp0%
| set PROGNAME=run.bat
| if "%OS%" == "Windows_NT" set PROGNAME=%~nx0%
|
| set JAVA=%JAVA_HOME%\bin\java
| set JBOSS_HOME=C:/jboss/jboss-4.2.2.GA
|
| rem Setup the java endorsed dirs
| set JBOSS_ENDORSED_DIRS=%JBOSS_HOME%\lib\endorsed
|
| rem Shared libs
| set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;C:/Other/eclipseall/ws/hsi/mm7-client2/work
|
| set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JAVA_HOME%/lib/tools.jar
| set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/activation.jar
| set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/getopt.jar
| set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/wstx.jar
| set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jbossall-client.jar
| set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/log4j.jar
| set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/mail.jar
| set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jbossws-spi.jar
| set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jbossws-common.jar
| set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jbossws-framework.jar
|
| rem Shared jaxws libs
| set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jaxws-tools.jar
| set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jaxws-rt.jar
| set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/stax-api.jar
| set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jaxb-api.jar
| set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jaxb-impl.jar
| set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jaxb-xjc.jar
| set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/streambuffer.jar
| set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/stax-ex.jar
|
| rem Stack specific dependencies
| set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/javassist.jar
| set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jboss-xml-binding.jar
| set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jbossws-native-client.jar
| set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jbossws-native-core.jar
| set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jbossws-native-jaxws.jar
| set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jbossws-native-jaxws-ext.jar
| set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jbossws-native-jaxrpc.jar
| set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jbossws-native-saaj.jar
|
| rem Execute the JVM
| "%JAVA%" %JAVA_OPTS% -Djava.endorsed.dirs="%JBOSS_ENDORSED_DIRS%" -Dlog4j.configuration=mylog4j.xml -classpath "%WSCONSUME_CLASSPATH%" org.jboss.wsf.spi.tools.cmd.WSConsume %*
|
Contents of myrun.bat:
| myconsume -k -s ../src -o tmp mm7.wsdl
All relevant files (mylog4j.xml, mm7,wsdl ..) are in the folder anonymous wrote : C:\Other\eclipseall\ws\hsi\mm7-client2\work
That's kind of you,
Angus
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4229963#4229963
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4229963
16 years, 8 months
[JBossWS] - Help! Call Web service error!
by lixun
My developping enviroment is JBoss 5.0.1 GA, jbossws-native-3.0.5
First, I define a web service implementation
then I use wsconsume to generate stub Java Code
If I Call web service with Java Application, that's OK!
But when I put the same code in web application, error happened!
javax.xml.rpc.soap.SOAPFaultException: org.xml.sax.SAXParseException: Premature end of file.
at org.jboss.ws.core.jaxrpc.SOAPFaultHelperJAXRPC.exceptionToFaultMessage(SOAPFaultHelperJAXRPC.java:189)
at org.jboss.ws.core.jaxws.SOAPFaultHelperJAXWS.exceptionToFaultMessage(SOAPFaultHelperJAXWS.java:183)
at org.jboss.ws.core.jaxws.binding.SOAP11BindingJAXWS.createFaultMessageFromException(SOAP11BindingJAXWS.java:102)
at org.jboss.ws.core.CommonSOAPBinding.bindFaultMessage(CommonSOAPBinding.java:671)
at org.jboss.wsf.stack.jbws.RequestHandlerImpl.processRequest(RequestHandlerImpl.java:496)
at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleRequest(RequestHandlerImpl.java:295)
at org.jboss.wsf.stack.jbws.RequestHandlerImpl.doPost(RequestHandlerImpl.java:205)
at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:131)
at org.jboss.wsf.common.servlet.AbstractEndpointServlet.service(AbstractEndpointServlet.java:85)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
Anyone tell me why?
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4229951#4229951
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4229951
16 years, 8 months