I
think you need to specify a full file path, because your servlet will search in
the current directory, which is way *not* ever going to be where you expect it
to be...
You
can use your knowledge of your own application, the request URI, and TOMCAT_HOME
to build one that's independant of installation directories, or I think you can
set it as a parameter in web.xml
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 12, 2001 2:55 PM
To: [EMAIL PROTECTED]
Subject: Tomcat Problem (startup.bat)
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 12, 2001 2:55 PM
To: [EMAIL PROTECTED]
Subject: Tomcat Problem (startup.bat)
Hello,
I am having a particular problem in getting one of my servlets to work with
Tomcat. My servlet (and other classes it calls upon to perform processing) is
located in a directory named:
c:\tomcat\webapps\nodes\web-inf\classes
When I run c:\tomcat\bin\startup.bat, and try to run the servlet, tomcat
immediately closes. But, when I run the startup.bat command from the
directory that the servlet exists in
(c:\tomcat\webapps\nodes\web-inf\classes\startup.bat), the servlet works
fine.
Note: one of the classes reads an input.dat file, which at first I thought
was causing the problem. The .dat file is in the same directory as the
servlet. I changed the way I called the .dat file from
"BufferedReader infile = new BufferedReader(new FileReader("input.dat"));"
to
"BufferedReader infile = new BufferedReader(new
InputStreamReader(getClass().getResourceAsStream("input.dat")));"
but this did not help the situation. I think it must be a classpath problem;
this is what my classpath looks like:
CLASSPATH=c:\jdk1.3\jre\lib\rt.jar;c:\j2sdkee1.3\lib\j2ee.jar;c:\tomcat\lib\se
rvlet.jar;c:\tomcat\webapps\nodes\web-inf\classes;c:\tomcat\webapps;c:\tomcat\
webapps\nodes\web-inf;c:\orion\default-web-app\web-inf\classes
Does anyone know what may be causing this problem? I want the servlet to run
when I launch startup.bat from the c:\tomcat\bin directory, instead of only
running from when I run startup.bat from the directory the servlet and
related classes are in.
Thanks,
M. Kaluzienski
www.networks-plus.net