[
https://issues.apache.org/jira/browse/AXIS2-3011?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12515513
]
Lin Sun commented on AXIS2-3011:
--------------------------------
I've been running with a similar set of code (with geronimo has its own
Axis2ClientConfigurationFactory) but the code is pretty much the same to reuse
the ConfigurationContext. I am getting the stack trace below during a 10 user
load test of the jaxws-calculator example
(http://svn.apache.org/viewvc/geronimo/samples/trunk/samples/jaxws-calculator/jaxws-calculator-war/)
javax.xml.ws.WebServiceException: The ServiceClient cannot be created.
at org.apache.axis2.jaxws.ExceptionFactory.createWebServiceException(Exc
eptionFactory.java:172)
at org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(Excep
tionFactory.java:69)
at org.apache.axis2.jaxws.description.impl.EndpointDescriptionImpl.getSe
rviceClient(EndpointDescriptionImpl.java:949)
at org.apache.axis2.jaxws.description.impl.EndpointDescriptionImpl.<init
>(EndpointDescriptionImpl.java:222)
at org.apache.axis2.jaxws.description.impl.EndpointDescriptionImpl.<init
>(EndpointDescriptionImpl.java:180)
at org.apache.axis2.jaxws.description.impl.ServiceDescriptionImpl.update
EndpointDescription(ServiceDescriptionImpl.java:289)
at org.apache.axis2.jaxws.description.impl.DescriptionFactoryImpl.update
Endpoint(DescriptionFactoryImpl.java:220)
at org.apache.axis2.jaxws.description.DescriptionFactory.updateEndpoint(
DescriptionFactory.java:96)
at org.apache.axis2.jaxws.spi.ServiceDelegate.getPort(ServiceDelegate.ja
va:233)
at org.apache.axis2.jaxws.spi.ServiceDelegate.getPort(ServiceDelegate.ja
va:209)
at javax.xml.ws.Service.getPort(Service.java:44)
at org.apache.geronimo.jaxws.client.GenericService$$EnhancerByCGLIB$$37c
731e2_2.CGLIB$getPort$1(<generated>)
at org.apache.geronimo.jaxws.client.GenericService$$EnhancerByCGLIB$$37c
731e2_2$$FastClassByCGLIB$$1c5fd0ac.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:167)
at org.apache.geronimo.jaxws.client.PortMethodInterceptor.intercept(Port
MethodInterceptor.java:50)
at org.apache.geronimo.axis2.client.Axis2PortMethodInterceptor.intercept
(Axis2PortMethodInterceptor.java:42)
at org.apache.geronimo.jaxws.client.GenericService$$EnhancerByCGLIB$$37c
731e2_2.getPort(<generated>)
at org.apache.jsp.addResult_jsp._jspService(addResult_jsp.java:91)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper
.java:388)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:3
20)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:175)
at org.apache.geronimo.tomcat.valve.DefaultSubjectValve.invoke(DefaultSu
bjectValve.java:56)
at org.apache.geronimo.tomcat.GeronimoStandardContext$SystemMethodValve.
invoke(GeronimoStandardContext.java:351)
at org.apache.geronimo.tomcat.valve.GeronimoBeforeAfterValve.invoke(Gero
nimoBeforeAfterValve.java:47)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:104)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:109)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:
563)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
a:261)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
ss(Http11Protocol.java:581)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:44
7)
at java.lang.Thread.run(Thread.java:801)
Caused by: org.apache.axis2.AxisFault: Two services cannot have same name. A se
rvice with the Calculator.CalculatorPort1579572774 name already exists in the sy
stem.
at org.apache.axis2.client.ServiceClient.configureServiceClient(ServiceC
lient.java:172)
at org.apache.axis2.client.ServiceClient.<init>(ServiceClient.java:139)
at org.apache.axis2.jaxws.description.impl.EndpointDescriptionImpl.getSe
rviceClient(EndpointDescriptionImpl.java:946)
... 37 more
> ServiceDescription caching leads to memory leak
> -----------------------------------------------
>
> Key: AXIS2-3011
> URL: https://issues.apache.org/jira/browse/AXIS2-3011
> Project: Axis 2.0 (Axis2)
> Issue Type: Bug
> Components: jaxws
> Reporter: Jarek Gawor
> Attachments: AXIS2-3011.patch
>
>
> The DescriptionFactoryImpl.createServiceDescription() function attempts to
> cache/reuse the ServiceDescription objects and that leads to memory leaks.
> First, a Hashtable is used for the cache. That means, any ServiceDescription
> created will always live in the cache and won't ever be reclaimed (and there
> is no clear cache function). Some sort of WeakHashMap could help the problem
> so that at least some unused ServiceDescription objects could be reclaimed.
> Second, the createServiceDescription() uses the
> DescriptionFactory.createClientConfigurationFactory().getClientConfigurationContext()
> to get the client configuration context. It looks like by default the
> ClientConfigurationFactory.getClientConfigurationContext() does NOT cache the
> configuration context. Therefore, each call creates a new configuration
> object. That means, that by default ServiceDescription will NOT be reused
> since the configuration context object instance is used to determine if the
> ServiceDescription should be reused or not (see DescriptionKey.equals()
> function).
> So, a simple program that calls createServiceDescription() repeatably in a
> loop (with the same arguments) will quickly run out of memory.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]