No I didn't change anything.
So I see the location is hard-coded.

I did that little test cos. I've got
another app with the following dir
structure
com/lansa/web/servlet/LANSAWEB
which I put webapp/lansa/WEB-INFO
yet every time am trying to run it always complains
with the same kind of error, root cause...java.lang.NoClassDefFoundError...
basically it can't find the class in com/lansa/web/servlet.

Yet from what I've read it seem that you only need to put unpacked
your classes in /webapps/AppName/WEB-INF/classes and basically your
app will know where to find other classes which it depends on, requiring
no need to have classpath anymore.

Sorry for so far the docs looks misleading to me.
On thing this app was original in jar file format and
contains an applet which I could easily run using the command
$JAVA_HOME/jre/bin/java -cp ./:./lansa.jar:./swingall.jar 
com.lansa.web.admin.WebAdministrator

What am trying to run is com.lansa.web.servlet.LANSAWEB
As well there was no web.xml provided but do I really need
to create it given that putting everything under /WEB-INF/classes
"claims" to resolve all dependencies?

Beside why can I run the applet from the command line using
the jar files but I couldn't do the same thing (no web.xml required)
when trying to run the servlet.
As well I must mention that a colleague manage to run the LANSAWEB
servlet using the same jar file and jserve.

Thanks

Dom

-----Original Message-----
From: dderry [mailto:[EMAIL PROTECTED]]
Sent: 21 January 2002 15:00
To: Tomcat Users List
Subject: Re: basic servlet move doesn't work


Sounds like you may have not changed the package statement in
ForwardServlet. Remember that the directory structure reflects the package
structure (or vice versa). It looks like it is finding the class
ForwardServlet, but it is the wrong name because it is expecting to find
dir.ForwardServlet (ie. it expects ForwardServlet to be in the dir package).

Hope this helps,
Dave Derry


----- Original Message -----
From: "Cressatti, Dominique" <[EMAIL PROTECTED]>
To: "Tomcat Users List" <[EMAIL PROTECTED]>
Sent: Monday, January 21, 2002 10:53 AM
Subject: basic servlet move doesn't work


Hi,

I have a very simple example app.
For testing purposes I moved the servlet into a subdirectory.
So before the move I had
/webapps/Wide_World/WEB-INFO/classes/ForwardServlet.class
and after the move I had
/webapps/Wide_World/WEB-INFO/classes/dir/ForwardServlet.class

according to the docs I've read I can do such a thing and reflect it
I need edit /webapps/Wide_World/web.xml

from:
....<servlet-name>forward</servlet-name>
    <servlet-class>ForwardServlet</servlet-class>

to
....<servlet-name>forward</servlet-name>
    <servlet-class>dir.ForwardServlet</servlet-class>

which I did (and restated tomcat).
However how such simple change doesn't work?
Now when I try to access again the servlet I get:
...HTTP error status 500...
Error allocating a servlet instance....
root cause
java.lang.NoClassDefFoundError: dir/ForwardServlet (wrong name:
ForwardServlet)...

What's going on!

Thanks
Dom






--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>


--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>

Reply via email to