tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jacob Kjome <Jacob.R.Kj...@syntegra.com>
Subject RE: myapp question
Date Wed, 24 May 2000 17:49:54 GMT
That's the strange thing.  I had everything compiled.  I changed nothing but
the the class name:  changed it from Hello.class to HelloWorld.class and
changed the web.xml file to look for the HelloWorld class rather than Hello

That was it.  I've got that directory structure down just fine.  Actually, I
am running Tomcat through Apache Web Server 1.3.12 using the ApacheJServ...
thingy.

I have 3 separate webapps going other than the examples and test that come
with the server.

The weird thing is, I tried this at home and it worked.

I brought the entire Jakarta dir + all subdirs and files and used that here
at work.  myapp at home ran fine, but not at work until I changed the
Hello.class to HelloWorld.class

I even tried to put the Hello.class in other webapps that I had working
fine.  Didn't work there either until I put the HelloWorld.class there.


I know this is kind of bizarre.  Given all the webapps that I have working,
I think I've proven I know a little about what I'm doing.  I'm just
wondering if anyone has a rational reason for this to happen.  Does my
theory that I stated in the earlier message hold water?

BTW, I do shutdown and restart both the web server and Tomcat (always
starting Tomcat and then the web server) any time I make any sort of change.


Any other ideas?

Jake

-----Original Message-----
From: Craig R. McClanahan [mailto:Craig.McClanahan@eng.sun.com]
Sent: Wednesday, May 24, 2000 12:39 PM
To: tomcat-user@jakarta.apache.org
Subject: Re: myapp question


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):

    $TOMCAT_HOME/webapps/myapp/
        WEB-INF/
            web.xml
            classes/
                Hello.class
        hello.jsp
        index.html
        images/
            tomcat.gif

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



--------------------------------------------------------------------------
To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org
For additional commmands, email: tomcat-user-help@jakarta.apache.org

Mime
View raw message