Discussions

Web tier: servlets, JSP, Web frameworks: Sql exception while starting tomcat as windows NT service-urgent

  1. hi ,

         I have succefully set up tomcat as an
    windows NT service .
         But i am facing some problems,the probem
    is : I am not able to get database connection
    when i start tomcat as a service .I am using
    windows 2000 professional.

         The sql error that i get is
       Data source name not found and no default driver
    specified .

         When is start it manually ie, with starup command
    from dos prompt , every thing works fine .
          
          kindly reply me back at your earliest .

       Thanks,
      Subroto Dutta,
      Global E-Softsys India pvt.ltd .
  2. Check your classpath. probably is your jdbc driver jarfile, which is in the batch file you execute in the "dos prompt" is missing from the system classpath or the classpath which the NT Service is missing..

  3. Can you please elaborate .
    My classpath is perfect.
    From command prompt i start tomcat as follows :
     d:\tomcat\bin:>startup
     
    Everthing works fine and i dont get any connection error
    in this way .

    Problem starts when i go to NT service page and start
    tomcat as service .I get the error .

    Pls give your suggestions.

    thanks
  4. Don't run it as a service.
  5. if you are typing "startup" from tomcat.. you are executing a batch file startup.bat or startup.cmd. see what is the classpath you are setting in that..

    you may have something like..

    SET CLASSPATH=C:\Oracle8.x\jdbc\classes12.zip

    and that is why you are able to get it running from the prompt. And that setting is not available for your NT Service. Anyway, for development and testing, it is better you are not running it as NT Service. you may need to restart your tomcat too often, and also may be helpful if you are able to see the output on standard out (console).
  6. Check your classpath. probably it is becoz your jdbc driver jarfile, which is in the batch file ( you execute in the "dos prompt"), is missing from the system classpath or the classpath which the NT Service is using..