[ 
https://issues.apache.org/jira/browse/AXIS2-5777?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Rajesh updated AXIS2-5777:
--------------------------
    Attachment: AxisClient.zip

Attached Axis2 Client project along with the Jars used

> AxisConfiguration is NULL
> -------------------------
>
>                 Key: AXIS2-5777
>                 URL: https://issues.apache.org/jira/browse/AXIS2-5777
>             Project: Axis2
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 1.7.2
>            Reporter: Rajesh
>         Attachments: AxisClient.zip
>
>
> Hi,
> Am using the axis2 1.7.2
> I have deployed the axis2.war in the tomcat and started the service. The 
> StockQuoteService can be listened via the below url
> http://localhost:8080/axis2/services/StockQuoteService
> I have created a client to request that service (Attached the complete 
> project zip). 
> To trigger multiple requests, I have invoked the client call method in the 
> For loop from main method
> To avoid creating the multiple connections, am caching the http client and 
> reusing it.
> When I run the program with this setup, around 46 requests are executed 
> successfully and returning the response. After that NPE in thrown.
> After investigating about it, found that the JVM is expelling the 
> ServiceClient object
> ==========================================================
> ServiceClient.java
> ==========================================================
>     protected void finalize() throws Throwable {
>         try {
>             cleanup();
>         } finally {
>             super.finalize();
>         }
>     }
>     public void cleanup() throws AxisFault {
>         // if a configuration context was created for this client there'll 
> also
>         //  be a service group, so discard that
>         if (!createConfigCtx) {
>             String serviceGroupName = 
> axisService.getAxisServiceGroup().getServiceGroupName();
>             AxisConfiguration axisConfiguration = 
> configContext.getAxisConfiguration();
>             AxisServiceGroup asg = 
> axisConfiguration.getServiceGroup(serviceGroupName);
>             if ((asg != null) && removeAxisService) {
>                 axisConfiguration.removeServiceGroup(serviceGroupName);
>             }
>         } else {
>             configContext.terminate();
>         }
>     }
> ==========================================================
>     When the finalize method is called, it is invoking the cleaup method 
> which again calls the terminate method of ConfigurationContext. Because of 
> this 
>     AxisConfiguration in the ConfigurationContext is becoming NULL.
>     Once this cleanup is done, the subsequent requests are not able to 
> process due to empty AxisConfiguration returned from ConfigurationContext.
> This whole issue is due to reusing the HttpClient. When the HttpClient is not 
> reused, this error is not thrown.
> But as per our project requirement, we will be getting multiple requests from 
> the end user and we need to reuse the HttpClient.
> Kindly advice at the earliest, as we are facing this issue in the production



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to