Tomcat 4.1 New Installation newbie 404 errors

N

Null & Void

Hello.
I've just installed Tomcat 4.1 on Windows XP Home with J2SE SDK
1.4.1_02

I can't get my old web apps (previously used Resin) to work. I copied
their folders from $RESIN\webapps to $CATALINA\webapps but I get 404s.

I even tried to create a new *empty* folder under $CATALINA\webapps
e.g. oneblankapp but http://localhost:8080/oneblankapp returns a 404
as well!!!

I'm lost. When I used resin all I had to do was put my folder in the
webapps directory. What's wrong now? The http://localhost:8080 and
http://localhost:8080/admin apps are working properly!

TIA,
Null & Void
 
W

Wendy S

Null & Void said:
I'm lost. When I used resin all I had to do was put my folder in the
webapps directory. What's wrong now? The http://localhost:8080 and
http://localhost:8080/admin apps are working properly!

Did you restart Tomcat after copying the files in? What do the log files
say? If a context isn't starting, there should be messages on the console
or in a log file in /path/to/tomcat/logs.
 
W

William Brogden

Null & Void said:
Hello.
I've just installed Tomcat 4.1 on Windows XP Home with J2SE SDK
1.4.1_02

I can't get my old web apps (previously used Resin) to work. I copied
their folders from $RESIN\webapps to $CATALINA\webapps but I get 404s.

I even tried to create a new *empty* folder under $CATALINA\webapps
e.g. oneblankapp but http://localhost:8080/oneblankapp returns a 404
as well!!!

I'm lost. When I used resin all I had to do was put my folder in the
webapps directory. What's wrong now? The http://localhost:8080 and
http://localhost:8080/admin apps are working properly!

If your old servlets used the /servlet/ addressing scheme, you need to
turn on the "invoker" servlet - off by default in Tomcat 4 - see the
web.xml file in ../conf

Bill
 
N

Null & Void

Did you restart Tomcat after copying the files in? What do the log files
say? If a context isn't starting, there should be messages on the console
or in a log file in /path/to/tomcat/logs.

Thanks, the logs were very helpful. It seems that this syntax in
web.xml:

<context-param myname="myvalue" />

had to be changed to:

<context-param>
<param-name>myname</param-name>
<param-value>myvalue</param-value>
</context-param>

Another thing: doesn't Tomcat automatically compile *.java files in
WEB-INF/classes ? It only works when I go to that dir and manually
compile them.

I guess I should learn ant or something...
 
W

Wendy S

Null & Void said:
Another thing: doesn't Tomcat automatically compile *.java files in
WEB-INF/classes ? It only works when I go to that dir and manually
compile them.

No, it never has. (JSP's do get generated and compiled automatically,
perhaps that's where you got that idea.)

Keep your source somewhere else, and only place the .class files (which you
have compiled) into the 'classes' directory. And don't forget to package
your classes... the default package will only get you so far.

Actually I build a .jar file for my project specific classes and place that
in WEB-INF/lib rather than having "loose" class files.

Ant would be a good thing to learn right about now!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,175
Latest member
Vinay Kumar_ Nevatia
Top