ClassCastException in AxisClient.getJAXRPCHandlerChain
------------------------------------------------------

         Key: AXIS-2270
         URL: http://issues.apache.org/jira/browse/AXIS-2270
     Project: Apache Axis
        Type: Bug
 Environment: exists in axis 1.2.1 and code hasn't chaged in 1.3
    Reporter: John Childs


in org.apache.axis.client.AxisClient  the method getJAXRPCHandlerChain executes 
the following sequence

javax.xml.rpc.handler.HandlerRegistry registry;
registry = service.getHandlerRegistry();
if(registry != null) {
    chain = registry.getHandlerChain(portName);
    if ((chain != null) && (!chain.isEmpty())) {
        hiChainFactory = new
HandlerInfoChainFactory(chain);
        clientSpecified = true;
    }
}

within that sequence there is an attempt to create a HandlerInfoChainFactory by 
passing a HanderChain to the constructor.  This is incorrect and causes a 
ClassCastException, HandlerInfoChainFactory requires a List of HandlerInfos.    
The code also doesn't appear to be necessary as all that is happening later in 
the function
is calling createHandlerChain on the factory and returning it.   In the above 
case, the code should just return the chain.   Something like

javax.xml.rpc.handler.HandlerRegistry registry;
registry = service.getHandlerRegistry();
if(registry != null) {
    chain = registry.getHandlerChain(portName);
    if ((chain != null) && (!chain.isEmpty())) {
        // we already have a handler chain, return it.
        if ( chain instanceof HandlerChain )
        {
            return (HandlerChain)chain;
        }
        hiChainFactory = new
HandlerInfoChainFactory(chain);
        clientSpecified = true;
    }
}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to