Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Running Tomcat as service; JDBC not working now

 
Kristy McClure
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Kristy McClure
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also, here's my pertinent path and classpath info:
 
Kristy McClure
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5040
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic