Problem sending attachments of size >= 16K using axis

A

AnujA

I have written webservices using axis 1.4 and Java 1.4
When I send attachments of size less then 16K everything works fine.
But If I send an attachment of size more than 16K then I get following
exception on windows(Everything works fine on linux). Please suggest
what could be the issue.

{http://xml.apache.org/axis/}stackTrace:java.io.IOException: The
filename, directory name, or volume label syntax is incorrect
at java.io.WinNTFileSystem.createFileExclusively(Native Method)
at java.io.File.checkAndCreate(File.java:1345)
at java.io.File.createTempFile(File.java:1434)
at
org.apache.axis.attachments.ManagedMemoryDataSource.flushToDisk(ManagedMemoryDataSource.java:
386)
at
org.apache.axis.attachments.ManagedMemoryDataSource.write(ManagedMemoryDataSource.java:
276)
at
org.apache.axis.attachments.ManagedMemoryDataSource.<init>
(ManagedMemoryDataSource.java:149)
at
org.apache.axis.attachments.MultiPartRelatedInputStream.readTillFound(MultiPartRelatedInputStream.java:
557)
at
org.apache.axis.attachments.MultiPartRelatedInputStream.readAll(MultiPartRelatedInputStream.java:
433)
at
org.apache.axis.attachments.MultiPartRelatedInputStream.getAttachments(MultiPartRelatedInputStream.java:
439)
at
org.apache.axis.attachments.AttachmentsImpl.mergeinAttachments(AttachmentsImpl.java:
171)
at
org.apache.axis.attachments.AttachmentsImpl.getAttachmentByReference(AttachmentsImpl.java:
341)
at
org.apache.axis.encoding.DeserializationContext.getObjectByRef(DeserializationContext.java:
617)
at
org.apache.axis.encoding.ser.JAFDataHandlerDeserializer.populateDataHandler(JAFDataHandlerDeserializer.java:
74)
at
org.apache.axis.encoding.ser.JAFDataHandlerDeserializer.startElement(JAFDataHandlerDeserializer.java:
59)
at
org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:
1048)
at
org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:
165)
at
org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:
1141)
at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:
236)
at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
at
org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:
81)
at
org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:
323)
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.handlers.soap.SOAPService.invoke(SOAPService.java:
454)
at org.apache.axis.server.AxisServer.invoke(AxisServer.java:281)
at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:
699)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at
org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:
327)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:
252)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:
173)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:
213)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:
178)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:
126)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:
105)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:
107)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:
148)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:
869)
at org.apache.coyote.http11.Http11BaseProtocol
$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:
664)
at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:
527)
at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:
80)
at org.apache.tomcat.util.threads.ThreadPool
$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)
 
A

Andreas Leitgeb

AnujA said:
I have written webservices using axis 1.4 and Java 1.4
When I send attachments of size less then 16K everything works fine.
But If I send an attachment of size more than 16K then I get following
exception on windows(Everything works fine on linux). Please suggest
what could be the issue.

{http://xml.apache.org/axis/}stackTrace:java.io.IOException: The
filename, directory name, or volume label syntax is incorrect
at java.io.WinNTFileSystem.createFileExclusively(Native Method)

These are all just wild guesses:
1.) smaller attachments may be kept entirely in memory, so they
sneak around the real problem.
2.) Some path-setting may have an illegal value:
e.g. some setting that expects only one path may contain
a list of paths, and resultingly some file like:
"C:\foo;D:\bar\tempfile"
is attempted to be created.
3.) Due to some (configuration-)bug it attempts to use an
URL (http://...) as the place for the tempfile.
 
R

Roland de Ruiter

I have written webservices using axis 1.4 and Java 1.4
When I send attachments of size less then 16K everything works fine.
But If I send an attachment of size more than 16K then I get following
exception on windows(Everything works fine on linux). Please suggest
what could be the issue.

Probably the temporary attachments directory isn't configured correctly.

Try to set the value of "attachments.directory" to a valid directory on
the Windows platform.

<http://ws.apache.org/axis/java/reference.html#GlobalAxisConfiguration>
 
A

AnujA

attachments.dir fixed my problem.
Thanks a lot for the help.- Hide quoted text -

- Show quoted text -

I am also facing another issue relate with name of the attachment.
I am sending my attachment as a parameter of type DataHandler to my
webservice. At the server, If I do attachment.getName(), it returns
me a temporary name like Axis30297.att. Is it possible to get the
exact name of the file using the attachment (without a need to send it
as a sepaarte parameter) ?
 
A

AnujA

attachments.dir fixed my problem.
Thanks a lot for the help.- Hide quoted text -

- Show quoted text -

Another issue that I am facing is related with attachments name. I am
sending the attachment as a parameter of type DataHandler to the web
service.At the server when I do attachment.getName(), it returns me
some temp name like Axis30297.att. Is there any way of directly
getting the name from the attachment object without a need to send the
name as separate parameter?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,021
Latest member
AkilahJaim

Latest Threads

Top