You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Bharathi Renduchintala (JIRA)" <ax...@ws.apache.org> on 2009/05/12 20:15:45 UTC

[jira] Commented: (AXIS-2778) Out of Memory - SOAPEnvelope.toString - Client part

    [ https://issues.apache.org/jira/browse/AXIS-2778?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12708543#action_12708543 ] 

Bharathi Renduchintala commented on AXIS-2778:
----------------------------------------------

I am running into the same issue. Did you find a solution to this issue?

Thanks,
Bharathi

> Out of Memory - SOAPEnvelope.toString - Client part
> ---------------------------------------------------
>
>                 Key: AXIS-2778
>                 URL: https://issues.apache.org/jira/browse/AXIS-2778
>             Project: Axis
>          Issue Type: Bug
>         Environment: Host: sun4u sparc SUNW,Sun-Fire-V890
> Java version: "1.5.0_13" build b05
> Axis:
> Manifest-Version: 1.0
> Ant-Version: Apache Ant 1.6.5
> Created-By: 1.4.2_08-b03 (Sun Microsystems Inc.)
> Name: org/apache/axis
> Implementation-Title: Apache Axis
> Implementation-Version: 1.4 1855 April 22 2006
> Implementation-Vendor: Apache Web Services
>            Reporter: LE BRIS Damien
>            Priority: Critical
>
> Hi,
> I have an out of memory problem when I try to transform a SOAPEnvelope to String. It's a 200MB File.
> The memory is define to: -Xmx3300M -Xms3300M
> JVM:
> java version "1.5.0_13"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_13-b05)
> Java HotSpot(TM) Server VM (build 1.5.0_13-b05, mixed mode)
> Import (axis):
> import org.apache.axis.client.Call;
> import org.apache.axis.client.Service;
> import org.apache.axis.message.SOAPEnvelope;
> My code:
> 	// Appel du service
> 	Service service = new Service();
> 	Call call = (Call) service.createCall();	
> 			
> 	//FE138
> 	call.setProperty( Call.SOAPACTION_USE_PROPERTY, new Boolean( true ) );
> 	call.setProperty( Call.SOAPACTION_URI_PROPERTY, soapAction);
> 			
> 	call.setTargetEndpointAddress(new java.net.URL(endpoint));
> 	call.setOperationName("WS-RefTerm-TerminalListService");
> 	// on récupère le fichier xml request passé en argument
> 	FileInputStream fluxXml = new FileInputStream(args[1]);
> 	SOAPEnvelope req = new SOAPEnvelope(fluxXml);
> 	// invocation du webservice
> 	SOAPEnvelope ret = call.invoke(req);
> 	/** **** ecriture de la reponse dans le fichier de sortie ***** */
> 	/* recuperation du chemin du repertoire de sortie */
> 	// construction du nom du fichier de sortie
> 	String repDest = System.getenv("REFTERM_REP_DEST");
> 	File fichierDest = buildOutPutFileName(repDest, "terminalListResponse");
> 	/* creation et ecriture de la reponse */
> 	BufferedWriter reponse = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(fichierDest)));
> 	reponse.write("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");
> 	reponse.write(ret.toString());
> Out of Memory when:
> reponse.write(ret.toString());
> StackTrace:
> Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
>         at java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:99)
>         at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:393)
>         at java.lang.StringBuffer.append(StringBuffer.java:225)
>         at java.io.StringWriter.write(StringWriter.java:79)
>         at org.apache.axis.encoding.SerializationContext.endElement(SerializationContext.java:1225)
>         at org.apache.axis.message.SAXOutputter.endElement(SAXOutputter.java:114)
>         at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:171)
>         at org.apache.axis.message.MessageElement.output(MessageElement.java:1168)
>         at org.apache.axis.message.SOAPBody.outputImpl(SOAPBody.java:139)
>         at org.apache.axis.message.SOAPEnvelope.outputImpl(SOAPEnvelope.java:478)
>         at org.apache.axis.message.MessageElement.output(MessageElement.java:1208)
>         at org.apache.axis.message.MessageElement.getAsString(MessageElement.java:1111)
>         at org.apache.axis.message.MessageElement.toString(MessageElement.java:1272)
>         at com.bouygtel.newcom.referentiel.terminaux.AcquisitionRefTerminaux.main(AcquisitionRefTerminaux.java:102)
> If you have an information about this problem, I take it.
> Thanks.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.