You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Graham Leggett <mi...@sharp.fm> on 2004/06/17 18:29:01 UTC
Tomcat RPMs and database pools - no joy
Hi all,
I have a war that connects to a database pool defined in a Resource
section within server.xml. This war is run in a tomcat v5.0.19
environment as binary released by the jakarta project, and works 100%.
I now want to deploy the war inside a jpackage RPM version of tomcat on
my production server, and use the identical configurations for the
Resource section and war, but an attempt to start the application fails
like so:
javax.servlet.ServletException: Error initialising
za.co.fma.patricia.struts.PatriciaPlugin with configuration file at
'/usr/share/tomcat5/webapps/patricia/WEB-INF/torque.properties':
za.co.fma.patricia.PatriciaException: org.apache.torque.TorqueException:
org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC
driver of class '' for connect URL 'null', cause: No suitable driver
I tried the v5.0.24 RPM, and the same results were evident.
Googling for the above shows lots of questions, but no definitive
answers. Usually the problem goes away when the person with the problem
goes over the config. In my case I know my config works, because my test
environment is 100% functional. I am trying to work out what could be
different between my test environment and the final tomcat RPM file.
I have checked that the Postgresql driver is placed in common/lib in
both the test environment and the RPM environment.
In order for tomcat to install at all, I have forced it to ignore the
following three dependancies, as (to my knowledge) they are are included
in Sun's JDK v1.4.2 (and jpackage provides no compatibility packages to
fake these dependancies for JDK v1.4.x):
- [javamail].jar (is there already courtesy of Redhat supplied package,
but jpackage cannot find it)
- [jdbc-stdext].jar (part of v1.4.2, not present in Jakarta's official
tomcat release)
- [jndi].jar (part of v1.4.2, not present in Jakarta's official tomcat
release)
Has anybody got database pools and the tomcat5 RPM to work properly
together, and was there anything you needed to do over and above the
normal Resource configuration?
The config for server.xml looks like this:
<!-- Global JNDI resources -->
<GlobalNamingResources>
<Resource name="jdbc/GlobalPatricia" auth="Container"
type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/GlobalPatricia">
<parameter>
<name>factory</name>
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
</parameter>
<parameter>
<name>driverClassName</name>
<value>org.postgresql.Driver</value>
</parameter>
<parameter>
<name>url</name>
<value>jdbc:postgresql://127.0.0.1:5432/patricia</value>
</parameter>
<parameter>
<name>username</name>
<value>xxx</value>
</parameter>
<parameter>
<name>password</name>
<value>xxx</value>
</parameter>
<parameter>
<name>maxActive</name>
<value>20</value>
</parameter>
<parameter>
<name>maxIdle</name>
<value>10</value>
</parameter>
<parameter>
<name>maxWait</name>
<value>-1</value>
</parameter>
</ResourceParams>
</GlobalNamingResources>
The config for <warfile>.xml looks like this:
<Context path="/patricia" docBase="patricia" >
<Valve className="org.apache.catalina.valves.RemoteAddrValve"
allow="127.0.0.1"/>
<Logger className="org.apache.catalina.logger.FileLogger"
prefix="localhost_patricia_log." suffix=".txt"
timestamp="true"/>
<ResourceLink name="jdbc/GlobalPatricia" global="jdbc/GlobalPatricia"
type="javax.sql.DataSource"/>
<Realm className="org.apache.catalina.realm.DataSourceRealm" debug="0"
dataSourceName="jdbc/GlobalPatricia"
userTable="person" userNameCol="uid" userCredCol="user_password"
userRoleTable="company_person" roleNameCol="serial"/>
</Context>
Can anyone shed some light?
Regards,
Graham
--
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org