Also,

After reconfiguring, I seem to be getting this error too, now. For which a 
cursory search on Google seems to reveal many cases of this happening with 
various DB drivers, as well as different versions of Tomcat, from most recent 
to the 5x series.
But no real solution found yet within those posts/forums. Still looking though.



javax.servlet.ServletException: org.apache.tomcat.dbcp.dbcp.SQLNestedException: 
Cannot create JDBC driver of class '' for connect URL 'null'
        
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:862)
        
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:791)
        
org.apache.jsp.chngctrl.change_005fctrl_005frslts_005fcondensed3_jsp._jspService(change_005fctrl_005frslts_005fcondensed3_jsp.java:364)
        org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
        org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
        org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:717)


root cause 

org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of 
class '' for connect URL 'null'
        
org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1150)
        
org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
        
org.apache.jsp.chngctrl.change_005fctrl_005frslts_005fcondensed3_jsp._jspService(change_005fctrl_005frslts_005fcondensed3_jsp.java:183)
        org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
        org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
        org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:717)


root cause 

java.lang.NullPointerException
        sun.jdbc.odbc.JdbcOdbcDriver.getProtocol(JdbcOdbcDriver.java:507)
        sun.jdbc.odbc.JdbcOdbcDriver.knownURL(JdbcOdbcDriver.java:476)
        sun.jdbc.odbc.JdbcOdbcDriver.acceptsURL(JdbcOdbcDriver.java:307)
        java.sql.DriverManager.getDriver(DriverManager.java:253)
        
org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1143)
        
org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
        
org.apache.jsp.chngctrl.change_005fctrl_005frslts_005fcondensed3_jsp._jspService(change_005fctrl_005frslts_005fcondensed3_jsp.java:183)
        org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
        org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
        org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
 

-----Original Message-----
From: Propes, Barry L [GCG-NAOT] 
Sent: Thursday, February 25, 2010 2:46 PM
To: 'Tomcat Users List'
Subject: RE: DB connection error -Tomcat 6 config

Sorry for the delay - supplying both my META-INF/context.xml and 
webapps/WEB-INF/web.xml contents.


Should be noted: for the factory type in the params below, I tried both 
factory="org.apache.commons.dbcp.BasicDataSourceFactory" and 
factory="org.apache.dbcp.BasicDataSourceFactory", each to no avail.

I removed the commons ref to test out since there's no commons/lib dir in TC 
6.0.24, unlike in TC 4.1.31

Please apprise if the error is glaring here and I just can't see it. That's 
certainly possible!

Thanks, Chuck.


context.xml in META-INF fldr
---------<?xml version="1.0" encoding="UTF-8"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<Context>
  <!-- omitting - factory="oracle.jdbc.pool.OracleDataSourceFactory" below--> 
<Resource name="jdbc/myoracle" 
auth="Container" 
type="javax.sql.DataSource"
factory="org.apache.commons.dbcp.BasicDataSourceFactory"
 maxActive="125" 
 maxIdle="15" 
 maxWait="7000"
 removeAbandoned="true"
 removeAbandonedTimeout="30"
 logAbandoned="true"
username="user_name" 
password="pass_word" 
driverClassName="oracle.jdbc.OracleDriver"
url="jdbc:oracle:thin:@159.177.102.100:1526:MYSID"
minEvictableIdleTimeMillis="5000"
timeBetweenEvictionRunsMillis = "10000"
testWhileIdle="true"
/>
</Context>


in webapps/WEB-INF/web.xml

<resource-ref>
<description>My Ora datasource</description> 
<res-ref-name>jdbc/myoracle</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>

-----Original Message-----
From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com]
Sent: Tuesday, February 23, 2010 5:53 PM
To: Tomcat Users List
Subject: RE: DB connection error -Tomcat 6 config

If you don't mind, post your <Context> element again.  The error message 
indicates something doesn't match between what your JSP/servlet is requesting 
and what's registered via the <Resource> element.

 - Chuck


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to