axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fabrice Airault <faira...@centile.com>
Subject [AXIS2 1.1.1] OutOfMemoryError: Java heap space when engaging addressing on Stub
Date Wed, 09 Apr 2008 07:50:01 GMT

hello,

I have a bug with my client (stub) when i use 
stub._getServiceClient().engageModule(new QName("addressing"));
After 2650 request i have "Exception in thread "main" 
java.lang.OutOfMemoryError: Java heap space"

If i don't use engageModule(new QName("addressing")); there is no problem.

You can find my code (stub is created with wsld2java and
  Exception.

I don't find workaround on Jira. Can you help me to solve my problem.


thanks,

- Fabrice



package com.centile.test;
import org.apache.axis2.context.ConfigurationContext;
import org.apache.axis2.context.ConfigurationContextFactory;
import org.apache.axis2.transport.http.HTTPConstants;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager;

import javax.xml.namespace.QName;

import com.centile.ws.ent.EnterpriseStub;

public class Main{

	
	public static void main(String[] args) throws Exception {
		
		EnterpriseStub stub =
             new 
EnterpriseStub("http://nounours:8078/axis2/services/Enterprise?wsdl");
			stub._getServiceClient().engageModule(new QName("addressing"));
			stub._getServiceClient().getOptions().setManageSession(true);
		 
stub._getServiceClient().getOptions().setProperty(HTTPConstants.REUSE_HTTP_CLIENT, 
Boolean.TRUE);
		 	ConfigurationContext configurationContext = 
ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, 
null);
		 	HttpClient httpClient = new HttpClient(new 
MultiThreadedHttpConnectionManager());
		 	configurationContext.setProperty(HTTPConstants.REUSE_HTTP_CLIENT, 
Boolean.TRUE);
		 	configurationContext.setProperty(HTTPConstants.CACHED_HTTP_CLIENT, 
httpClient);	
		 	
		int i=0;
		while(true){
			System.out.println(i++);
			System.out.println(stub.isConnected().get_return());
		}
	}
}

false
2653
false
2654
false
2655
false
2656
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
fabrice@nounours:~/Project/eclipseworkspace/isaudit/bin$



Mime
View raw message