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 "David Steindorfer (Jira)" <ji...@apache.org> on 2022/05/30 16:33:00 UTC

[jira] [Comment Edited] (AXIS2-6030) Axis2 connections are not returned to connection pool on 1.8.0 with JAXWS

    [ https://issues.apache.org/jira/browse/AXIS2-6030?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17543997#comment-17543997 ] 

David Steindorfer edited comment on AXIS2-6030 at 5/30/22 4:32 PM:
-------------------------------------------------------------------

Hi [~robertlazarski] 

Thank you for your Feedback, the issue is however that the configuration of this project is the same and only the axis version changed from 1.7.9 to 1.8.0.
We use jaxws to create the client which should consume the service, the way the client is created is exactly the same with wsimport2.

To eliminate the code generation topic I used one of your samples https://axis.apache.org/axis2/java/core/download.html
The example I am talking about is the client > echo one
{code}
/**
 * buildEcho
 * Call the Echo service (Sync)
 *
 * @param endpointURL The Service endpoint URL
 * @param input       The message string
 * @return String from the service
 */
public String buildEcho(String endpointURL, URL wsdlURL, String input) {
    String response = "ERROR!:";
    try {
        EchoServicePortProxy echo = new EchoServicePortProxy(wsdlURL);
        echo._getDescriptor().setEndpoint(endpointURL);

        // Configure SOAPAction properties
        BindingProvider bp = (BindingProvider) (echo._getDescriptor()
                .getProxy());
        bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
                endpointURL);
        bp.getRequestContext().put(BindingProvider.SOAPACTION_USE_PROPERTY,
                Boolean.TRUE);
        bp.getRequestContext().put(BindingProvider.SOAPACTION_URI_PROPERTY,
                "echoOperation");

        // Build the input object
        EchoStringInput echoParm =
                new org.apache.axis2.jaxws.samples.echo.ObjectFactory().createEchoStringInput();
        echoParm.setEchoInput(input);
        System.out.println(">> CLIENT: SEI Echo to " + endpointURL);

        // Call the service
        response = echo.echoOperation(echoParm).getEchoResponse();
        System.out.println(">> CLIENT: SEI Echo invocation complete.");
        System.out.println(">> CLIENT: SEI Echo response is: " + response);
    } catch (Exception e) {
        System.out.println(">> CLIENT: ERROR: SEI Echo EXCEPTION.");
        e.printStackTrace();
        return response + ">>>ECHO SERVICE EXCEPTION<<< ";
    }
    return response;
}
{code}
axis2-1.8.0\samples\jaxws-samples\src\main\org\apache\axis2\jaxws\samples\client\SampleClient.java

I refactored it a little bit so that the EchoServicePortProxy is reused
https://github.com/dsteindo/Axis2Examples/blob/main/1.8.0/jaxws/src/at/dsteindo/axis2/execute/EchoTest.java

It works for exactly 200 times, then it stops and on interruption following exception is thrown
 [^echoTestInterruptionException.txt] 
It points once again to the AbstractConnPool

Another thing I checked was the libraries, but they are very similar to the ones I can download on your page
https://github.com/dsteindo/Axis2Examples/blob/main/1.8.0/jaxws/pom.xml
Even replacing the content of the lib folder did not yield any improvent

Might there be the possibility that this issue was overlooked as the samples always create a new ServicePort or ServicePortProxy and there is no case for extensive testing if the resource is reused?
Or is there a configuration issue somewhere on my side? but then I am not sure why it works for Axis2 1.7.9


was (Author: JIRAUSER287101):
Hi [~robertlazarski] 

Thank you for your Feedback, the issue is however that the configuration of this project is the same and only the axis version changed from 1.7.9 to 1.8.0.
We use jaxws to create the client which should consume the service, the way the client is created is exactly the same with wsimport2.

To eliminate the code generation topic I used one of your samples https://axis.apache.org/axis2/java/core/download.html
The example I am talking about is the client > echo one
{code}
/**
 * buildEcho
 * Call the Echo service (Sync)
 *
 * @param endpointURL The Service endpoint URL
 * @param input       The message string
 * @return String from the service
 */
public String buildEcho(String endpointURL, URL wsdlURL, String input) {
    String response = "ERROR!:";
    try {
        EchoServicePortProxy echo = new EchoServicePortProxy(wsdlURL);
        echo._getDescriptor().setEndpoint(endpointURL);

        // Configure SOAPAction properties
        BindingProvider bp = (BindingProvider) (echo._getDescriptor()
                .getProxy());
        bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
                endpointURL);
        bp.getRequestContext().put(BindingProvider.SOAPACTION_USE_PROPERTY,
                Boolean.TRUE);
        bp.getRequestContext().put(BindingProvider.SOAPACTION_URI_PROPERTY,
                "echoOperation");

        // Build the input object
        EchoStringInput echoParm =
                new org.apache.axis2.jaxws.samples.echo.ObjectFactory().createEchoStringInput();
        echoParm.setEchoInput(input);
        System.out.println(">> CLIENT: SEI Echo to " + endpointURL);

        // Call the service
        response = echo.echoOperation(echoParm).getEchoResponse();
        System.out.println(">> CLIENT: SEI Echo invocation complete.");
        System.out.println(">> CLIENT: SEI Echo response is: " + response);
    } catch (Exception e) {
        System.out.println(">> CLIENT: ERROR: SEI Echo EXCEPTION.");
        e.printStackTrace();
        return response + ">>>ECHO SERVICE EXCEPTION<<< ";
    }
    return response;
}
{code}
axis2-1.8.0\samples\jaxws-samples\src\main\org\apache\axis2\jaxws\samples\client\SampleClient.java

I refactored it a little bit so that the EchoServicePortProxy is reused
https://github.com/dsteindo/Axis2Examples/blob/main/1.8.0/jaxws/src/at/dsteindo/axis2/execute/EchoTest.java

It works for exactly 200 times, then it stops and on interruption following exception is thrown
 [^echoTestInterruptionException.txt] 
It points once again to the AbstractConnPool

Another thing I checked was the libraries, but they are very similar to the ones I can download on your page
https://github.com/dsteindo/Axis2Examples/blob/main/1.8.0/jaxws/pom.xml
Even replacing the content of the lib folder did not yield any improvent

Might there be the possibility that this issue was overlooked as the samples always create a new ServicePort or ServicePortProxy and there is no case for extensive testing if the resource is reused?

> Axis2 connections are not returned to connection pool on 1.8.0 with JAXWS
> -------------------------------------------------------------------------
>
>                 Key: AXIS2-6030
>                 URL: https://issues.apache.org/jira/browse/AXIS2-6030
>             Project: Axis2
>          Issue Type: Bug
>          Components: transports
>    Affects Versions: 1.8.0
>            Reporter: David Steindorfer
>            Assignee: Robert Lazarski
>            Priority: Major
>         Attachments: echoTestInterruptionException.txt
>
>
> Good Afternoon,
>  
> I have upgraded Axis2 from 1.7.9 to 1.8.0 on one of our projects.
> However with the upgrade the requests seem to get stuck. 
> On further analysis I figured out that the connection pool ran dry as the connections were not returned.
>  
> It took a while to reproduce the issue reliably and isolated from the other code of our project but under very similar circumstances.
> Thus I created a public git repo with the code I wrote to reproduce the issue:
> [https://github.com/dsteindo/Axis2Examples]
>  
> I think the affected component is the "axis2-transport-http" library.
> For now I reverted the project's libraries back to 1.7.9.
> But it would be awesome to use the latest libraries, considering that you did quite a lot of changes and improvements :) 
>  
> Please feel free to contact me if more information is needed, but I guess that everything should be documented with the git repository.



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org