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 Gila Cohen <gi...@pob.huji.ac.il> on 2005/09/04 13:30:11 UTC

Re: NoClassDefFoundError while running a servlet, no problem while running as a program!


Hi Javier,

Thanks for your help - you were correct, it actually helped.
I put all axis files in
         Apache_folder\myApp\webapp\WEB-INF\lib
and it works!

Thanks,
GC


At 05:22 PM 8/30/2005, you wrote:

>For the practical end of running your app, not really :). Due to
>classloader pecularities(*), a webapp will see nothing but
>jars/classes in WEB-INF, <tomcat>/shared/lib and <tomcat>/common/lib
>
>What you need to do is copy (not move) the axis jars to your webapp's
>WEB-INF/lib.
>
>That way, Axis keeps working, and your webapp has access to the axis
>classes it needs in order to run.
>
>(*) If you want to know more about tomcat classloader behaviour, look
>here: http://jakarta.apache.org/tomcat/tomcat-4.1-doc/class-loader-howto.html
>
>
>On 8/30/05, Gila Cohen <gi...@pob.huji.ac.il> wrote:
> >
> >
> > The axis classes are sitting under:
> >          Tomcat4 folder\webapps\axis\WEB-INF\lib
> > and the classpath refers to this directory + all files in it,
> >
> > while the servlet is sitting under
> >          Apache_folder\myApp\webapp\WEB-INF\classes
> >
> > I tried once to move the axis jars to tomact_folder\common\lib (I am sure
> > this folder is accessible to all tomcat applications), but then Axis was
> > not working properly.
> >
> > Doesn't tomcat know about the classpath?!
> >
> > Thanks,
> > GC
> >
> >
> > At 04:32 PM 8/30/2005, you wrote:
> >
> > >Just to discard the obvious, is this servlet in a context where it has
> > >access to all the axis jars (are they all in WEB-INF/lib)?
> > >
> > >On 8/30/05, Gila Cohen <gi...@pob.huji.ac.il> wrote:
> > > >
> > > >  Hello,
> > > >
> > > >  I am trying to call a web service using a client program. I 
> installed axis
> > > > on my machine (running xp, Apache 2.0.48 and tomcat 4.1.30), and 
> everything
> > > > works. In fact, I wrote a Java application which created a Service, 
> a Call,
> > > > invoked the call and got an answer back.
> > > >  But now, I am trying to move to a servlet, doing the exact same thing.
> > > >  The servlet is complied all right, but when I run it I get the 
> attached
> > > > message!
> > > >  Ideas, anyone?
> > > >
> > > >  (Pls. note that
> > > >  jdb.biogis.ENBI.BUFFIE.Client1.doGet
> > > > is the method which call the web service method).
> > > >
> > > >
> > > >
> > > > Thanks,GC
> > > >
> > > >
> > > 
> -----------------------------------------------------------------------------------------------------------
> > > >
> > > >
> > > >
> > > > 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
> > > >         at
> > > >
> > > 
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
> > > >         at
> > > >
> > > 
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
> > > >         at
> > > > jdb.servlets.filters.XSLTFilter.doFilter(XSLTFilter.java:214)
> > > >         at
> > > >
> > > 
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213)
> > > >         at
> > > >
> > > 
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
> > > >         at
> > > >
> > > 
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
> > > >         at
> > > >
> > > 
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
> > > >         at
> > > > 
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
> > > >         at
> > > > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
> > > >         at
> > > >
> > > 
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
> > > >         at
> > > >
> > > 
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
> > > >         at
> > > > 
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
> > > >         at
> > > > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
> > > >         at
> > > > 
> org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2422)
> > > >         at
> > > >
> > > 
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
> > > >         at
> > > >
> > > 
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
> > > >         at
> > > >
> > > 
> org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
> > > >         at
> > > >
> > > 
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
> > > >         at
> > > >
> > > 
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:163)
> > > >         at
> > > >
> > > 
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
> > > >         at
> > > > 
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
> > > >         at
> > > > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
> > > >         at
> > > >
> > > 
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
> > > >         at
> > > >
> > > 
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
> > > >         at
> > > > 
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
> > > >         at
> > > > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
> > > >         at
> > > > org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:199)
> > > >         at
> > > > 
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:833)
> > > >         at
> > > >
> > > 
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:711)
> > > >         at
> > > > 
> org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:584)
> > > >         at
> > > >
> > > 
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:687)
> > > >         at
> > > > java.lang.Thread.run(Thread.java:534)
> > > >
> > > >
> > > >
> > > > root cause
> > > >
> > > >  java.lang.NoClassDefFoundError: org/apache/axis/client/Service
> > > >         at
> > > > jdb.biogis.ENBI.BUFFIE.Client1.doGet(Client1.java:28)
> > > >         at
> > > > javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
> > > >         at
> > > > javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> > > >         at
> > > >
> > > 
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
> > > >         at
> > > >
> > > 
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
> > > >         at
> > > > jdb.servlets.filters.XSLTFilter.doFilter(XSLTFilter.java:214)
> > > >         at
> > > >
> > > 
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213)
> > > >         at
> > > >
> > > 
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
> > > >         at
> > > >
> > > 
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
> > > >         at
> > > >
> > > 
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
> > > >         at
> > > > 
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
> > > >         at
> > > > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
> > > >         at
> > > >
> > > 
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
> > > >         at
> > > >
> > > 
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
> > > >         at
> > > > 
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
> > > >         at
> > > > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
> > > >         at
> > > > 
> org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2422)
> > > >         at
> > > >
> > > 
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
> > > >         at
> > > >
> > > 
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
> > > >         at
> > > >
> > > 
> org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
> > > >         at
> > > >
> > > 
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
> > > >         at
> > > >
> > > 
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:163)
> > > >         at
> > > >
> > > 
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
> > > >         at
> > > > 
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
> > > >         at
> > > > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
> > > >         at
> > > >
> > > 
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
> > > >         at
> > > >
> > > 
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
> > > >         at
> > > > 
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
> > > >         at
> > > > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
> > > >         at
> > > > org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:199)
> > > >         at
> > > > 
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:833)
> > > >         at
> > > >
> > > 
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:711)
> > > >         at
> > > > 
> org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:584)
> > > >         at
> > > >
> > > 
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:687)
> > > >         at
> > > > java.lang.Thread.run(Thread.java:534)
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > Apache Tomcat/4.1.30-LE-jdk14
> > > >
> > >
> > >
> > >--
> > >Javier Gonzalez Nicolini
> >
> >
> >
>
>
>--
>Javier Gonzalez Nicolini