Help!  Tomcat Error message - environment variables

Posted on 2003-11-07
Medium Priority
Last Modified: 2012-05-04
Help!  I'm a microsoft girl and I'm not very familiar with this stuff!  I'm trying to get tomcat running on my IIS 5/Windows 2000 server.  The files for this were written by someone else and  have been moved from another server, where they were working, so I'm inclined to believe the code is just fine -- unless something changed in the folder structure or elsewhere between versions -- I notice servlet.jar seems to be missing and instead there is servlet-api.jar.

The version on the old server was 4.1.12 -- though I've tried reverting to the old version on the new server and still get the same error message.  I think it is something very basic -- env vars that I haven't set -- but I'm not sure what they should be.

I ran j2sdk-1_4_2_01-windows-i586-iftw.exe and then jakarta-tomcat-5.0.12.exe.

Unfortunately, something strange happened and I thought this worked the first time (maybe somehow it was still pointing at the old server, I don't know) so I thought it was working and let the old server get re-installed, so I don't have the old environment variables to compare.  =/

Can you clear this up for me?  What env vars do I have to set?  CATALINA_HOME?  JAVA_HOME?  Anything else?  What should I point classpath/path to?

Here's another question -- do I have to put the whole jar file and everything in the env vars, or can I just point them to the folder?  And, does tomcat care about a / on the end in the env vars?  (JAVA_HOME = c:\j2sdk1.4.2_01 or c:\j2sdk1.4.2_01\ ?)

Also -- the hello world examples ARE working.  The author of the code has a folder for mypackagename and it seems its the files in there having issues -- like the package thing might be causing problems??

Anyways, let me know if I can answer any more questions, I appreciate all your help since this is not my area of specialty.  Here is the error message I get.  (Jeez, I hope it's something simple...)

HTTP Status 404 - /mywebname/servlet/mypackagename.myfile
type Status report
message /mywebname/servlet/mypackagename.myfile
description The requested resource (/mywebname/servlet/mypackagename.myfile) is not available.
Question by:kataragon
  • 3
  • 2

Expert Comment

ID: 9712418
It sounds like your problem isn't related to environment variables at all unless somone originally customized CATALINA_HOME before to point to another location for applications.  You may ask around to see if this might be the case.  By the 404 status code it isn't able to find this on the server.  Can you provide overview of directory structure where you deployed application and general location of tomcat installation (don't need everyfile just initial directory)?  Have you changed any configuration files in tomcat other than the configuration file within your application?

Author Comment

ID: 9722899
C:\Program Files\Apache Software Foundation\Tomcat 5.0\webapps\mywebname\
contains the following folders:


The package and class files are located here:

WEB-INF\classes\mypackagename\myfile.java and myfile.class

As I recall, you don't put java files in logical locations -- so on the web, it is looking for /mywebname/servlet/mypackagename.myfile and that translates to some other location that apparently used to be WEB-INF\classes\mypackagename\myfile.java and myfile.class.

This code used to work -- the only thing that I can think of that could have changed was environment variables.  Is the location of this file correct??  Any suggestions are appreciated!

Accepted Solution

rootkiddy earned 750 total points
ID: 9728228
Assuming no modifications have occured to the configuration files of tomcat then directory structure looks fine.  What does your web.xml file look like pertaining to this servlet?  I'm looking for how you have it registered along with the URL mapping.  Basically I'm looking at whether or not there is a mapping such that you can access this via /mywebname/servlet/mypackagename.myfile as this takes modification to web.xml to make that work.

Author Comment

ID: 9733755
Hmm, I suppose that could be the problem also because I haven't done anthing to it.  =)  

I thought that was what the invoker did -- if you didn't specify a web.xml file in the mywebname folder, it would use the generic and automatically add the correct mapping for it -- I don't remember adding a mapping on the old server, and wasn't a big fan of doing that every time this guy wanted to add a new folder...   So, I just have the default web.xml in the conf folder.

I apologize for being so dumb about this stuff =)  I haven't made any mods -- I'm trying to use a very vanilla installation.


Author Comment

ID: 9733874
Oh, yay, I think I figured it out.  To make the invoker thing work, you have to uncomment two sections in that web.xml file.  Thank you!!!  

Featured Post

Train for your Pen Testing Engineer Certification

Enroll today in this bundle of courses to gain experience in the logistics of pen testing, Linux fundamentals, vulnerability assessments, detecting live systems, and more! This series, valued at $3,000, is free for Premium members, Team Accounts, and Qualified Experts.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

In my time as an SEO for the last 2 years and in the questions I have assisted with on here I have always seen the need to redirect from non-www urls to their www versions. For instance redirecting http://domain.com (http://domain.com) to http…
If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
Watch the video to know how one can repair corrupt Exchange OST file effortlessly and convert OST emails to MS Outlook PST file format by using Kernel for OST to PST converter tool. It can convert OST to MSG, MBOX, EML to access them. It can migrate…
In the video, one can understand the process of resizing images in single or bulk. Kernel Bulk Image Resizer is an easy to use tool for resizing large number of images. One can add and resize multiple images with this tool in single go. The video sh…
Suggested Courses

607 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question