I use eclipse and in the debugger the classpath looks correct. I traced into 
the code and in org.apache.axis.handlers.HandlerChainImpl class newHandler() 
method the code is throwing a class cast exception:

    private Handler newHandler(HandlerInfo handlerInfo) {
        try {
            Handler handler = (Handler)handlerInfo.getHandlerClass()
                            .newInstance();
            handler.init(handlerInfo);
            return handler;
        } catch (Exception ex) {
            String messageText =
                    Messages.getMessage("NoJAXRPCHandler00",
                    handlerInfo.getHandlerClass().toString());
            throw new JAXRPCException(messageText, ex);
        }
    }

The call to neInstance() above casts the result to 
javax.xml.rpc.handler.Handler but SimpleSessionHandler does not implement 
javax.xml.rpc.handler.Handler interface. It implements org.apache.axis.Handler 
and is a subclass of org.apache.axis.handlers.BasicHandler. I must be 
installing the handler in the wrong object. Any idea how I can install the 
SimpleSessionHandler using the code from DynamicInvoker class in the axis 
examples via code?

Debugger info:
System.getProperty("java.class.path")
C:\eclipse3\utilities\MohawkWebClient\bin;C:\eclipse3\utilities\MohawkWebClient\lib\axis.jar;C:\eclipse3\utilities\MohawkWebClient\lib\axis-ant.jar;C:\eclipse3\utilities\MohawkWebClient\lib\commons-discovery-0.2.jar;C:\eclipse3\utilities\MohawkWebClient\lib\commons-logging-1.0.4.jar;C:\eclipse3\utilities\MohawkWebClient\lib\jaxrpc.jar;C:\eclipse3\utilities\MohawkWebClient\lib\log4j-1.2.8.jar;C:\eclipse3\utilities\MohawkWebClient\lib\saaj.jar;C:\eclipse3\utilities\MohawkWebClient\lib\wsdl4j-1.5.1.jar;C:\eclipse3\utilities\MohawkWebClient\lib\activation.jar;C:\eclipse3\utilities\MohawkWebClient\lib\mail.jar

J.R.
-----Original Message-----
From: trebor iksrazal [mailto:[EMAIL PROTECTED]
Sent: Wednesday, October 19, 2005 12:13 PM
To: [email protected]
Subject: RE: Axis 1.2 handlers


Try googling on this error - its a common one that has
nothing to do with handlers. 

My guess is that its really not in your client
classpath. If you're able try executing the client
with ant, which does a good job of resolving this type
of stuff. Otherwise i'd double check your classpath
very carefully. 

--- JR Ruggentaler <[EMAIL PROTECTED]> wrote:

> The server side is a Apple WebObjects application so
> I added activation.jar and mail.jar to the classpath
> and restarted the server. I also added
> activation.jar and mail.jar to the client classpath.
> I reran the client and it threw the same exception.
> The exception is actually from the client.  The
> client works fine without the changes to add the
> SimpleSessionHandler but throws the previously
> posted exception when I add the
> SimpleSessionHandler. My real goal it to add a
> custom handler to manage sessions in a WebObjects
> compatible manner. WebObjects uses several cookies
> in the HTTP headers to communicate session info for
> state management.
> 
> J.R.
> 
> -----Original Message-----
> From: trebor iksrazal [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, October 19, 2005 11:15 AM
> To: [email protected]
> Subject: RE: Axis 1.2 handlers
> 
> 
> Try putting activation.jar and mail.jar in your
> servlet  container. 
> 
> --- JR Ruggentaler <[EMAIL PROTECTED]> wrote:
> 
> > I modifier DynamicInvoker
> > 
> >     public HashMap invokeMethod(
> >             String operationName, String portName,
> > String[] args)
> >             throws Exception {
> >         String serviceNS = null;
> >         String serviceName = null;
> >         String operationQName = null;
> > 
> >         System.out.println("Preparing Axis dynamic
> > invocation");
> >         Service service = selectService(serviceNS,
> > serviceName);
> >         Operation operation = null;
> >         org.apache.axis.client.Service dpf = new
> > org.apache.axis.client.Service(wsdlParser,
> > service.getQName());
> > 
> >         Vector inputs = new Vector();
> >         Port port = selectPort(service.getPorts(),
> > portName);
> >         if (portName == null) {
> >             portName = port.getName();
> >         }
> > 
> >         // Add handler
> >         HandlerRegistry hr =
> > dpf.getHandlerRegistry();
> >         List handlers =
> > hr.getHandlerChain(QName.valueOf(portName));
> >         handlers.add(new
> > HandlerInfo(SimpleSessionHandler.class, new
> > HashMap(), null));
> > 
> > to add the SimpleSessionHandler but this caused
> the
> > following exception:
> > 
> > Reading WSDL document from
> >
>
'http://localhost:4444/cgi-bin/WebObjects/MohawkWebService.woa/ws/.MohawkWS?wsdl'
> > - Unable to find required classes
> > (javax.activation.DataHandler and
> > javax.mail.internet.MimeMultipart). Attachment
> > support is disabled.
> > Preparing Axis dynamic invocation
> > Executing operation getFilters with parameters:
> > AxisFault
> >  faultCode:
> >
>
{http://schemas.xmlsoap.org/soap/envelope/}Server.userException
> >  faultSubcode: 
> >  faultString: javax.xml.rpc.JAXRPCException:
> Unable
> > to create handler of type class
> > org.apache.axis.handlers.SimpleSessionHandler
> >  faultActor: 
> >  faultNode: 
> >  faultDetail: 
> > 
> >
>
{http://xml.apache.org/axis/}stackTrace:javax.xml.rpc.JAXRPCException:
> > Unable to create handler of type class
> > org.apache.axis.handlers.SimpleSessionHandler
> >     at
> >
>
org.apache.axis.handlers.HandlerChainImpl.newHandler(HandlerChainImpl.java:247)
> >     at
> >
>
org.apache.axis.handlers.HandlerChainImpl.&lt;init&gt;(HandlerChainImpl.java:77)
> >     at
> >
>
org.apache.axis.handlers.HandlerInfoChainFactory.createHandlerChain(HandlerInfoChainFactory.java:42)
> >     at
> >
>
org.apache.axis.client.AxisClient.getJAXRPChandlerChain(AxisClient.java:274)
> >     at
> >
>
org.apache.axis.client.AxisClient.invoke(AxisClient.java:140)
> >     at
> >
>
org.apache.axis.client.Call.invokeEngine(Call.java:2765)
> >     at
> > org.apache.axis.client.Call.invoke(Call.java:2748)
> >     at
> > org.apache.axis.client.Call.invoke(Call.java:2424)
> >     at
> > org.apache.axis.client.Call.invoke(Call.java:2347)
> >     at
> > org.apache.axis.client.Call.invoke(Call.java:1804)
> >     at
> >
>
com.mpv.wsclient.Mohawk.DynamicInvoker.invokeMethod(DynamicInvoker.java:239)
> >     at
> >
>
com.mpv.wsclient.Mohawk.DynamicInvoker.main(DynamicInvoker.java:104)
> > 
> >     {http://xml.apache.org/axis/}hostname:stpauligirl
> > 
> > javax.xml.rpc.JAXRPCException: Unable to create
> > handler of type class
> > org.apache.axis.handlers.SimpleSessionHandler
> >     at
> >
>
org.apache.axis.AxisFault.makeFault(AxisFault.java:101)
> >     at
> >
>
org.apache.axis.client.AxisClient.invoke(AxisClient.java:216)
> >     at
> >
>
org.apache.axis.client.Call.invokeEngine(Call.java:2765)
> >     at
> > org.apache.axis.client.Call.invoke(Call.java:2748)
> >     at
> > org.apache.axis.client.Call.invoke(Call.java:2424)
> >     at
> > org.apache.axis.client.Call.invoke(Call.java:2347)
> >     at
> > org.apache.axis.client.Call.invoke(Call.java:1804)
> >     at
> >
>
com.mpv.wsclient.Mohawk.DynamicInvoker.invokeMethod(DynamicInvoker.java:239)
> >     at
> >
>
com.mpv.wsclient.Mohawk.DynamicInvoker.main(DynamicInvoker.java:104)
> > Caused by: javax.xml.rpc.JAXRPCException: Unable
> to
> > create handler of type class
> > org.apache.axis.handlers.SimpleSessionHandler
> >     at
> >
>
org.apache.axis.handlers.HandlerChainImpl.newHandler(HandlerChainImpl.java:247)
> >     at
> >
>
org.apache.axis.handlers.HandlerChainImpl.<init>(HandlerChainImpl.java:77)
> >     at
> >
>
org.apache.axis.handlers.HandlerInfoChainFactory.createHandlerChain(HandlerInfoChainFactory.java:42)
> >     at
> >
>
org.apache.axis.client.AxisClient.getJAXRPChandlerChain(AxisClient.java:274)
> >     at
> >
>
org.apache.axis.client.AxisClient.invoke(AxisClient.java:140)
> >     ... 7 more
> > Exception in thread "main" 
> > 
> > Any idea why?
> > 
> > Thanks!
> > J.R.
> > -----Original Message-----
> > From: trebor iksrazal [mailto:[EMAIL PROTECTED]
> > Sent: Tuesday, October 18, 2005 2:25 PM
> > To: [email protected]
> > Subject: RE: Axis 1.2 handlers
> > 
> > 
> > Don't At least one other way is via the
> > HandlerRegistry, like so: 
> > 
> > //add ClientHandler to chain of events
> > java.util.List list =
> > svc.getHandlerRegistry().getHandlerChain(portQN);
> > list.add(new
> >
>
javax.xml.rpc.handler.HandlerInfo(ClientHandler.class,this.handlerConfig,null));
> > 
> > ClientHandler in this case simply implements
> Handler
> > .
> 
=== message truncated ===


"None are more hopelessly enslaved than those who falsely believe they are 
free. -- Goethe"


                
__________________________________ 
Start your day with Yahoo! - Make it your home page! 
http://www.yahoo.com/r/hs

Reply via email to