tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ed Sykes" <esykes...@cogeco.ca>
Subject Re: Cannot create JDBC driver of class '' for connect URL 'null'
Date Mon, 15 Nov 2004 16:57:31 GMT
Hi Allistair,

Thanks for your quick response.
I just removed all the ResourceParam elements and it has no effect.

-Ed
----- Original Message ----- 
From: "Allistair Crossley" <Allistair.Crossley@QAS.com>
To: "Tomcat Users List" <tomcat-user@jakarta.apache.org>
Sent: Monday, November 15, 2004 11:51 AM
Subject: RE: Cannot create JDBC driver of class '' for connect URL 'null'


Ed,

Not sure if it will _cause_ it, but you need to remove ResourceParam 
elements, as it's all covered in Resource.

ADC

> -----Original Message-----
> From: Ed Sykes [mailto:esykes001@cogeco.ca]
> Sent: 15 November 2004 16:49
> To: tomcat-user@jakarta.apache.org
> Subject: Cannot create JDBC driver of class '' for connect URL 'null'
>
>
> Hi,
>
>
>
> I'm trying to setup DBCP with Tomcat 5.5.4 with Oracle 8.1.6
> using Java 1.5.0
>
>
>
> I've read FAQ, and the Jakarta How-To Docs:
>
> http://jakarta.apache.org/tomcat/tomcat-5.5-doc/jndi-datasourc
> e-examples-howto.html
>
>
>
> Everything works fine if I don't use connection pooling or
> JNDI lookups.
>
> i.e.,
>
>
>
> Class.forName(Connection_Info.JDBC_DRIVER);
>
> conn = DriverManager.getConnection(URL, USERNAME, PASSWORD);
>
> stmt = conn.createStatement();
>
>
>
> works fine.  So, Tomcat finds the Oracle JDBC driver fine.
>
>
>
> I'm getting the following error:
>
>
>
> Cannot create JDBC driver of class '' for connect URL 'null'
>
>
>
> Here's is the section I've added to
> C:\jakarta-tomcat-5.5.4\conf\server.xml
>
>
>
> <Context path="/ROOT/WEB-INF/classes"
> docBase="ROOT/WEB-INF/classes/JITS"
>
>         debug="5" reloadable="true" crossContext="true">
>
>
>
>    <Resource name="jdbc/myoracle" auth="Container"
>
>               type="javax.sql.DataSource"
> driverClassName="oracle.jdbc.driver.OracleDriver"
>
>               url="jdbc:oracle:thin:@newton.sheridanc.on.ca:1522:DB2"
>
>               username="jits" password="mypassword"
> maxActive="20" maxIdle="10"
>
>               maxWait="-1"/>
>
>
>
> <ResourceParams name="jdbc/myoracle">
>
>   <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:@newton.sheridanc.on.ca:1522:DB2</value>
>
>   </parameter>
>
>   <parameter>
>
>     <name>username</name>
>
>     <value>jits</value>
>
>   </parameter>
>
>   <parameter>
>
>     <name>password</name>
>
>     <value>mypassword</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>
>
>
>
>
>
>     </Context>
>
>
>
>
>
>
>
>
>
> Here's the contents of
> C:\jakarta-tomcat-5.5.4\webapps\ROOT\WEB-INF\web.xml
>
>
>
>
>
>     <servlet>
>
>         <servlet-name>JITS.ImageServer</servlet-name>
>
>         <servlet-class>JITS.ImageServer</servlet-class>
>
>     </servlet>
>
>
>
>   <servlet-mapping>
>
>         <servlet-name>JITS.ImageServer</servlet-name>
>
>         <url-pattern>/servlet/JITS.ImageServer</url-pattern>
>
>     </servlet-mapping>
>
>
>
>  <resource-ref>
>
>  <description>Oracle Datasource example</description>
>
>  <res-ref-name>jdbc/myoracle</res-ref-name>
>
>  <res-type>javax.sql.DataSource</res-type>
>
>  <res-auth>Container</res-auth>
>
> </resource-ref>
>
>
>
>
>
>
>
> In my java file ( ImageServer.java )  :
>
>
>
>
>
>         Context initContext = new InitialContext();
>
>         System.out.println("1 got an initial context from JNDI");
>
>
>
>         Context envContext =
> (Context)initContext.lookup("java:/comp/env");
>
>         System.out.println("2 got a context from JNDI");
>
>
>
>         DataSource ds =
> (DataSource)envContext.lookup("jdbc/myoracle");
>
>         System.out.println("3 got a datasource from JNDI");
>
>
>
>
>
>         Connection conn = ds.getConnection();
>
>         System.out.println("4 got a connection from the pool");
>
>
>
>
>
>
>
> OUTPUT:
>
> 1 got an initial context from JNDI
>
> 2 got a context from JNDI
>
> 3 got a datasource from JNDI
>
> org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create
> JDBC driver of class '' for connect URL 'null'
>
>         at
> org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(B
> asicDataSource.java:780)
>
>         at
> org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(Basi
> cDataSource.java:554)
>
>         at JITS.ImageServer.getImage(ImageServer.java:48)
>
>
>
>
>
> Any suggestions would be gratefully appreciated !
>
>
>
> Sincerely,
>
> Ed Sykes
>
>
>
>
>


<FONT SIZE=1 FACE="VERDANA,ARIAL" COLOR=BLUE>
-------------------------------------------------------
QAS Ltd.
Developers of QuickAddress Software
<a href="http://www.qas.com">www.qas.com</a>
Registered in England: No 2582055
Registered in Australia: No 082 851 474
-------------------------------------------------------
</FONT>


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


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


Mime
View raw message