Hi,
I'm developing a web service (Platform: Linux-Jetty-Axis 1.1) on a
rather limited server (in terms of disk size). It's a possibility that
attachments sent to the server will fill up the disk. When I tested this
with a large attachment file, I got the stack trace below on the client
side. My problem is that I don't know how to catch this exception server
side (as it seems to be handled internally by Axis). I need to catch the
exception on the server side to be able to cleanup the attachment
directory (Axis does not remove the attachment file that fills up the
disk, after the java.io.IOException: No space left on device exception).
Is there any way I can catch this exception server side and deal with
the attachment? Shouldn't this file be deleted after such an exception
by Axis (the file is corrupt, so it definitely should be removed)?
Clientside stack trace:
faultCode:
{http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: java.io.IOException: No space left on device
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace: java.io.IOException: No
space left on device
at java.io.FileOutputStream.writeBytes(Native Method)
at java.io.FileOutputStream.write(Unknown Source)
at java.io.BufferedOutputStream.write(Unknown Source)
at
org.apache.axis.attachments.ManagedMemoryDataSource.write(ManagedMemoryD
ataSource.java:342)
at
org.apache.axis.attachments.ManagedMemoryDataSource.<init>(Managed
MemoryDataSource.java:177)
at
org.apache.axis.attachments.MultiPartRelatedInputStream.readTillFound(Mu
ltiPartRelatedInputStream.java:603)
at
org.apache.axis.attachments.MultiPartRelatedInputStream.readAll(MultiPar
tRelatedInputStream.java:472)
at
org.apache.axis.attachments.MultiPartRelatedInputStream.getAttachments(M
ultiPartRelatedInputStream.java:485)
at
org.apache.axis.attachments.AttachmentsImpl.mergeinAttachments(Attachmen
tsImpl.java:190)
at
org.apache.axis.attachments.AttachmentsImpl.getAttachmentByReference(Att
achmentsImpl.java:349)
at
org.apache.axis.encoding.DeserializationContextImpl.getObjectByRef(Deser
ializationContextImpl.java:555)
at
org.apache.axis.encoding.ser.JAFDataHandlerDeserializer.startElement(JAF
DataHandlerDeserializer.java:109)
at
org.apache.axis.encoding.DeserializationContextImpl.startElement(Deseria
lizationContextImpl.java:976)
at
org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:
198)
at
org.apache.axis.message.MessageElement.publishToHandler(MessageElement.j
ava:722)
at
org.apache.axis.message.RPCElement.deserialize(RPCElement.java:233)
at
org.apache.axis.message.RPCElement.getParams(RPCElement.java:347)
at
org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.ja
va:184)
at
org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:333
)
at
org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.j
ava:71)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:150)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:120)
at
org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:481)
at org.apache.axis.server.AxisServer.invoke(AxisServer.java:323)
at
org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:854)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at
org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.j
ava:339)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:360)
at
org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationH
andler.java:280)
at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:558)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1717)
at
org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationCon
text.java:549)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1667)
at org.mortbay.http.HttpServer.service(HttpServer.java:863)
at
org.mortbay.http.HttpConnection.service(HttpConnection.java:773)
at
org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:937)
at
org.mortbay.http.HttpConnection.handle(HttpConnection.java:790)
at
org.mortbay.http.SocketListener.handleConnection(SocketListener.java:201
)
at
org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:289)
at
org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:455)