I've tried to port my webapp from Tomcat 5.0.18 on Windows 2000 to Tomcat 5.5 on Windows 2003 server, with jdk1.5.
I get this error: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'
I set the datasource inside server.xml:
<Context ...>
<Resource name="jdbc/glprod" auth="Container" type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/glprod">
<parameter>
<name>url</name>
<value>jdbc:oracle:thin:@sunlander:1521:GLTEST</value>
</parameter>
<parameter>
<name>maxIdle</name>
<value>10</value>
</parameter>
<parameter>
<name>maxActive</name>
<value>10</value>
</parameter>
<parameter>
<name>driverClassName</name>
<value>oracle.jdbc.driver.OracleDriver</value>
</parameter>
<parameter>
<name>maxWait</name>
<value>10000</value>
</parameter>
<parameter>
<name>username</name>
<value>GL_DYNAMO</value>
</parameter>
<parameter>
<name>factory</name>
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
</parameter>
<parameter>
<name>minIdle</name>
<value>2</value>
</parameter>
<parameter>
<name>password</name>
<value>GL_DYNAMO</value>
</parameter>
</ResourceParams>
</Context>
This works on Tomcat 5.0, but it seems that doesn't works with Tomcat 5.5. Why?
What is the correct place of jdbc driver?
WEB-INF/lib or common/lib?
Thanks all
-
Error configuring JNDI DataSource (5 messages)
- Posted by: Aldo Funicelli
- Posted on: March 07 2005 08:27 EST
Threaded Messages (5)
- Error configuring JNDI DataSource by Paul Morie on March 07 2005 22:48 EST
- Error configuring JNDI DataSource by Aldo Funicelli on March 08 2005 03:39 EST
- Tomcat JXM by Jean-Pol Landrain on March 15 2005 11:52 EST
- Error configuring JNDI DataSource by Aldo Funicelli on March 08 2005 03:39 EST
- Failed Configuring Oracle 10G JNDI Datasource in Tomcat 5.5 by C C on June 19 2005 22:57 EDT
- Error configuring JNDI DataSource by John Chan on November 17 2005 13:30 EST
-
Error configuring JNDI DataSource[ Go to top ]
- Posted by: Paul Morie
- Posted on: March 07 2005 22:48 EST
- in response to Aldo Funicelli
Hi Aldo,
I believe the driver class needs to be in $CATALINA_HOME/common/lib for the tomcat-level JNDI datasource stuff to work. If you put it there, your application should be able to see it, too.
HTH,
P -
Error configuring JNDI DataSource[ Go to top ]
- Posted by: Aldo Funicelli
- Posted on: March 08 2005 03:39 EST
- in response to Paul Morie
Thanks, now it works.
I use the syntax:
<Context>
.....
<Resource name="jdbc/glprod" type="javax.sql.DataSource" password="YYYYY" driverClassName="oracle.jdbc.driver.OracleDriver" maxIdle="2" maxWait="5000" username="XXXXX" url="jdbc:oracle:thin:@128.3.128.60:1521:GLTEST" maxActive="4"/>
</Context>
Another question about monitoring/management:
I have to set, to enable remote management the property
com.sun.management.jmxremote.port=portNum
But tomcat doesn't start ... on event viewer I find this message
The Apache Tomcat service terminated unexpectedly. It has done this 7 time(s).
If I set com.sun.management.jmxremote (for local management) Tomcat starts, but I can't see nothig to manage (with JConsole as example).
Any suggests? -
Tomcat JXM[ Go to top ]
- Posted by: Jean-Pol Landrain
- Posted on: March 15 2005 11:52 EST
- in response to Aldo Funicelli
Another question about monitoring/management:I have to set, to enable remote management the property com.sun.management.jmxremote.port=portNum
I have a similar problem and haven't been able to find a solution so far. I try to connect to MC4J to Tomcat 5.5.4 on Windows XP with J2SE 5.0 Update 1.
But tomcat doesn't start
Any help would be really appreciated. -
Failed Configuring Oracle 10G JNDI Datasource in Tomcat 5.5[ Go to top ]
- Posted by: C C
- Posted on: June 19 2005 22:57 EDT
- in response to Aldo Funicelli
I am trying to setup an oracle JNDI datasource in Tomcat 5.5 but I get the following error when creating the datasource :
SQLNestedException
SQLException: No suitable Driver
DriverManager.getDriver
BasicDataSource.createDataSource
I already downloaded ojdbc14.jar and placed them in the \common\lib directory but the problem still occurs.
I also tried to include the code
Class.forName("oracle.jdbc.driver.OracleDriver");
before creating the datasource but an error still occurs, though at that time the error was different, something about acceptsURL.
I suspect the ojdbc14.jar I am using only works for jdk1.4, does someone know where I can get an Oracle 10g JDBC Driver for j2sdk 1.5?
But when I run the code using the jar in a standard java application it works. I used the following code
OracleDataSource dsrc = new OracleDataSource();
dsrc.setDriverType("thin");
dsrc.setServerName("<server>");
dsrc.setDatabaseName("AIX");
dsrc.setPortNumber(1521);
dsrc.setUser("<username>");
dsrc.setPassword("<password>");
con = dsrc.getConnection();
Does anyone know of a solution? Thanks in advance. -
Error configuring JNDI DataSource[ Go to top ]
- Posted by: John Chan
- Posted on: November 17 2005 13:30 EST
- in response to Aldo Funicelli
Ok, I may be a bit late on this but it seems that in Tomcat 5.5, the way you configure your context.xml has changed. This is what I had for 4.1. I don't know about 5.0 but from the original post, it looks like the same as 4.1.
<Context debug="0" docBase="/blah" path="/blah" reloadable="true">
<!-- Development Database -->
<Resource name="jdbc/blahdb" auth="Container" type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/blahdb">
<parameter>
<name>username</name>
<value>johndoe</value>
</parameter>
<parameter>
<name>password</name>
<value>johndoepw</value>
</parameter>
<parameter>
<name>driverClassName</name>
<value>oracle.jdbc.driver.OracleDriver</value>
</parameter>
<parameter>
<name>url</name>
<value>jdbc:oracle:thin:@db.fubar.com:1521:db</value>
</parameter>
</ResourceParams>
</Context>
in 5.5 is:
<Context debug="0" docBase="/blah" path="/blah" reloadable="true">
<!-- Development Database -->
<Resource name="jdbc/blahdb" auth="Container"
type="javax.sql.DataSource"
driverClassName="oracle.jdbc.driver.OracleDriver"
url="jdbc:oracle:thin:@db.fubar.com:1521:fubar"
user="johndoe"
password="johndoepw"/>
</Context>
Also, I found that in going from 4.0 to 4.1, username became user, and driverName became url.
This post is not based on any expertise, just a lot of head banging on wall trial and error.
Regards,
John