Unoffical empeg BBS

Quick Links: Empeg FAQ | RioCar.Org | Hijack | BigDisk Builder | jEmplode | emphatic
Repairs: Repairs

Topic Options
#135585 - 16/01/2003 08:53 Tomcat question... Need a little help...
lopan
old hand

Registered: 28/01/2002
Posts: 970
Loc: Manassas VA
I realize way off topic... but hey, thats why I'm posting here right?

Anyway I have an IIS server which is being set up to work along with tomcat. That configuration is good working (kinda), the deal is Tomcat will not run via Win2k services, you start it, it says it's started but doesn't compile the .jsp pages I'm sending it. It works perfectly if I start tomcat via command line, however being that this is for a demo I need it to be pretty and run through the Services of Win2k. Could this be a java issue? It works fine on a different machine that was configured correctly from the start, however the machine in question has the java runtime environment as well as the jdk... would it make a difference to just remove the runtime environment?
_________________________
Brett 60Gb MK2a with Led's

Top
#135586 - 16/01/2003 09:02 Re: Tomcat question... Need a little help... [Re: lopan]
tonyc
carpal tunnel

Registered: 27/06/1999
Posts: 7058
Loc: Pittsburgh, PA
It is an amazing coincidence that you bring this up right now. Last night I started a graduate course where we needed to install and use Tomcat. I had an old Tomcat install lying around but wanted to start fresh, since I'll be sharing it with a few team members, and wanted to get a current version (I downloaded 4.1.18 I think.) And I ran into a similar problem, being unable to run JSP's.

If you can't compile JSP's, chances are you don't have "tools.jar" (from the JDK lib directory) in your classpath. I tried many different methods for getting the directory where it's located into my classpath, but eventually I ended up just copying tools.jar from the JDK lib directory into <Tomcat Root>/common/lib, since any JAR files in that directory are automatically loaded into the classpath on startup.

Once I did this, I was able to run JSP's, and start it as a service. Your mileage may vary, but I was thinking maybe in some kind of cosmic coincidence it's the same problem.
_________________________
- Tony C
my empeg stuff

Top
#135587 - 16/01/2003 09:32 Re: Tomcat question... Need a little help... [Re: tonyc]
lopan
old hand

Registered: 28/01/2002
Posts: 970
Loc: Manassas VA
cool... I moved tools.jar to a directory listed in the classpath and fixed it right up.... Thanks, now they want me to diagnose why I have to go through those steps.

But yeah strange coincidence... I love this board!
_________________________
Brett 60Gb MK2a with Led's

Top
#135588 - 16/01/2003 09:39 Re: Tomcat question... Need a little help... [Re: lopan]
tonyc
carpal tunnel

Registered: 27/06/1999
Posts: 7058
Loc: Pittsburgh, PA
now they want me to diagnose why I have to go through those steps.

Why you need tools.jar to be in the classpath? That's easy. JSP's are compiled on demand, and the JVM needs to use Sun classes to do that. So it invokes various classes under the com.sun.tools.javac.*, which are included in tools.jar.
_________________________
- Tony C
my empeg stuff

Top
#135589 - 16/01/2003 09:48 Re: Tomcat question... Need a little help... [Re: tonyc]
lopan
old hand

Registered: 28/01/2002
Posts: 970
Loc: Manassas VA
Understood, but they want to know why it works fine on one box and I have the other issues on the other box. I noticed that the box in question had no pointers to the lib directory.... Neither did the box that works correctly. So does tomcat generate it's own set of classpaths at start up? If so where is that configuration contained? The only difference in the boxes is one has oracle thrown in the mix which does have it's own class paths for java.
_________________________
Brett 60Gb MK2a with Led's

Top
#135590 - 16/01/2003 09:54 Re: Tomcat question... Need a little help... [Re: lopan]
tonyc
carpal tunnel

Registered: 27/06/1999
Posts: 7058
Loc: Pittsburgh, PA
Hmm, that one I can't answer. I do know, however, that regardless of what CLASSPATH environment settings you have, Tomcat automatically loads any JAR files that it finds under common/lib. Like the Servlet API (servlet.jar) the XML parsing libs, etc. If somehow one of the boxes is picking up tools.jar via the system or user environment classpath, then you wouldn't have to copy it into the common/lib directory. But my attempts last night to just add the path to tools.jar to my CLASSPATH variables didn't yield successful JSP compilation, I had to copy it into common/lib. That tells me that Tomcat is basically ignoring my CLASSPATH settings and using some other mechanism for defining the class path. Haven't read enough to find out what that mechanism is, though.
_________________________
- Tony C
my empeg stuff

Top
#135591 - 16/01/2003 09:59 Re: Tomcat question... Need a little help... [Re: tonyc]
lopan
old hand

Registered: 28/01/2002
Posts: 970
Loc: Manassas VA
Well thanks anyway... You've definately steered me in the right direction here. I'll post what I find...
_________________________
Brett 60Gb MK2a with Led's

Top
#135592 - 16/01/2003 15:59 Re: Tomcat question... Need a little help... [Re: lopan]
mcomb
pooh-bah

Registered: 31/08/1999
Posts: 1649
Loc: San Carlos, CA
IIRC you need to define JAVA_HOME which is an environment variable that is supposed to point to your jdk directory. Off the top of my head I don't remember how to do that under windows, but once you get that setup tomcat should be able to find the tools.jar and any thing else provided by the jdk that it may need later.

-Mike
_________________________
EmpMenuX - ext3 filesystem - Empeg iTunes integration

Top
#135593 - 16/01/2003 18:04 Re: Tomcat question... Need a little help... [Re: lopan]
Dignan
carpal tunnel

Registered: 08/03/2000
Posts: 12341
Loc: Sterling, VA
Am I the only one who didn't know what Tomcat was and thought this was going to be a very personal question?
_________________________
Matt

Top
#135594 - 16/01/2003 19:21 Re: Tomcat question... Need a little help... [Re: mcomb]
tonyc
carpal tunnel

Registered: 27/06/1999
Posts: 7058
Loc: Pittsburgh, PA
FWIW, setting JAVA_HOME wasn't enough for my Tomcat install, as I did have it set, yet it didn't find tools.jar.

You know, with all the various installation, configuration, and general stability issues I've encountered in various application servers (Netscape, iPlanet, WebSphere, and Tomcat) I'm starting to wonder if Microsoft has it right after all... Someone please put me out of my misery before I go over to the dark side...
_________________________
- Tony C
my empeg stuff

Top
#135595 - 16/01/2003 19:40 Re: Tomcat question... Need a little help... [Re: tonyc]
wfaulk
carpal tunnel

Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
Well, you are running it under Windows, where it wasn't initially designed to work. It's more-or-less trivial under any Unix.

Or maybe you're not using it under Windows -- I assume because you were offering constructive help to someone who was.

Anyway, you're right to at least some extent that Java involves a good amount of magic, at least when it comes to classpath-type issues.
_________________________
Bitt Faulk

Top
#135596 - 16/01/2003 22:45 Re: Tomcat question... Need a little help... [Re: tonyc]
mcomb
pooh-bah

Registered: 31/08/1999
Posts: 1649
Loc: San Carlos, CA
FWIW, setting JAVA_HOME wasn't enough for my Tomcat install

Yeah, I just reread the original post and realized that probably has nothing to do with it since it does work for him when he starts it from the command shell. Sounds like some weird windows thing where the environment variables aren't getting passed to services. You could test that theory by setting JAVA_HOME and any classpath you need from the batch script that starts tomcat. Beyond that I have no idea as I have never tried to use windows for a server.

-Mike
_________________________
EmpMenuX - ext3 filesystem - Empeg iTunes integration

Top
#135597 - 17/01/2003 06:39 Re: Tomcat question... Need a little help... [Re: mcomb]
lopan
old hand

Registered: 28/01/2002
Posts: 970
Loc: Manassas VA
In reply to:

Sounds like some weird windows




I've about come to that conclusion, everything is set right, everything is configured exactly as the functional machine... I got it working by copying tools.jar to the root of JAVA_HOME, and it works fine. I searched high and low for an answer and found a few links about tomcat bugs in windows. So.. I'm passing it off as a glitchy bug thing.
_________________________
Brett 60Gb MK2a with Led's

Top
#135598 - 17/01/2003 11:44 Re: Tomcat question... Need a little help... [Re: lopan]
klaruz
journeyman

Registered: 19/11/2002
Posts: 55
Loc: Omaha, NE
You may want to check out:

HKEY_LOCAL_MACHINE\ SYSTEM\ CurrentControlSet\ Services\ {SERVICE_NAME}\ Parameters

You can change the vars that get passed to java via an nt service that way. I use it to change the amount of ram I give tomcat on our clusters, along with a few other details. You should be able to pass a class path variable to tomcat with it, since it doesn't appear to pick up your global (local maybe?) variables.

See this page for more info:


http://www.alexandriasc.com/software/JavaService/documentation.html

Top
#135599 - 17/01/2003 11:54 Re: Tomcat question... Need a little help... [Re: klaruz]
lopan
old hand

Registered: 28/01/2002
Posts: 970
Loc: Manassas VA
Thanks a lot! That little gem was EXTREMELY helpful....
_________________________
Brett 60Gb MK2a with Led's

Top