You are viewing a plain text version of this content. The canonical link for it is here.
Posted to rampart-dev@ws.apache.org by "Grégoire Rolland (JIRA)" <ji...@apache.org> on 2007/08/24 11:36:30 UTC

[jira] Created: (RAMPART-77) OutOfMemoryError with MTOM attachment

OutOfMemoryError with MTOM attachment
-------------------------------------

                 Key: RAMPART-77
                 URL: https://issues.apache.org/jira/browse/RAMPART-77
             Project: Rampart
          Issue Type: Bug
    Affects Versions: 1.2, 1.3
         Environment: Windows XP Pro SP2, sun jsdk 1.5_10, Apache Tomcat/5.5, Axis2 1.2/1.3, Rampart 1.2/1.3
            Reporter: Grégoire Rolland
            Priority: Critical


Hi,

I have a file download Service, this is the code :

public abstract class Updater implements IUpdater {
	private static final String FILE_ELEMENT_NAME = "file";

	private static final String OM_NAMESPACE_NAME = "update";

	private static final String OM_NAMESPACE = "http://updater.webservices.hussoninfo.fr";

	private String directory;

	private String fileName;

	public void setFileName(final String in_fileName) {
		fileName = in_fileName;
	}

	protected abstract String getRootPath();

	private String getUpdatePath() {
		return getRootPath() + File.separator + directory;
	}

	public OMElement getFile(final OMElement in_e)
	{
		OMFactory factory = OMAbstractFactory.getOMFactory();
		OMNamespace ns = factory.createOMNamespace(OM_NAMESPACE, OM_NAMESPACE_NAME);
		OMElement fileElement = OMAbstractFactory.getOMFactory().createOMElement(FILE_ELEMENT_NAME, ns);
            DataHandler dataHandler = new DataHandler(new FileDataSource(getUpdatePath() + File.separator + fileName));
            OMText textData = factory.createOMText(dataHandler, true);
            fileElement.addChild(textData);
		return fileElement;
	}
}

This is the service.xml (see service DatabaseUptader)

<serviceGroup>
	
	<service name="InitService" class="fr.hussoninfo.webservices.lifecycle.InitService">
	    <description>Service d'initialisation</description>
	    <parameter name="ServiceClass">fr.hussoninfo.webservices.lifecycle.InitService</parameter>
	    <parameter name="ServiceTCCL">composite</parameter>
	    <parameter name="load-on-startup">true</parameter>
  	</service>
	
	<service name="DatabaseUpdater">
		<description>Service de mise a jour de base de donnees</description>
		<messageReceivers>
			<messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only" class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver" />
			<messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out" class="org.apache.axis2.rpc.receivers.RPCMessageReceiver" />
		</messageReceivers>
		<parameter name="ServiceClass" locked="false">fr.hussoninfo.webservices.updater.IUpdater</parameter>
		<parameter name="ServiceObjectSupplier">org.apache.axis2.extensions.spring.receivers.SpringAppContextAwareObjectSupplier</parameter>
    		<parameter name="SpringBeanName">databaseUpdater</parameter>
    		<parameter name="enableMTOM" locked="false">true</parameter>
    	
		<module ref="rampart" /> 

		<operation name="getFile">
        		<messageReceiver class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
        		<actionMapping>urn:getFile</actionMapping>
    		</operation>

		<wsp:Policy wsu:Id="UTOverTransport"
			xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
			xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">

			<wsp:ExactlyOne>
				<wsp:All>
					<sp:TransportBinding
						xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
						<wsp:Policy>
							<sp:TransportToken>
								<wsp:Policy>
									<sp:HttpsToken
										RequireClientCertificate="false" />
								</wsp:Policy>
							</sp:TransportToken>
							<sp:AlgorithmSuite>
								<wsp:Policy>
									<sp:Basic256 />
								</wsp:Policy>
							</sp:AlgorithmSuite>
							<sp:Layout>
								<wsp:Policy>
									<sp:Lax />
								</wsp:Policy>
							</sp:Layout>
						</wsp:Policy>
					</sp:TransportBinding>
					<sp:SignedSupportingTokens
						xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
						<wsp:Policy>
							<sp:UsernameToken
								sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient" />
						</wsp:Policy>
					</sp:SignedSupportingTokens>

					<ramp:RampartConfig xmlns:ramp="http://ws.apache.org/rampart/policy">
						<ramp:passwordCallbackClass>fr.hussoninfo.webservices.security.PasswordCallback</ramp:passwordCallbackClass>
					</ramp:RampartConfig>
					
				</wsp:All>
			</wsp:ExactlyOne>
		</wsp:Policy>
	</service>
</serviceGroup>


And here the client : 


public abstract class AbstractUpdaterClient {

	private static final String URN_GET_FILE = "urn:getFile";
	private static final String METHOD_GET_FILE = "getFile";
	private static final String WEBSERVICES_NAMESPACE = "http://updater.webservices.hussoninfo.fr";
	private static final String RAMPART_MODULE_NAME = "rampart";

	private String domaine = null;

	private ConfigurationContext cc = null;

	private Policy policy = null;

	public AbstractUpdaterClient(final ConfigurationContext in_cc, final Policy in_policy, final String in_domaine)
	{
		domaine = in_domaine;
		cc = in_cc;
		policy = in_policy;
	}

	protected abstract String getUpdateService();
	
	private String getEPRString()
	{
		return "http://" + domaine + "/TCXUpdater/services/" + getUpdateService();
	}

	public void retrieveFile(final String in_outputFile) throws IOException
	{
	   ServiceClient serviceClient2 = new ServiceClient(cc, null);
		
        EndpointReference targetEPR2 = new EndpointReference(getEPRString());

        OMFactory fac = OMAbstractFactory.getOMFactory();
        OMNamespace omNs = fac.createOMNamespace(WEBSERVICES_NAMESPACE, METHOD_GET_FILE);
        
        OMElement method = fac.createOMElement(METHOD_GET_FILE, omNs);

        serviceClient2.engageModule(RAMPART_MODULE_NAME);
        
        Options options2 = serviceClient2.getOptions();
        options2.setTo(targetEPR2);
        options2.setAction(URN_GET_FILE);
        options2.setProperty(RampartMessageData.KEY_RAMPART_POLICY,  policy);
        options2.setProperty(Constants.Configuration.ENABLE_MTOM, Constants.VALUE_TRUE);

        MessageContext messageContext = new MessageContext();
        messageContext.setServiceContext(serviceClient2.getServiceContext());
        SOAPFactory soapFactory = OMAbstractFactory.getSOAP12Factory();
        SOAPEnvelope envelope = soapFactory.getDefaultEnvelope();
        envelope.getBody().addChild(method);
        serviceClient2.addHeadersToEnvelope(envelope);
        messageContext.setEnvelope(envelope);
        OperationClient operationClient = serviceClient2.createClient(ServiceClient.ANON_OUT_IN_OP);
        operationClient.addMessageContext(messageContext);
        operationClient.execute(true);
        MessageContext responseMc = operationClient
                .getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE);

        DataHandler attachement = responseMc.getAttachment(
        		responseMc.getAttachmentMap().getAllContentIDs()[1]);
        
        InputStream is = new BufferedInputStream(attachement.getDataSource().getInputStream());
        OutputStream os = new BufferedOutputStream(new FileOutputStream(in_outputFile));
        
        IOUtils.copy(is, os);
        
        os.close();
        is.close();
        
        os = null;
        is = null;
	}
}

MTOM caching is enabled on client side (axis2.xml fragment):

<parameter name="cacheAttachments" locked="false">true</parameter> <parameter name="attachmentDIR" locked="false">c:/tcx/cache</parameter>
<parameter name="sizeThreshold" locked="false">1024</parameter>

Policy for client side :

<wsp:Policy wsu:Id="UTOverTransport"
	xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
	xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
	<wsp:ExactlyOne>
		<wsp:All>
			<sp:TransportBinding
				xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
				<wsp:Policy>
					<sp:TransportToken>
						<wsp:Policy>
							<sp:HttpsToken
								RequireClientCertificate="false" />
						</wsp:Policy>
					</sp:TransportToken>
					<sp:AlgorithmSuite>
						<wsp:Policy>
							<sp:Basic256 />
						</wsp:Policy>
					</sp:AlgorithmSuite>
					<sp:Layout>
						<wsp:Policy>
							<sp:Lax />
						</wsp:Policy>
					</sp:Layout>
				</wsp:Policy>
			</sp:TransportBinding>
			<sp:SignedSupportingTokens
				xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
				<wsp:Policy>
					<sp:UsernameToken
						sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient" />
				</wsp:Policy>
			</sp:SignedSupportingTokens>
		</wsp:All>
	</wsp:ExactlyOne>
</wsp:Policy>

And the method to get the Policy :

StAXOMBuilder builder = new StAXOMBuilder(CONF_POLICY_XML); policy =  PolicyEngine.getPolicy(builder.getDocumentElement());
        
RampartConfig rc = new RampartConfig();
rc.setUser("user");
rc.setPwCbClass(PasswordCallback.class.getName());
policy.addAssertion(rc);


And now the problem :

It works with file not larger than 10mb, without tuning JVM memory.
When I disengage Rampart module (both client and server), all works fine with larger file !! But when Rampart is engaged I get an OutOfMemoryError on the client side for file larger than 10mb.

For a file of 74MB, I have to set client JVM Memory to 728MB !!! 

I upgrade Axis and Rampart to version 1.3, there is the same behavior.

Here is the stack trace for more precision :

Thread [main] (Suspended (exception OutOfMemoryError))	
	String.<init>(char[], int, int) line: not available	
	StringBuffer.toString() line: not available	
	TextHelper.toString(InputStream) line: 36	
	TextImpl.getText() line: 316	
	DOMStAXWrapper.getText() line: 356	
	StAXSOAPModelBuilder(StAXBuilder).createOMText(OMContainer, int) line: 245	
	StAXSOAPModelBuilder(StAXBuilder).createOMText(int) line: 216	
	StAXSOAPModelBuilder(StAXOMBuilder).next() line: 179	
	SOAPEnvelopeImpl(OMNodeImpl).build() line: 318	
	SOAPEnvelopeImpl(OMElementImpl).build() line: 614	
	Axis2Util.getSOAPEnvelopeFromDOMDocument(Document, boolean) line: 200	
	RampartEngine.process(MessageContext) line: 174	
	RampartReceiver.invoke(MessageContext) line: 85	
	Phase.invoke(MessageContext) line: 292	
	AxisEngine.invoke(MessageContext, boolean) line: 212	
	AxisEngine.receive(MessageContext) line: 132	
	OutInAxisOperationClient.handleResponse(MessageContext) line: 336	
	OutInAxisOperationClient.send(MessageContext) line: 389	
	OutInAxisOperationClient.executeImpl(boolean) line: 211	
	OutInAxisOperationClient(OperationClient).execute(boolean) line: 163	
	DatabaseUpdaterClient(AbstractUpdaterClient).retrieveFile(String) line: 221	
	DataBaseUpdater.update(boolean) line: 42	
	TCXUpdater.main(String[]) line: 116	

Grégoire Rolland

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


[jira] Commented: (RAMPART-77) OutOfMemoryError with MTOM attachment

Posted by "Aaron Evans (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/RAMPART-77?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12698781#action_12698781 ] 

Aaron Evans commented on RAMPART-77:
------------------------------------

I just ran into this issue using axis 1.3.   I'm assuming this isn't fixed in 1.4 since this issue was not closed.

Basically I have an axis2 client that downloads a binary file as an attachment from an axis2 service.

I'm using the enableMTOM feature on the service and the UsernameToken feature of WSSecurity (implemented with rampart).

On the client, I'm using rampart for WSSecurity and the file caching features:

options.setProperty(Constants.Configuration.CACHE_ATTACHMENTS,Constants.VALUE_TRUE);
options.setProperty(Constants.Configuration.ATTACHMENT_TEMP_DIR,tmpDir);
options.setProperty(Constants.Configuration.FILE_SIZE_THRESHOLD, "4000");

Once the entire file is downloaded to the temp file, then I get an out of memory exception in the client.

I have another "simple" version of this service that doesn't use rampart and the client doesn't suffer from this problem.

All code is generated from WSDL using ADB.

Here's a sample stack trace:

Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
	at java.lang.String.<init>(String.java:208)
	at java.lang.StringBuffer.toString(StringBuffer.java:586)
	at org.apache.axiom.om.util.TextHelper.toString(TextHelper.java:36)
	at org.apache.axiom.om.impl.dom.TextImpl.getText(TextImpl.java:316)
	at org.apache.axiom.om.impl.dom.DOMStAXWrapper.getText(DOMStAXWrapper.java:356)
	at org.apache.axiom.om.impl.builder.StAXBuilder.createOMText(StAXBuilder.java:245)
	at org.apache.axiom.om.impl.builder.StAXBuilder.createOMText(StAXBuilder.java:216)
	at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:179)
	at org.apache.axiom.om.impl.llom.OMNodeImpl.build(OMNodeImpl.java:318)
	at org.apache.axiom.om.impl.llom.OMElementImpl.build(OMElementImpl.java:614)
	at org.apache.rampart.util.Axis2Util.getSOAPEnvelopeFromDOMDocument(Axis2Util.java:200)
	at org.apache.rampart.RampartEngine.process(RampartEngine.java:72)
	at org.apache.rampart.handler.RampartReceiver.invoke(RampartReceiver.java:85)
	at org.apache.axis2.engine.Phase.invoke(Phase.java:292)
	at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:212)
	at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:132)
	at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:336)
	at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:389)
	at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:211)
	at org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
	...

> OutOfMemoryError with MTOM attachment
> -------------------------------------
>
>                 Key: RAMPART-77
>                 URL: https://issues.apache.org/jira/browse/RAMPART-77
>             Project: Rampart
>          Issue Type: Bug
>    Affects Versions: 1.2, 1.3
>         Environment: Windows XP Pro SP2, sun jsdk 1.5_10, Apache Tomcat/5.5, Axis2 1.2/1.3, Rampart 1.2/1.3
>            Reporter: Grégoire Rolland
>            Priority: Critical
>
> Hi,
> I have a file download Service, this is the code :
> public abstract class Updater implements IUpdater {
> 	private static final String FILE_ELEMENT_NAME = "file";
> 	private static final String OM_NAMESPACE_NAME = "update";
> 	private static final String OM_NAMESPACE = "http://updater.webservices.hussoninfo.fr";
> 	private String directory;
> 	private String fileName;
> 	public void setFileName(final String in_fileName) {
> 		fileName = in_fileName;
> 	}
> 	protected abstract String getRootPath();
> 	private String getUpdatePath() {
> 		return getRootPath() + File.separator + directory;
> 	}
> 	public OMElement getFile(final OMElement in_e)
> 	{
> 		OMFactory factory = OMAbstractFactory.getOMFactory();
> 		OMNamespace ns = factory.createOMNamespace(OM_NAMESPACE, OM_NAMESPACE_NAME);
> 		OMElement fileElement = OMAbstractFactory.getOMFactory().createOMElement(FILE_ELEMENT_NAME, ns);
>             DataHandler dataHandler = new DataHandler(new FileDataSource(getUpdatePath() + File.separator + fileName));
>             OMText textData = factory.createOMText(dataHandler, true);
>             fileElement.addChild(textData);
> 		return fileElement;
> 	}
> }
> This is the service.xml (see service DatabaseUptader)
> <serviceGroup>
> 	
> 	<service name="InitService" class="fr.hussoninfo.webservices.lifecycle.InitService">
> 	    <description>Service d'initialisation</description>
> 	    <parameter name="ServiceClass">fr.hussoninfo.webservices.lifecycle.InitService</parameter>
> 	    <parameter name="ServiceTCCL">composite</parameter>
> 	    <parameter name="load-on-startup">true</parameter>
>   	</service>
> 	
> 	<service name="DatabaseUpdater">
> 		<description>Service de mise a jour de base de donnees</description>
> 		<messageReceivers>
> 			<messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only" class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver" />
> 			<messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out" class="org.apache.axis2.rpc.receivers.RPCMessageReceiver" />
> 		</messageReceivers>
> 		<parameter name="ServiceClass" locked="false">fr.hussoninfo.webservices.updater.IUpdater</parameter>
> 		<parameter name="ServiceObjectSupplier">org.apache.axis2.extensions.spring.receivers.SpringAppContextAwareObjectSupplier</parameter>
>     		<parameter name="SpringBeanName">databaseUpdater</parameter>
>     		<parameter name="enableMTOM" locked="false">true</parameter>
>     	
> 		<module ref="rampart" /> 
> 		<operation name="getFile">
>         		<messageReceiver class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
>         		<actionMapping>urn:getFile</actionMapping>
>     		</operation>
> 		<wsp:Policy wsu:Id="UTOverTransport"
> 			xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
> 			xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
> 			<wsp:ExactlyOne>
> 				<wsp:All>
> 					<sp:TransportBinding
> 						xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
> 						<wsp:Policy>
> 							<sp:TransportToken>
> 								<wsp:Policy>
> 									<sp:HttpsToken
> 										RequireClientCertificate="false" />
> 								</wsp:Policy>
> 							</sp:TransportToken>
> 							<sp:AlgorithmSuite>
> 								<wsp:Policy>
> 									<sp:Basic256 />
> 								</wsp:Policy>
> 							</sp:AlgorithmSuite>
> 							<sp:Layout>
> 								<wsp:Policy>
> 									<sp:Lax />
> 								</wsp:Policy>
> 							</sp:Layout>
> 						</wsp:Policy>
> 					</sp:TransportBinding>
> 					<sp:SignedSupportingTokens
> 						xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
> 						<wsp:Policy>
> 							<sp:UsernameToken
> 								sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient" />
> 						</wsp:Policy>
> 					</sp:SignedSupportingTokens>
> 					<ramp:RampartConfig xmlns:ramp="http://ws.apache.org/rampart/policy">
> 						<ramp:passwordCallbackClass>fr.hussoninfo.webservices.security.PasswordCallback</ramp:passwordCallbackClass>
> 					</ramp:RampartConfig>
> 					
> 				</wsp:All>
> 			</wsp:ExactlyOne>
> 		</wsp:Policy>
> 	</service>
> </serviceGroup>
> And here the client : 
> public abstract class AbstractUpdaterClient {
> 	private static final String URN_GET_FILE = "urn:getFile";
> 	private static final String METHOD_GET_FILE = "getFile";
> 	private static final String WEBSERVICES_NAMESPACE = "http://updater.webservices.hussoninfo.fr";
> 	private static final String RAMPART_MODULE_NAME = "rampart";
> 	private String domaine = null;
> 	private ConfigurationContext cc = null;
> 	private Policy policy = null;
> 	public AbstractUpdaterClient(final ConfigurationContext in_cc, final Policy in_policy, final String in_domaine)
> 	{
> 		domaine = in_domaine;
> 		cc = in_cc;
> 		policy = in_policy;
> 	}
> 	protected abstract String getUpdateService();
> 	
> 	private String getEPRString()
> 	{
> 		return "http://" + domaine + "/TCXUpdater/services/" + getUpdateService();
> 	}
> 	public void retrieveFile(final String in_outputFile) throws IOException
> 	{
> 	   ServiceClient serviceClient2 = new ServiceClient(cc, null);
> 		
>         EndpointReference targetEPR2 = new EndpointReference(getEPRString());
>         OMFactory fac = OMAbstractFactory.getOMFactory();
>         OMNamespace omNs = fac.createOMNamespace(WEBSERVICES_NAMESPACE, METHOD_GET_FILE);
>         
>         OMElement method = fac.createOMElement(METHOD_GET_FILE, omNs);
>         serviceClient2.engageModule(RAMPART_MODULE_NAME);
>         
>         Options options2 = serviceClient2.getOptions();
>         options2.setTo(targetEPR2);
>         options2.setAction(URN_GET_FILE);
>         options2.setProperty(RampartMessageData.KEY_RAMPART_POLICY,  policy);
>         options2.setProperty(Constants.Configuration.ENABLE_MTOM, Constants.VALUE_TRUE);
>         MessageContext messageContext = new MessageContext();
>         messageContext.setServiceContext(serviceClient2.getServiceContext());
>         SOAPFactory soapFactory = OMAbstractFactory.getSOAP12Factory();
>         SOAPEnvelope envelope = soapFactory.getDefaultEnvelope();
>         envelope.getBody().addChild(method);
>         serviceClient2.addHeadersToEnvelope(envelope);
>         messageContext.setEnvelope(envelope);
>         OperationClient operationClient = serviceClient2.createClient(ServiceClient.ANON_OUT_IN_OP);
>         operationClient.addMessageContext(messageContext);
>         operationClient.execute(true);
>         MessageContext responseMc = operationClient
>                 .getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
>         DataHandler attachement = responseMc.getAttachment(
>         		responseMc.getAttachmentMap().getAllContentIDs()[1]);
>         
>         InputStream is = new BufferedInputStream(attachement.getDataSource().getInputStream());
>         OutputStream os = new BufferedOutputStream(new FileOutputStream(in_outputFile));
>         
>         IOUtils.copy(is, os);
>         
>         os.close();
>         is.close();
>         
>         os = null;
>         is = null;
> 	}
> }
> MTOM caching is enabled on client side (axis2.xml fragment):
> <parameter name="cacheAttachments" locked="false">true</parameter> <parameter name="attachmentDIR" locked="false">c:/tcx/cache</parameter>
> <parameter name="sizeThreshold" locked="false">1024</parameter>
> Policy for client side :
> <wsp:Policy wsu:Id="UTOverTransport"
> 	xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
> 	xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
> 	<wsp:ExactlyOne>
> 		<wsp:All>
> 			<sp:TransportBinding
> 				xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
> 				<wsp:Policy>
> 					<sp:TransportToken>
> 						<wsp:Policy>
> 							<sp:HttpsToken
> 								RequireClientCertificate="false" />
> 						</wsp:Policy>
> 					</sp:TransportToken>
> 					<sp:AlgorithmSuite>
> 						<wsp:Policy>
> 							<sp:Basic256 />
> 						</wsp:Policy>
> 					</sp:AlgorithmSuite>
> 					<sp:Layout>
> 						<wsp:Policy>
> 							<sp:Lax />
> 						</wsp:Policy>
> 					</sp:Layout>
> 				</wsp:Policy>
> 			</sp:TransportBinding>
> 			<sp:SignedSupportingTokens
> 				xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
> 				<wsp:Policy>
> 					<sp:UsernameToken
> 						sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient" />
> 				</wsp:Policy>
> 			</sp:SignedSupportingTokens>
> 		</wsp:All>
> 	</wsp:ExactlyOne>
> </wsp:Policy>
> And the method to get the Policy :
> StAXOMBuilder builder = new StAXOMBuilder(CONF_POLICY_XML); policy =  PolicyEngine.getPolicy(builder.getDocumentElement());
>         
> RampartConfig rc = new RampartConfig();
> rc.setUser("user");
> rc.setPwCbClass(PasswordCallback.class.getName());
> policy.addAssertion(rc);
> And now the problem :
> It works with file not larger than 10mb, without tuning JVM memory.
> When I disengage Rampart module (both client and server), all works fine with larger file !! But when Rampart is engaged I get an OutOfMemoryError on the client side for file larger than 10mb.
> For a file of 74MB, I have to set client JVM Memory to 728MB !!! 
> I upgrade Axis and Rampart to version 1.3, there is the same behavior.
> Here is the stack trace for more precision :
> Thread [main] (Suspended (exception OutOfMemoryError))	
> 	String.<init>(char[], int, int) line: not available	
> 	StringBuffer.toString() line: not available	
> 	TextHelper.toString(InputStream) line: 36	
> 	TextImpl.getText() line: 316	
> 	DOMStAXWrapper.getText() line: 356	
> 	StAXSOAPModelBuilder(StAXBuilder).createOMText(OMContainer, int) line: 245	
> 	StAXSOAPModelBuilder(StAXBuilder).createOMText(int) line: 216	
> 	StAXSOAPModelBuilder(StAXOMBuilder).next() line: 179	
> 	SOAPEnvelopeImpl(OMNodeImpl).build() line: 318	
> 	SOAPEnvelopeImpl(OMElementImpl).build() line: 614	
> 	Axis2Util.getSOAPEnvelopeFromDOMDocument(Document, boolean) line: 200	
> 	RampartEngine.process(MessageContext) line: 174	
> 	RampartReceiver.invoke(MessageContext) line: 85	
> 	Phase.invoke(MessageContext) line: 292	
> 	AxisEngine.invoke(MessageContext, boolean) line: 212	
> 	AxisEngine.receive(MessageContext) line: 132	
> 	OutInAxisOperationClient.handleResponse(MessageContext) line: 336	
> 	OutInAxisOperationClient.send(MessageContext) line: 389	
> 	OutInAxisOperationClient.executeImpl(boolean) line: 211	
> 	OutInAxisOperationClient(OperationClient).execute(boolean) line: 163	
> 	DatabaseUpdaterClient(AbstractUpdaterClient).retrieveFile(String) line: 221	
> 	DataBaseUpdater.update(boolean) line: 42	
> 	TCXUpdater.main(String[]) line: 116	
> Grégoire Rolland

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