*
The moose likes Servlets and the fly likes Running Tomcat as service; JDBC not working now Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Running Tomcat as service; JDBC not working now" Watch "Running Tomcat as service; JDBC not working now" New topic
Author

Running Tomcat as service; JDBC not working now

Kristy McClure
Greenhorn

Joined: Jun 19, 2001
Posts: 13
I have a nice JSP-Beans-Oracle web app written, which functioned well under Tomcat3.2/NT4/IIS4/JDK1.3.1. Then I discovered that I would need to run Tomcat as a service, so I used JavaService (www.alexandriasc.com), which worked well. However, now when I start the Tomcat service and try to run my web app, I get this error in my Tomcat logs\stderr.log:

I get this in stdout.log:

The same webapp worked perfectly when I wasn't running Tomcat as a service.
I read somewhere something about having to make the jdbc driver a service also, but I am unable to find any information about this now. Can someone assist me with this problem?


pardon me, but you've obviously mistaken me for someone who gives a damn...
Kristy McClure
Greenhorn

Joined: Jun 19, 2001
Posts: 13
Also, here's my pertinent path and classpath info:
Kristy McClure
Greenhorn

Joined: Jun 19, 2001
Posts: 13
OK, I found my own solution, which probably applies to any service wrapper for Tomcat. At least for JavaService, there is a batch file that is used to install Tomcat as a service. I needed to add my jdbc drivers into the batch file, even though they were already in my system's classpath. Here's my amended batch file for JavaService:
@echo off
echo --------
echo Usage: %0 jdk_home tomcat_home (classic/hotspot/server)
echo NOTE: You MAY NOT use spaces in the path names. If you know how
echo to fix this, please tell me.
echo JDK 1.3 does not come with hotpot server by default, you must
echo install this seperately if you wish to use it.
echo Example: %0 c:\progra~1\jdk c:\progra~1\tomcat hotspot
echo --------
if "%1" == "" goto eof
if "%2" == "" goto eof
if "%3" == "" goto eof
copy JavaService.exe %2\bin\Tomcat.exe > nul
%2\bin\Tomcat.exe -install Tomcat %1\jre\bin\%3\jvm.dll -Djava.class.path=%2\lib\webserver.jar;%2\lib\jasper.jar;%2\lib\jaxp.jar;%2\lib\parser.jar;%2\lib\ant.jar;%2\lib\servlet.jar;%1\lib\tools.jar;d:\Oracle\Ora81\jdbc\lib\classes12. zip;d:\Oracle\Ora81\jdbc\lib\nls_charset12.zip -Dtomcat.home=%2 -start org.apache.tomcat.startup.Tomcat -params -config %2\conf\server.xml -stop org.apache.tomcat.startup.Tomcat -params -stop -config %2\conf\server.xml -out %2\logs\stdout.log -err %2\logs\stderr.log
goto eof
:eof
Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040

nice that you found a solution.
...even though they were already in my system's classpath....
I guess you learnt the hard way that Tomcat doesn't
use the system classpath.
regds.
- satya

Take a Minute, Donate an Hour, Change a Life
http://www.ashanet.org/workanhour/2006/?r=Javaranch_ML&a=81
 
Don't get me started about those stupid light bulbs.
 
subject: Running Tomcat as service; JDBC not working now
 
Similar Threads
what should i do?
tomcat not running??
Tomcat on the MAc - HELP
what happens after startup ?
startup.bat