You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by "Schwarz, Karl" <Ka...@ngc.com> on 2005/04/28 20:34:52 UTC

Resource has been deleted Exception while Processing Attachments

This problem has been reported before but I don't see any resolution. I am having a similar issue.

I have a service that accepts or sends a org.apache.axis.attachments.OctetStream.  Here are the method signatures from the stub:

public void addImage(com.examples.ImageService.types.ImageInfo imageInfo, 
        org.apache.axis.attachments.OctetStream image, 
        javax.xml.rpc.holders.StringHolder status, 
        javax.xml.rpc.holders.LongHolder id) 

public void getImage(com.examples.ImageService.types.ImageInfo imageInfo, 
         javax.xml.rpc.holders.StringHolder status, 
         org.apache.axis.holders.OctetStreamHolder image)

I have a test client that is looping and invoking the addImage and getImage operations. After several loops I get the following exception:

java.io.IOException: Resource has been deleted.
at org.apache.axis.attachments.ManagedMemoryDataSource$Instream.<init>(ManagedMemoryDataSource.java:517)
at org.apache.axis.attachments.ManagedMemoryDataSource.getInputStream(ManagedMemoryDataSource.java:182)
at javax.activation.DataHandler.writeTo(DataHandler.java:287)
at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1206)
at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:707)
at javax.mail.internet.MimeMultipart.writeTo(MimeMultipart.java:256)
at com.sun.mail.handlers.multipart_mixed.writeTo(multipart_mixed.java:67)
at javax.activation.ObjectDataContentHandler.writeTo(DataHandler.java:839)
at javax.activation.DataHandler.writeTo(DataHandler.java:295)
at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1206)
at javax.mail.internet.MimeMessage.writeTo(MimeMessage.java:1611)
at org.apache.axis.attachments.MimeUtils.writeToMultiPartStream(MimeUtils.java:202)
at org.apache.axis.attachments.AttachmentsImpl.writeContentToStream(AttachmentsImpl.java:461)
at org.apache.axis.Message.writeTo(Message.java:525)
at org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:504)
at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:135)
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
at org.apache.axis.client.Call.invokeEngine(Call.java:2754)
at org.apache.axis.client.Call.invoke(Call.java:2737)
at org.apache.axis.client.Call.invoke(Call.java:2413)
at org.apache.axis.client.Call.invoke(Call.java:2336)
at org.apache.axis.client.Call.invoke(Call.java:1793)
at com.examples.ImageService.ImageryServiceBindingStub.getImage(ImageryServiceBindingStub.java:231)
at com.examples.ImageService.ImageryServicePortTypeProxy.getImage(ImageryServicePortTypeProxy.java:51)
at com.examples.ImageService.TestImageService.main(TestImageService.java:87)

If I remove the getImage invocation from the test client it runs without error. If I remove the addImage invocation I get the same error, again after just a few loops.

Any thoughts?

regards,
Karl