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 Reynardine <re...@loveable.com> on 2002/11/01 00:50:06 UTC

Re: Problem consuming web services from a servlet

Problem fixed - thankyou Francisco,

I copied my 15 jars from webapps/axis/../lib to common/lib, restarted Tomcat and the servlet works fine.  

(Note I had to make some minor changes to the servlet on

http://marc.theaimsgroup.com/?l=axis-user&m=102942726001805&w=2

i.e. the URL and adding a doGet method.)

-Rey


----- Original Message -----
From: Francisco Andrades Grassi <bi...@nextj.com>
Date: 31 Oct 2002 11:28:19 -0400
To: axis-user@xml.apache.org
Subject: Re: Problem consuming web services from a servlet


> Greeting,
> 
> You need to add the axis related jars to the servlet runtime classpath
> (ie: WEB-INF/lib). The NoClassDefFoundError implies that the class was
> found at compile time but it's not found at runtime.
> 
> Regards
> Francisco Andrades Grassi
> www.NextJ.com
> 
> On Thu, 2002-10-31 at 10:57, Reynardine wrote:
> > Hi,
> > 
> > I am quite new to Axis and can deploy and test some simple services from the command line.  I want to consume these services from a servlet.
> > 
> > For example, I've tried Eric Jung's example on
> > http://marc.theaimsgroup.com/?l=axis-user&m=102942726001805&w=2
> > 
> > I'm using Tomcat and 'normal' servlets work fine. But when I convert my Axis service test code to a servlet with Axis import statements I get run time errors when I run it from the browser.  For example, my servlet is like this...
> > 
> > import org.apache.axis.client.Call;
> > import org.apache.axis.client.Service;
> > import org.apache.axis.encoding.XMLType;
> > import javax.xml.rpc.ParameterMode;
> > import javax.xml.namespace.QName;
> > import java.net.URL;
> > import java.io.*;
> > import javax.servlet.*;
> > import javax.servlet.http.*;
> > public class StockQuoteServiceClient extends HttpServlet { 
> >    public void doPost(HttpServletRequest request, HttpServletResponse response) 
> >        throws IOException, ServletException { 
> >         PrintWriter out = response.getWriter(); 
> >         Object o = request.getParameter("symbol"); 
> >         Service service = new Service(); 
> > 
> > but running from a browser under Tomcat I get...
> > 
> > javax.servlet.ServletException: Cannot allocate servlet instance ...
> > java.lang.NoClassDefFoundError: org/apache/axis/client/Service
> > 	at java.lang.Class.newInstance0(Native Method)
> > 
> > Is my JVM wrong ? Do I need to change server.xml or web.xml ?
> > 
> > Any help appreciated..
> > 
> > - Rey
> > -- 
> > __________________________________________________________
> > Sign-up for your own FREE Personalized E-mail at Mail.com
> > http://www.mail.com/?sr=signup
> > 
> > 
> > 
> 
> 
> 

-- 
__________________________________________________________
Sign-up for your own FREE Personalized E-mail at Mail.com
http://www.mail.com/?sr=signup