tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dan Eriksson" <>
Subject [SOLVED] tomcat not able to connect to postgresql?
Date Thu, 10 Apr 2008 03:38:35 GMT
Hi Gabe,
Thanks for the fast answer!

-----Original Message-----
From: Gabe Wong []
Sent: Thu 4/10/2008 4:29 AM
To: Tomcat Users List
Subject: Re: tomcat not able to connect to postgresql?
Dan Eriksson wrote:
>> If I try to connect to my vhost now everything looks ok, no errors anywhere, but
when I try to login I get a message that the database is not online and in my logfile I see
>> org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class
'' for connect UR
>This has been discussed many times before. Usually adding the database 
>driver to $TOMCAT_HOME/lib or $TOMCAT_HOME/common/lib
>solves the problem.
>Also further information maybe found at the following URL from the 
>mailing list archive, which is a good way to search for previously 
>discussed issues and solutions:

Indeed, I missed that one.
Adding everything from my lib dir to common/lib didn't solve it though.

I went through the documentation again,
Under the postgresql there are two different configurations, first a generic resource that
can be shared, which was what I was trying, and one that is specific resource per vhost.
I re-made the configuration to be specific per vhost instead, so my vhost configuration looked
like this instead:

      <Host name="" appBase="webapps/myapp"
        unpackWARs="true" autoDeploy="true"
        xmlValidation="false" xmlNamespaceAware="false">

        <Context path="" docBase="" debug="0" reloadable="true">
              validationQuery="SELECT 1"
        <Valve className="org.apache.catalina.valves.AccessLogValve"
                 directory="logs"  prefix="vaxeladmin_access_log." suffix=".txt"
                 pattern="common" resolveHosts="false"/>

After doing this it started to work as it should.

But if someone can explain why the generic resource didn't work it would be greatly appreciated!

Best regards,

View raw message