wood burning stoves 2.0*
The moose likes Web Services and the fly likes Stream already closed Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Stream already closed" Watch "Stream already closed" New topic
Author

Stream already closed

christophe seguinot
Greenhorn

Joined: Oct 19, 2007
Posts: 18
Hello,

I'm trying to develop an MTOM webservice on weblogic 10.3.

Server side :


Client side :


On the server side I have the following exception:
Nov 5, 2010 8:37:18 AM com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit handle


On the client side I have the following exception :


I'm confused because this is a very simple web service.
The client is generated using clientgen of weblogic.

Any help would be appreciated.

Regards,

Christophe
Jim Akmer
Ranch Hand

Joined: Jul 06, 2010
Posts: 104
I have seen similar error before. It happens when in your code you are accessing a reference of an object returned by the web service framework and while your code manipulates the object the framework closes the stream. It is solved by copying the object data and not using a reference.
In the code you posted I think the problem is in the

try doing a copy of the bytes and then instantiate a string with the local instance and then return the string.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Stream already closed
 
Similar Threads
problem to send file
Unable to return a two dimensional object array.
UnsupportedMediaException -> logging response
Exception while running JAX-WS client
java.security.PrivilegedActionException: oracle.j2ee.ws.saaj.ContentTypeException: Not a valid SOAP