jQuery in Action, 2nd edition*
The moose likes Tomcat and the fly likes Can't Get Tomcat 4.1.18 running Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Can Watch "Can New topic
Author

Can't Get Tomcat 4.1.18 running

Mike London
Ranch Hand

Joined: Jul 12, 2002
Posts: 1043
Hi,
I tried a "quick" upgrade from Tomcat 4.0.4 to 4.1.18, but have had nothing but problems.
I tried to install 4.1.18 as a Windows service (Windows 2K) and the basic JSP came up. However, my servlets were "unavailable" (404 error) eventhough the paths matched the old 4.0.4 installation where all worked.
The documentation is so sparse, I'm not sure what's wrong.
For example, when you install Tomcat as a Windows service, do you still need to set the environment variables like CATALINA_HOME and JAVA_HOME. I have both these set, but now it now doesn't work at all -- even with the index.jsp file.
I'm not sure what I did to screw it up, but something is definitely wrong here.
Anybody run into this issue?
Thanks in advance.
-- Mike.
JiaPei Jen
Ranch Hand

Joined: Nov 19, 2000
Posts: 1309
I went through the similar situation not too long ago. Although this thread:
http://www.coderanch.com/t/82355/Tomcat/Installing-Tomcat-Windows
is regarding the tomcat 4.1.17 installation; nonetheless, I eventually got 4.1.18 installed following the same procedure.
You may write to me if the aforementitoned thread does not help.
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

Ok this might seem far too obvious, but I'll admit that *I* made this mistake...

Is CATALINA_HOME pointing to your old version's install ?
Mike London
Ranch Hand

Joined: Jul 12, 2002
Posts: 1043
Hi all,
I re-installed Tomcat 4.1.18 again this morning and now have the original problem. Note that the same setup worked fine under 4.0.4.
The problem that remains is getting the servlets to work.
================================
I changed CATALINA_HOME to C:\Program Files\Apache\Tomcat 4.1 (to match the directory structure).
JAVA_HOME Points to C:\J2sdk1.4.1
================================
Here are some problem details:
When I do a http://localhost:8081/hello.jsp, all works fine.

(I changed the port to 8081 because of some conflict with 8080)
-----------------------
When I try to do a JSP page in a directory under root, all works fine too. Something like:
http://localhost:8081/webcalendar/Login.jsp
-----------------------
The problem comes in when this JSP tries to transfer control to a servlet, like it did successfully under 4.0.4. The URL that appears from the JSP code is:
http://localhost:8081/servlet/webcalendar.Controller
But here I get a 404 error -- "The requested resource (/servlet/webcalendar.Controller) is not available."
This "Controller.class" file is under WEB-INF\classes\webcalendar, so it should be found (like it was under 4.0.4).
Additionally, I can't run any other servlets either. It's like Tomcat can't find them eventhough they're in the same directory path (relative to the 4.1.18 installation as with the 4.0.4 installation).
This is quite strange and doesn't seem to match any threads posted.
Any ideas???
Thanks again for all the help up to this point.

-- Mike
Mike London
Ranch Hand

Joined: Jul 12, 2002
Posts: 1043
Do I need to have a web.xml entry for the servlet to work under Tomcat 4.1.18?
I didn't have a web.xml under Tomcat 4.0.4, but perhaps 4.1.18 is more picky?
The problem is that I can't run a servlet like this (from a form action clause):
http://localhost:8081/servlet/webcalendar.Controller
when the Controller.class is in the directory:
C:\Program Files\Apache\Tomcat 4.1\webapps\ROOT\WEB-INF\classes\webcalendar
Same directory set up that worked under 4.0.4.
Thanks in advance for any help.
(JSP files work fine)
-- Mike
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

It's because as of 4.1.12, the /servlet mapping has been removed by default.

It is a security risk to use this type of dynamic non-aliased invocation.

To make it all work the way it did, you *can* enable the default mapping. I don't have an install on this system, but I think it's in the web.xml under conf.

It *is* buried in the Tomcat docs, btw. Search the readme for /servlet
 
 
subject: Can't Get Tomcat 4.1.18 running
 
Similar Threads
Another Win98 Tomcat install problem
Problems getting started
Do I Still need Startup.bat????
Tomcat as Windows service - I can't set more than 768 Mb of memory
Installation of Tomcat