You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Mark Leone <ma...@hotmail.com> on 2004/05/01 20:51:21 UTC
RE: NoClassDefFoundError writing simple handler
Have you looked in axis.jar and verified explicitly that BasicHandler.class
is present?
>From: Robert Mecklenburg <me...@realmsys.com>
>Reply-To: axis-user@ws.apache.org
>To: Axis Users <ax...@ws.apache.org>
>Subject: NoClassDefFoundError writing simple handler
>Date: 30 Apr 2004 09:19:47 -0600
>
>I'm a newbie to web services and axis and I'm trying to implement a
>simple handler.
>
>1. The handler code is:
>
> public class LogHandler extends BasicHandler
> {
> public final void invoke(MessageContext msgContext) throws AxisFault
> {
> System.out.println("handler invoked!");
> }
> }
>
>2. I modified my server-config.wsdd with:
>
> <handler name="loghandler"
>type="java:com.realmsys.mdms.server.key.LogHandler">
> <parameter name="wsdlURL" value="/axis/LogHandlerService-impl.wsdl"/>
> <parameter name="serviceName" value="LogHandlerService"/>
> <parameter name="namespace"
>value="http://com.realmsys.mdms/LogHandlerService-impl.wsdl"/>
> <parameter name="portName" value="Debug"/>
> </handler>
>
>3. I added my new handler to my service:
>
> <service name="KeyManagerService" provider="java:RPC">
>
> <requestFlow>
> <handler type="loghandler"/>
> </requestFlow>
>
> <responseFlow>
> <handler type="loghandler"/>
> </responseFlow>
>
> <parameter name="allowedMethods" value="*"/>
> ...
>
>4. When I deploy and run this configuration I get this message returned
> to the client app:
>
> AxisFault
> faultCode: {http://xml.apache.org/axis/}HTTP
> faultSubcode:
> faultString: (500)Internal Server Error
> faultActor:
> faultNode:
> faultDetail:
> {}string: return code: 500
>
> Apache Tomcat/5.0.19 - Error report
> HTTP Status 500 -
> type
> Exception report
> message
> description
> The server encountered an internal error () that prevented it from
>fulfilling this request.
> exception
> javax.servlet.ServletException: Servlet execution threw an exception
> root cause java.lang.NoClassDefFoundError:
>org/apache/axis/handlers/BasicHandler
> java.lang.ClassLoader.defineClass0(Native Method)
> java.lang.ClassLoader.defineClass(ClassLoader.java:537)
> java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
> java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
> java.net.URLClassLoader.access$100(URLClassLoader.java:55)
> java.net.URLClassLoader$1.run(URLClassLoader.java:194)
> java.security.AccessController.doPrivileged(Native Method)
> java.net.URLClassLoader.findClass(URLClassLoader.java:187)
> java.lang.ClassLoader.loadClass(ClassLoader.java:289)
> sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
> java.lang.ClassLoader.loadClass(ClassLoader.java:235)
>
>org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1296)
>
>org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1230)
> java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
> ...
>
>Without the <requestFlow>/<responseFlow> clauses my pivot service
>appears to work fine. It goes sour only with the new handler. It
>appears there is some kind of security issue since *clearly* the
>axis.jar files are loaded and running (it is deep in axis code when
>it throws the exception).
>
>Any suggestions would be greatly appreciated!
>
>Cheers,
>Robert
>
>
>P.S. I've tried many permutations, of course, one which may be of
>particular interest is that I replaced my service declaration in the
>wsdd file with the simpler:
>
> <handler name="loghandler"
>type="java:com.realmsys.mdms.server.key.LogHandler"/>
>
>as I saw several such short declarations in the default wsdd file.
>The change did not cure the problem.
_________________________________________________________________
FREE pop-up blocking with the new MSN Toolbar get it now!
http://toolbar.msn.com/go/onm00200415ave/direct/01/
RE: NoClassDefFoundError writing simple handler
Posted by Robert Mecklenburg <me...@realmsys.com>.
RM> I'm a newbie to web services and axis and I'm trying to implement a
RM> simple handler.
RM> javax.servlet.ServletException: Servlet execution threw an exception
RM> root cause java.lang.NoClassDefFoundError:
RM> org/apache/axis/handlers/BasicHandler
ML> Have you looked in axis.jar and verified explicitly that
ML> BasicHandler.class is present?
Absolutely, it was the first thing I checked, yes, it is there.
I even decompiled it to ensure it was the implementation I expected.
Am I the only axis user who has encountered this? Other folks are
writing handlers without seeing this issue?
A little more info:
1. I configured the axis handler org.apache.axis.handlers.DebugHandler
into my wsdd
2. verified it was being called by breaking in the code with a
debugger
3. Copied the exact source code into my own package, updated the
package statement, compiled, updated the wsdd, deployed
4. Got the *exact* error above
Thoughts?
Thanks,
--
Robert