tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <>
Subject Re: myapp question
Date Wed, 24 May 2000 17:39:10 GMT
Jacob Kjome wrote:

> I have been having a problem setting up the myapp webapp that comes in the
> sample folder in the docs.
> Now, I did end up being able to run it, but not until I changed the class
> from Hello.class to some other name, such as HelloWorld.class
> as soon as I did this, it ran just fine.
> I had been thinking it was the web.xml file, but no matter what I did, it
> would give me this error when I ran the Hello.class
> Error: 404
> Location: /myapp/hello
> File Not Found
> /myapp/hello
> Does Tomcat just not like the name Hello.class for a classname??? Unlikely!
> My theory is that I had things improperly set up at first and ran the
> Hello.class servlet and it got a 404 error and cached that output for the
> Hello.class.  Is there a place in Tomcat where it caches the output of a
> class?  Is there a way to flush it?
> I have had no problem getting a servlet by any other name running
> correctly????

There's no restrictions on filenames that would mess this up.  The correct URL
is supposed to be "http://localhost:8080/myapp/hello" because that is what the
<servlet-mapping> entry says.  And, the class name it looks for is Hello.class
(because that is what the <servlet> entry says).

The only reason you would get a 404 is if the web app was not completely
deployed.  After you build it, you should end up with the following files
(assuming you are deploying into the "webapps" directory under $TOMCAT_HOME):


If there was a compile error, or if you didn't do the "build compile" step, the
class file might not be there.

Be sure you restart Tomcat after making any changes, unless you've set up this
context for auto-reloading in the "conf/server.xml" file.

> Thanks,
> Jake

Craig McClanahan

View raw message