cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dhawalpatel (JIRA)" <>
Subject [jira] [Created] (CXF-6940) Bus Reference nullified pre-maturely in ClientImpl causing Exceptions while processing Responses
Date Wed, 15 Jun 2016 00:22:29 GMT
Dhawalpatel created CXF-6940:

             Summary: Bus Reference nullified pre-maturely in ClientImpl causing Exceptions
while processing Responses
                 Key: CXF-6940
             Project: CXF
          Issue Type: Bug
          Components: JAX-WS Runtime
    Affects Versions: 3.1.4
         Environment: IBM JDK 1.7, Apache CXF installed as resource Adapter on IBM WebSphere on RHEL 6.0
            Reporter: Dhawalpatel
            Priority: Critical

Hi Daniel,

Test Scenario:
Install CXF as Resource Adapter in J2EE Container and use below code to call a JAX-WS API.

/* Lookup Resource Adapter of JCA and get COnnection*/

CXFConnectionFactory connectionFactory = getCXFConnectionFactory(portClass);
   CXFConnectionSpec connectionSpec = createCXFConnectionSpec(portClass, serviceName, portName,
/* Get the Port from JCA Connection pool*/

  connection = connectionFactory.getConnection(connectionSpec);
       port = connection.getService(portClass);
/* Close the JCA Connection*/
if(connection != null)

/*WebService call*/

When a JCA Connection pool eviction happens due to Max Connections reached state, the existing
on-going outgoing JAX-WS Calls errors out with below exception:

Message received on a Client that has been closed or destroyed.
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(
	at java.lang.reflect.Constructor.newInstance(
	at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.mapException(
	at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(
	at org.apache.cxf.transport.AbstractConduit.close(
	at org.apache.cxf.transport.http.HTTPConduit.close(
	at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(
	at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(
	at org.apache.cxf.endpoint.ClientImpl.doInvoke(
	at org.apache.cxf.endpoint.ClientImpl.invoke(
	at org.apache.cxf.endpoint.ClientImpl.invoke(
	at org.apache.cxf.endpoint.ClientImpl.invoke(
	at org.apache.cxf.frontend.ClientProxy.invokeSync(
	at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(
	at com.sun.proxy.$Proxy106.inquireWirelinePaymentPlan(Unknown Source)
	at sun.reflect.GeneratedMethodAccessor360.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(
	at java.lang.reflect.Method.invoke(
	at AppAdapter.executeWebService(
Caused by: 
java.lang.IllegalStateException: Message received on a Client that has been closed or destroyed.
	at org.apache.cxf.endpoint.ClientImpl.onMessage(
	at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(
	at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(
	at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(
	... 26 more

On further investigation, it seems you changed the code in as per
and change log

by adding the additional cleanup code in the below lines

bus = null;
        conduitSelector = null;
        outFaultObserver = null;
        outboundChainCache = null;
        inboundChainCache = null;

        currentRequestContext = null;
        requestContext = null;
        responseContext = null;
        executor = null;   

The above lines added by you for cleanup has broken the behavior of using the JCA connection
for getting port and closing it immediately and then using the port to call the webservice.
This leads to above exception when JCA Pool maxes out causing an eviction on JCA Pool by below
thread stack causing the ClientImpl's destroy to be called and ultimately the bus obj ref
getting set to null by your code and ultimately this exception.
The behavior in CXF 2.3 was perfectly fine with no such problems. This was introduced by above
mentioned code fix.


Please fix this behavior since its not in the alignment to the behavior mentioned in JCA Spec
and as per the documentation provided in CXF as well.

This message was sent by Atlassian JIRA

View raw message