Exception while adding attachment using SOAP

Sujay March 8, 2012

Hello,

I am getting excpetion while adding attachment using SOAP. I am trying to attach a ".docx" file of size 222KB.

File file = new File("My file.docx");
byte[] fileContaints = getBytesFromFile(file);
jiraSoapService.addAttachmentsToIssue(token, issueKey, new String[] { file.getName() }, new byte[][] { fileContaints });

Attachement option is ON in JIRA & attachment size is set to 10MB. I am able to upload a normal text file, but when I am trying to upload a file ".docx" file it is giving below exception,

2012-03-09 11:52:26,008 ERROR : JiraMigration:main(376) => Exception while Jira Migration Startup..

javax.xml.rpc.soap.SOAPFaultException: java.lang.OutOfMemoryError: Java heap space; nested exception is: java.lang.OutOfMemoryError: Java heap space

at oracle.j2ee.ws.client.StreamingSender._raiseFault(StreamingSender.java:572)

at oracle.j2ee.ws.client.StreamingSender._sendImpl(StreamingSender.java:414)

at oracle.j2ee.ws.client.StreamingSender._send(StreamingSender.java:121)

at com.cassiopae.jira.proxy.runtime.JirasoapserviceV2SoapBinding_Stub.addAttachmentsToIssue(JirasoapserviceV2SoapBinding_Stub.java:5843)

There is excption at the JIRA server log also. I am attaching the JIRA server log. It says,

(jira exception.txt) java.lang.OutOfMemoryError: GC overhead limit exceeded

I want to attach files upto 10MB. It is working properly when I am uploading attachment using JIRA application.

1 answer

1 accepted

0 votes
Answer accepted
JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 8, 2012

I think this is a know problem with the version of axis in old jira versions - see https://jira.atlassian.com/browse/JRA-11693 and the linked issues.

Sujay March 8, 2012

Got it. I used addBase64EncodedAttachmentsToIssue() method. It worked. Thanks

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events