commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dirk Verbeeck <dirk.verbe...@pandora.be>
Subject Re: Cannot create JDBC driver of class '' for connect URL 'null'
Date Mon, 03 Nov 2003 21:05:50 GMT

If you have a D:/Tomcat/webapps/NIMS.xml file then this configuration should 
work. I did a quick test on tomcat 4.1.27 and it worked for me.

This error "Cannot create JDBC driver of class '' for connect URL 'null' "
is a missing driverClassName. So probably your configuration is been loaded by 
tomcat.

Try the following jsp page to display the JNDI tree.
http://cvs.apache.org/~dirkv/builds/showJNDI.jsp

-- Dirk

Omkar Joshi wrote:
> Hi,
> 
> Am arunning application on tomcat 4.1.24
> 
> I want to use DBCP for my connection with oracle.
> I have created a .xml file for the application in weapps folder.
> 
> the code for the file is.
> 
> <Context className="org.apache.catalina.core.StandardContext" 
> path="/NIMS" docBase="D:/Tomcat/webapps/NIMS" debug="9" 
> reloadable="true" 
> mapperClass="org.apache.catalina.core.StandardContextMapper"
> displayName="NIMS">
> <Loader checkInterval="3"/>
> <Logger className="org.apache.catalina.logger.SystemOutLogger" 
> timestamp="true"/>
> <Resource name="jdbc/nims" auth="Container"
> type="javax.sql.DataSource"/>
> 
> <ResourceParams name="jdbc/nims">
> <parameter>
> <name>factory</name>
> <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
> </parameter>
> <parameter>
> <name>driverClassName</name>
> <value>oracle.jdbc.driver.OracleDriver</value>
> </parameter>
> <parameter>
> <name>url</name>
> <value>jdbc:oracle:thin:@172.16.16.22:1521:nims</value>
> </parameter>
> <parameter>
> <name>username</name>
> <value>nimsuser</value>
> </parameter>
> <parameter>
> <name>password</name>
> <value>nimsdata123</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>
> <parameter> <name>validationQuery</name> <value>select 1 from

> dual</value> </parameter> <parameter> <name>testOnBorrow</name>

> <value>true</value> </parameter>
> <parameter>
> <name>timeBetweenEvictionRunsMillis</name>
> <value>300000</value>
> </parameter>
> <parameter>
> <name>numTestsPerEvictionRun</name>
> <value>3</value>
> </parameter>
> <parameter>
> <name>minEvictableIdleTimeMillis</name>
> <value>1800000</value>
> </parameter>
> <parameter>
> <name>testWhileIdle</name>
> <value>true</value>
> </parameter>
> </ResourceParams>
> </Context>
> 
> 
> The entry in web.xml file is as follows,
> 
> resource-ref>
> <description>Oracle Datasource example</description>
> <res-ref-name>jdbc/nims</res-ref-name>
> <res-type>javax.sql.DataSource</res-type>
> <res-auth>Container</res-auth>
> </resource-ref>
> 
> 
> but when i call this connection in my jsp page
> 
> <%@ page import="java.sql.*" %>
> <%@ page import="javax.sql.*" %>
> <%@ page import="java.io.*" %>
> <%@ page import="java.rmi.*" %>
> <%@ page import="javax.naming.*" %>
> <%@ page import="javax.servlet.*" %>
> <%@ page import="javax.servlet.http.*" %>
> <html>
> <head>
> <title>Cable and Wireless</title>
> </head>
> 
> <body bgcolor="#FFFFFF" text="#000000" 
> onload="javascript:{if(parent.frames[0]&&parent.frames['topFrame'].Go)parent.frames['topFrame'].Go()}">

> 
> <%
> try
> {
> 
> Context initContext = new InitialContext();
> Context envContext = (Context)initContext.lookup("java:/comp/env");
> DataSource ds = (DataSource)envContext.lookup("jdbc/nims");
> Connection conn = ds.getConnection();
> 
> 
> 
> am getting error
> "Cannot create JDBC driver of class '' for connect URL 'null' "
> 
> help me



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message