Tomcat 5 - Cannot load JDBC driver class 'null' SQL state: null
A solution to this problem would be greatly appreciated. I have now spent over 10 hours investigating this problem, and still have no solution. We have installed Tomcat 5 and the latest MySQl ConnectorJ driver on 3 different platforms, and experience this annoying, what seems to be common problem, yet no solution with Tomcat 5. I have configured, re-configured, followed discussion forems (mainly related to Tomcat 4). The mysql connectorJ jar file is in $CATALINA/common/lib like stated at http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasource-examples-howto.html . There something not documented or clear in the docs, as many people are having this issue. Here is the SQLException Error: java.sql.SQLException: Cannot load JDBC driver class 'null' SQL state: null Here is a snap shot of the server.xml file: GlobalNamingResources Environment description=Absolute Pathname of the JWSDP Installation name=jwsdp.home override=true type=java.lang.String value=C:\jwsdp-1.3/ Environment name=simpleValue override=true type=java.lang.Integer value=30/ !-- Editable user database that can also be used by UserDatabaseRealm to authenticate users -- Resource name=UserDatabase auth=Container type=org.apache.catalina.UserDatabase description=User database that can be updated and saved /Resource ResourceParams name=UserDatabase parameter namefactory/name valueorg.apache.catalina.users.MemoryUserDatabaseFactory/value /parameter parameter namepathname/name valueconf/tomcat-users.xml/value /parameter /ResourceParams Context path=/AuthorizedTest docBase=AuthorizedTest debug=5 reloadable=true crossContext=true Logger className=org.apache.catalina.logger.FileLogger prefix=localhost_DBTest_log. suffix=.txt timestamp=true/ Resource name=jdbc/AuthorizedTest auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/AuthorizedTest parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter !-- Maximum number of dB connections in pool. Make sure you configure your mysqld max_connections large enough to handle all of your db connections. Set to 0 for no limit. -- parameter namemaxActive/name value100/value /parameter !-- Maximum number of idle dB connections to retain in pool. Set to 0 for no limit. -- parameter namemaxIdle/name value30/value /parameter !-- Maximum time to wait for a dB connection to become available in ms, in this example 10 seconds. An Exception is thrown if this timeout is exceeded. Set to -1 to wait indefinitely. -- parameter namemaxWait/name value1/value /parameter !-- MySQL dB username and password for dB connections -- parameter nameusername/name valuelocal_local/value /parameter parameter namepassword/name valuewalkon03/value /parameter !-- Class name for mm.mysql JDBC driver -- parameter namedriverClassName/name valuecom.mysql.jdbc.Driver/value /parameter !-- The JDBC connection url for connecting to your MySQL dB. The autoReconnect=true argument to the url makes sure that the mm.mysql JDBC Driver will automatically reconnect if mysqld closed the connection. mysqld by default closes idle connections after 8 hours. -- parameter nameurl/name valuejdbc:mysql://www.local-underground.com:3306/local_maillist?autoReconnect=true/value /parameter /ResourceParams /Context /GlobalNamingResources Here is a snap shot of our WEB-INF/web.xml file: resource-ref descriptionDB Connection/description res-ref-namejdbc/AuthorizedTest/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref Does anyone have a successful Tomcat 5 and MySQL Connector J configuration? In desparate need of the correct configuration. Thanks all. chris _ Make your home warm and cozy this winter with tips from MSN House Home. http://special.msn.com/home/warmhome.armx - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cannot load jdbc driver class 'null'
We are using the tomcat 4.1.24 and the j2sdk1.4.2_02. The jdbc- driver we use is 'mysql-connector-java-3.0.8-stable-bin.jar' As database we use mysql Version 3.23.58-nt. When we call the web-service we get the message cannot load jdbc driver class 'null' . Who can help? Here is an extract of the Server.xml we use Context className=org.apache.catalina.core.StandardContext cachingAllowed=true charsetMapperClass=org.apache.catalina.util.CharsetMapper cookies=true crossContext=false debug=0 displayName=Apache-Axis docBase=\axis mapperClass=org.apache.catalina.core.StandardContextMapper path=/sf/1_00 privileged=false reloadable=false swallowOutput=false useNaming=true wrapperClass=org.apache.catalina.core.StandardWrapper Logger className=org.apache.catalina.logger.FileLogger debug=3 directory=logs prefix=sf_logger. suffix=.txt timestamp=true verbosity=1/ Resource auth=Container description=Resource reference to a factory for java.sql.Connection instances that my be used for talking to a particular database that is configured in the server.xml file. name=jdbc/testDB scope=Shareable type=javax.sql.DataSource/ ResourceParams name=jdbc/testDB parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter parameter namedriverClassName/name valueorg.gjt.mm.mysql.Driver/value /parameter parameter nameurl/name valuejdbc:mysql://localhost/test/value -- /parameter parameter nameusername/name valueroot/value /parameter parameter namepassword/name value/value /parameter parameter namemaxActive/name value8/value /parameter parameter namemaxIdle/name value4/value /parameter parameter namemaxWait/name value-1/value /parameter parameter nameremoveAbandoned/name valuetrue/value /parameter parameter nameremoveAbandonedTimeout/name value60/value /parameter parameter namelogAbandoned/name valuetrue/value /parameter /ResourceParams /Context here is the extract of the web.xml we use resource-ref description.../description res-ref-namejdbc/testDB/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref Any help would be great. Thanks Ralf - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: java.sql.SQLException: Cannot load JDBC driver class 'null'
Hi Jason, I tried as u said. But same exception is getting. I am using tomcat4.1.27, sqlserver 2000. can u send me ur connection pooling code. Thank you. vijay --- El Toro [EMAIL PROTECTED] wrote: Where are your jdbc for sql server jars? Put all three under /%TOMCAT_HOME%/common/lib. Also, your factoryClassName should be: factoryClassName=org.apache.naming.factory.ResourceFactory I'm currently using connection pooling with sql server and thats the only things i can see that might cause you problems. Also, make sure you don't have any duplicate entries for the jdbc for sql server jars in your classpath. Hope That Helps, Jason --- vijaya prasad pala [EMAIL PROTECTED] wrote: Hi, From one week i am trying to solve this problem. Please any one help me. if i am connection directly its ok. but if i am using connection pooling this exception is comming. my connection pooling syntax in server.xml is -- Resource name=jdbc/edmsCP auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/edmsCP parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter parameter namedriverClassName/name valuecom.microsoft.jdbc.sqlserver.SQLServerDriver/value /parameter parameter nameurl/name valuejdbc:microsoft:sqlserver://vijay2k:1433;databasename=eDMS/value /parameter parameter nameusername/name valuesa/value /parameter parameter namepassword/name valuesa/value /parameter parameter namemaxActive/name value20/value /parameter parameter namemaxIdle/name value10/value /parameter parameter namemaxWait/name value-1/value /parameter /ResourceParams - web.xml --- ?xml version=1.0 encoding=ISO-8859-1? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd; web-app resource-ref res-ref-namejdbc/edmsCP/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref /web-app --- Here is my code.. --- public Connection getConnection() { Connection conn = null; try { Context initCtx = new InitialContext(); Context envCtx = (Context) initCtx.lookup(java:comp/env); if(envCtx == null ) throw new Exception(No Context); else System.out.println(Context Ok - + envCtx); DataSource ds = (DataSource) envCtx.lookup(jdbc/edmsCP); System.out.println(DataSource - + ds); if (ds != null) conn = ds.getConnection(); } catch(Exception ex) { System.out.println(ex.getMessage()); //ex.printStackTrace(); }finally { return conn; } } --- __ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
java.sql.SQLException: Cannot load JDBC driver class 'null'
Hi, From one week i am trying to solve this problem. Please any one help me. if i am connection directly its ok. but if i am using connection pooling this exception is comming. my connection pooling syntax in server.xml is -- Resource name=jdbc/edmsCP auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/edmsCP parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter parameter namedriverClassName/name valuecom.microsoft.jdbc.sqlserver.SQLServerDriver/value /parameter parameter nameurl/name valuejdbc:microsoft:sqlserver://vijay2k:1433;databasename=eDMS/value /parameter parameter nameusername/name valuesa/value /parameter parameter namepassword/name valuesa/value /parameter parameter namemaxActive/name value20/value /parameter parameter namemaxIdle/name value10/value /parameter parameter namemaxWait/name value-1/value /parameter /ResourceParams - web.xml --- ?xml version=1.0 encoding=ISO-8859-1? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd; web-app resource-ref res-ref-namejdbc/edmsCP/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref /web-app --- Here is my code.. --- public Connection getConnection() { Connection conn = null; try { Context initCtx = new InitialContext(); Context envCtx = (Context) initCtx.lookup(java:comp/env); if(envCtx == null ) throw new Exception(No Context); else System.out.println(Context Ok - + envCtx); DataSource ds = (DataSource) envCtx.lookup(jdbc/edmsCP); System.out.println(DataSource - + ds); if (ds != null) conn = ds.getConnection(); } catch(Exception ex) { System.out.println(ex.getMessage()); //ex.printStackTrace(); }finally { return conn; } } --- __ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: java.sql.SQLException: Cannot load JDBC driver class 'null'
Where are your jdbc for sql server jars? Put all three under /%TOMCAT_HOME%/common/lib. Also, your factoryClassName should be: factoryClassName=org.apache.naming.factory.ResourceFactory I'm currently using connection pooling with sql server and thats the only things i can see that might cause you problems. Also, make sure you don't have any duplicate entries for the jdbc for sql server jars in your classpath. Hope That Helps, Jason --- vijaya prasad pala [EMAIL PROTECTED] wrote: Hi, From one week i am trying to solve this problem. Please any one help me. if i am connection directly its ok. but if i am using connection pooling this exception is comming. my connection pooling syntax in server.xml is -- Resource name=jdbc/edmsCP auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/edmsCP parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter parameter namedriverClassName/name valuecom.microsoft.jdbc.sqlserver.SQLServerDriver/value /parameter parameter nameurl/name valuejdbc:microsoft:sqlserver://vijay2k:1433;databasename=eDMS/value /parameter parameter nameusername/name valuesa/value /parameter parameter namepassword/name valuesa/value /parameter parameter namemaxActive/name value20/value /parameter parameter namemaxIdle/name value10/value /parameter parameter namemaxWait/name value-1/value /parameter /ResourceParams - web.xml --- ?xml version=1.0 encoding=ISO-8859-1? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd; web-app resource-ref res-ref-namejdbc/edmsCP/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref /web-app --- Here is my code.. --- public Connection getConnection() { Connection conn = null; try { Context initCtx = new InitialContext(); Context envCtx = (Context) initCtx.lookup(java:comp/env); if(envCtx == null ) throw new Exception(No Context); else System.out.println(Context Ok - + envCtx); DataSource ds = (DataSource) envCtx.lookup(jdbc/edmsCP); System.out.println(DataSource - + ds); if (ds != null) conn = ds.getConnection(); } catch(Exception ex) { System.out.println(ex.getMessage()); //ex.printStackTrace(); }finally { return conn; } } --- __ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: SOLUTION!! -- Cannot load JDBC driver class 'null'
hope this is helpful: the ResourceLink line, i was able to get my datasource resource accessible to each web app by creating a new unique name for the name parameter in the ResourceLink tag for each context, while keeping the global name (specified in the Resource tag) as the value for the global parameter in all contexts. ResourceLink name=MyDataSource global=MyDataSource type=javax.sql.DataSource/ I would suggest trying a name change for the value assigned to name in tag given above, then using this new, unique, context-specific name in the web.xml file and in any connection code used within specific web app. -paul lomack - Original Message - From: King,Daniel [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Friday, September 19, 2003 3:05 PM Subject: RE: SOLUTION!! -- Cannot load JDBC driver class 'null' I see this come up a lot in this user list and others about Tomcat, so I want to share this information. Note that the solution described below allows you to access a global data source from all Web Applications, without putting the Resource or ResourceParams elements in each Web Application Context. For over a week, I have been fighting the problem of configuring a data source so that it can be accessed by multiple Web Applications. I finally got it to work with Tomcat 5.0.9, by following Paul's advise from 9/12/03. I had no luck with Tomcat versions 4.1.24 or 4.1.27. To make it work in Tomcat 5.0.9, I used the Tomcat Administration tool to add the data source. It puts the following two elements in the GlobalNamingResources element: 1. Resource 2. ResourceParams I am working SQLServer 2000, using Microsoft's JDBC driver (wonders never cease): GlobalNamingResources Resource auth=Container name=MyDataSource scope=Shareable type=javax.sql.DataSource/ ResourceParams name=MyDataSource !-- etc. -- parameter namepassword/name valuemypassword/value /parameter parameter nameurl/name valuejdbc:microsoft:sqlserver://111.111.111.111:1433;database=mydb/value /parameter parameter namedriverClassName/name valuecom.microsoft.jdbc.sqlserver.SQLServerDriver/value /parameter !-- etc. -- parameter nameusername/name valuemyusername/value /parameter /ResourceParams /GlobalNamingResources Then I added a Context element for my Web Application-- it is the first child of the Host element: Context className=org.apache.catalina.core.StandardContext cachingAllowed=true charsetMapperClass=org.apache.catalina.util.CharsetMapper cookies=true crossContext=false debug=0 displayName=Welcome to Tomcat docBase=/usr/local/jakarta-tomcat-5.0.9/webapps/myWebApp mapperClass=org.apache.catalina.core.StandardContextMapper path=/myWebApp privileged=false reloadable=false swallowOutput=false useNaming=true wrapperClass=org.apache.catalina.core.StandardWrapper ResourceLink name=MyDataSource global=MyDataSource type=javax.sql.DataSource/ /Context Note that it was NOT necessary to add a resource-ref element to the web.xml for the Web Application. -Original Message- From: SANTOS, DANIEL (SBCSI) [mailto:[EMAIL PROTECTED] Sent: Fri 9/19/2003 11:20 AM To: '[EMAIL PROTECTED]'; '[EMAIL PROTECTED]'; '[EMAIL PROTECTED]'; '[EMAIL PROTECTED]'; '[EMAIL PROTECTED]'; '[EMAIL PROTECTED]'; '[EMAIL PROTECTED]' Cc: '[EMAIL PROTECTED]' Subject: SOLUTION!! -- Cannot load JDBC driver class 'null' Using Sun JDK 1.4.1_02 on Win2k SP2 and Jakarta 4.1.27. The tutorial in the tomcat docs failed for me also with the Cannot load JDBC driver class 'null'. I banged my head and had to get stitches and an ice pack. After that I came back to the office and cleaned out my server.xml and web.xml completely. Then I went to http://localhost:8080/admin http://localhost:8080/admin , browsed to the context that I am writing my app in, the full path from the tree being Tomcat Server/Service (Tomcat-Standalone)/Host (localhost)/Context(/myapp)/Resources/Data Sources. I added the data source from there specifying the JNDI name, driver class, URL, user and pass, etc. Then I did some tests with a jsp to make sure it was really in my context (you may have to restart tomcat, I did). Next I added the code back into my web.xml that is in the tutorial resource-ref descriptionDB Connection/description res-ref
RE: Tomcat, MySQL JNDI: java.sql.SQLException: Cannot load JDBC driver class 'null'
Still waiting for some confirmation from Remy Maucherat. He was talking about the client deployer package, however I cannot find it... Neither can I.. Thanks -Original Message- From: Ilja Hehenkamp [mailto:[EMAIL PROTECTED] Sent: 15 September 2003 16:07 To: [EMAIL PROTECTED] Subject: Re: Tomcat, MySQL JNDI: java.sql.SQLException: Cannot load JDBC driver class 'null' It could be related, but I'm not sure. I think the problem lies in the way the application gets deployed with this ant build file. Probably the docbase doesn't match (however that's just a wild guess) Still waiting for some confirmation from Remy Maucherat. He was talking about the client deployer package, however I cannot find it... Ilja _ MSN Zoeken, voor duidelijke zoekresultaten! http://search.msn.nl - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat, MySQL JNDI: java.sql.SQLException: Cannot load JDBC driver class 'null'
Remy Maucherat, can you elobarate on this deployer client? You talked about it, but it can nowhere be found. I'm still very stuck on this matter and don't have a way of fixing it... Deploying is a pain in the ass now compared to the convenient way of building with ant... From: Ilja Hehenkamp [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: Tomcat, MySQL JNDI: java.sql.SQLException: Cannot load JDBC driver class 'null' Date: Fri, 19 Sep 2003 19:37:46 +0200 Sorry, I don't really understand what you mean? Do you mean I shouldn't use the build file anymore? If so: that's too bad, since I like the way of automated updating the tomcat manager... I'm sure you do. You seem to be stuck on that particular page of the docs, however, which happens to be out of date, and doesn't actually mention what is important. Read the deployer page instead (http://jakarta.apache.org/tomcat/tomcat-5.0-doc/deployer-howto.html ). But still: I don't know how to fix the problem: why doesn't the jndi datasource work with the through ant deployed application? Because I don't think your stuff in server.xml is used at all. That's much better. I recommend you use the deployer package instead. The instructions from appdev are going to be updated or removed. I think I know where lies the problem, however I still don't know how to fix it... I use the sample build.xml file from Tomcat: http://jakarta.apache.org/tomcat/tomcat-5.0-doc/appdev/ build.xml.txt to install, reload and distribute my sample application. When I do an ant -install it apparantly installs the application in the Tomcat manager, however the application doesn't show up in the webapps directory. That's 1. So maybe there's a conflict with either the context path, which I don't think so, since my build file has explicitly set the context path to /DBTest: property name=app.name value=DBTest/ property name=app.path value=/${app.name}/ property name=app.version value=/ property name=build.homevalue=${basedir}/build/ property name=catalina.home value=/Library/Tomcat/ !-- UPDATE THIS! -- property name=dist.home value=${basedir}/dist/ property name=docs.home value=${basedir}/docs/ property name=manager.url value= http://localhost:8080/manager / property name=src.home value=${basedir}/src/ property name=web.home value=${basedir}/web/ Or there's a conflict with the docbase, which I suspect... However I'm not sure why and how to fix it Because when I put the generated war file (when doing an ant -dist) in the webapps directory the connection works! Although this works, it's not very convenient, since it defeats the purpose of the automated installing through ant... Hope I made myself clear? Ok, first some configuration information: Tomcat 5.09 MySQL Driver 3.08 stable OS: Mac OSX 10.2.6 J2SE 1.4.2 all commons libraries reside in $CATALINA_HOME/common/lib MySQL Driver resides in $CATALINA_HOME/common/lib as well I tried setting up a simple JNDI datasource connection but get the following error message: java.sql.SQLException: Cannot load JDBC driver class 'null' at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataS ource .java:529) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSour ce.ja va:312) at foo.DBTest.init(DBTest.java:24) at foo.TestServlet.doGet(TestServlet.java:34) at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) The code and examples are taken from http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasource- examples-howto.html I have searched through tons of archives and websites and mostly this error could be resolved by placing the driver and commons in the common/lib directory. However in my case they are there, so I cannot figure out what's the problem... server.xml: Context path=/DBTest docBase=DBTest debug=5 reloadable=true crossContext=true Logger className=org.apache.catalina.logger.FileLogger directory=logs prefix=localhost_DBTest_log. suffix=.txt timestamp=true/ Resource name=jdbc/TestDB auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/TestDB parameter namedriverClassName/name valueorg.gjt.mm.mysql.Driver/value /parameter parameter nameusername/name valuexxx/value /parameter parameter namepassword/name valuexxx/value /parameter parameter nameurl/name valuejdbc:mysql://localhost/javatest?autoReconnect=true/ value /parameter /ResourceParams /Context web.xml ?xml version=1.0 encoding=ISO-8859-1? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd web-app descriptionMySQL Test App/description
SOLUTION!! -- Cannot load JDBC driver class 'null'
Using Sun JDK 1.4.1_02 on Win2k SP2 and Jakarta 4.1.27. The tutorial in the tomcat docs failed for me also with the Cannot load JDBC driver class 'null'. I banged my head and had to get stitches and an ice pack. After that I came back to the office and cleaned out my server.xml and web.xml completely. Then I went to http://localhost:8080/admin http://localhost:8080/admin , browsed to the context that I am writing my app in, the full path from the tree being Tomcat Server/Service (Tomcat-Standalone)/Host (localhost)/Context(/myapp)/Resources/Data Sources. I added the data source from there specifying the JNDI name, driver class, URL, user and pass, etc. Then I did some tests with a jsp to make sure it was really in my context (you may have to restart tomcat, I did). Next I added the code back into my web.xml that is in the tutorial resource-ref descriptionDB Connection/description res-ref-namemyData Source/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref And it works!!! I just have a new problem now of DBCP borrowObject failed: String index out of range: -1, I suppose I'll figure that out too... Good Luck and thanks to all who posted info on this, Daniel - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: SOLUTION!! -- Cannot load JDBC driver class 'null'
I see this come up a lot in this user list and others about Tomcat, so I want to share this information. Note that the solution described below allows you to access a global data source from all Web Applications, without putting the Resource or ResourceParams elements in each Web Application Context. For over a week, I have been fighting the problem of configuring a data source so that it can be accessed by multiple Web Applications. I finally got it to work with Tomcat 5.0.9, by following Paul's advise from 9/12/03. I had no luck with Tomcat versions 4.1.24 or 4.1.27. To make it work in Tomcat 5.0.9, I used the Tomcat Administration tool to add the data source. It puts the following two elements in the GlobalNamingResources element: 1. Resource 2. ResourceParams I am working SQLServer 2000, using Microsoft's JDBC driver (wonders never cease): GlobalNamingResources Resource auth=Container name=MyDataSource scope=Shareable type=javax.sql.DataSource/ ResourceParams name=MyDataSource !-- etc. -- parameter namepassword/name valuemypassword/value /parameter parameter nameurl/name valuejdbc:microsoft:sqlserver://111.111.111.111:1433;database=mydb/value /parameter parameter namedriverClassName/name valuecom.microsoft.jdbc.sqlserver.SQLServerDriver/value /parameter !-- etc. -- parameter nameusername/name valuemyusername/value /parameter /ResourceParams /GlobalNamingResources Then I added a Context element for my Web Application-- it is the first child of the Host element: Context className=org.apache.catalina.core.StandardContext cachingAllowed=true charsetMapperClass=org.apache.catalina.util.CharsetMapper cookies=true crossContext=false debug=0 displayName=Welcome to Tomcat docBase=/usr/local/jakarta-tomcat-5.0.9/webapps/myWebApp mapperClass=org.apache.catalina.core.StandardContextMapper path=/myWebApp privileged=false reloadable=false swallowOutput=false useNaming=true wrapperClass=org.apache.catalina.core.StandardWrapper ResourceLink name=MyDataSource global=MyDataSource type=javax.sql.DataSource/ /Context Note that it was NOT necessary to add a resource-ref element to the web.xml for the Web Application. -Original Message- From: SANTOS, DANIEL (SBCSI) [mailto:[EMAIL PROTECTED] Sent: Fri 9/19/2003 11:20 AM To: '[EMAIL PROTECTED]'; '[EMAIL PROTECTED]'; '[EMAIL PROTECTED]'; '[EMAIL PROTECTED]'; '[EMAIL PROTECTED]'; '[EMAIL PROTECTED]'; '[EMAIL PROTECTED]' Cc: '[EMAIL PROTECTED]' Subject: SOLUTION!! -- Cannot load JDBC driver class 'null' Using Sun JDK 1.4.1_02 on Win2k SP2 and Jakarta 4.1.27. The tutorial in the tomcat docs failed for me also with the Cannot load JDBC driver class 'null'. I banged my head and had to get stitches and an ice pack. After that I came back to the office and cleaned out my server.xml and web.xml completely. Then I went to http://localhost:8080/admin http://localhost:8080/admin , browsed to the context that I am writing my app in, the full path from the tree being Tomcat Server/Service (Tomcat-Standalone)/Host (localhost)/Context(/myapp)/Resources/Data Sources. I added the data source from there specifying the JNDI name, driver class, URL, user and pass, etc. Then I did some tests with a jsp to make sure it was really in my context (you may have to restart tomcat, I did). Next I added the code back into my web.xml that is in the tutorial resource-ref descriptionDB Connection/description res-ref-namemyData Source/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref And it works!!! I just have a new problem now of DBCP borrowObject failed: String index out of range: -1, I suppose I'll figure that out too... Good Luck and thanks to all who posted info on this, Daniel - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED
RE: SOLUTION!! -- Cannot load JDBC driver class 'null'
I got a similar result with Tomcat 5.0.9 when, within server.xml, I placed the Resource and ResourceParams elements inside a DefaultContext element in Host. I then referred to my named resource in web.xml in a resource-ref element. The advantage of this method is simpler application distribution: it does not require a user of your application to add Context and ResourceLink elements to his or her server.xml. Note that I was unable to achieve the same result by adding the Resource and ResourceParams elements to GlobalNamingResources as O'Reilly's, Tomcat: The Definitive Guide, and other documents suggest. By the way, I am also using SQL Server 2000 and Microsoft's JDBC driver. Derek -Original Message- From: King,Daniel [mailto:[EMAIL PROTECTED] Sent: September 19, 2003 3:06 PM To: Tomcat Users List Subject: RE: SOLUTION!! -- Cannot load JDBC driver class 'null' I see this come up a lot in this user list and others about Tomcat, so I want to share this information. Note that the solution described below allows you to access a global data source from all Web Applications, without putting the Resource or ResourceParams elements in each Web Application Context. For over a week, I have been fighting the problem of configuring a data source so that it can be accessed by multiple Web Applications. I finally got it to work with Tomcat 5.0.9, by following Paul's advise from 9/12/03. I had no luck with Tomcat versions 4.1.24 or 4.1.27. To make it work in Tomcat 5.0.9, I used the Tomcat Administration tool to add the data source. It puts the following two elements in the GlobalNamingResources element: 1. Resource 2. ResourceParams I am working SQLServer 2000, using Microsoft's JDBC driver (wonders never cease): GlobalNamingResources Resource auth=Container name=MyDataSource scope=Shareable type=javax.sql.DataSource/ ResourceParams name=MyDataSource !-- etc. -- parameter namepassword/name valuemypassword/value /parameter parameter nameurl/name valuejdbc:microsoft:sqlserver://111.111.111.111:1433;database=mydb/va lue /parameter parameter namedriverClassName/name valuecom.microsoft.jdbc.sqlserver.SQLServerDriver/value /parameter !-- etc. -- parameter nameusername/name valuemyusername/value /parameter /ResourceParams /GlobalNamingResources Then I added a Context element for my Web Application-- it is the first child of the Host element: Context className=org.apache.catalina.core.StandardContext cachingAllowed=true charsetMapperClass=org.apache.catalina.util.CharsetMapper cookies=true crossContext=false debug=0 displayName=Welcome to Tomcat docBase=/usr/local/jakarta-tomcat-5.0.9/webapps/myWebApp mapperClass=org.apache.catalina.core.StandardContextMapper path=/myWebApp privileged=false reloadable=false swallowOutput=false useNaming=true wrapperClass=org.apache.catalina.core.StandardWrapper ResourceLink name=MyDataSource global=MyDataSource type=javax.sql.DataSource/ /Context Note that it was NOT necessary to add a resource-ref element to the web.xml for the Web Application. -Original Message- From: SANTOS, DANIEL (SBCSI) [mailto:[EMAIL PROTECTED] Sent: Fri 9/19/2003 11:20 AM To: '[EMAIL PROTECTED]'; '[EMAIL PROTECTED]'; '[EMAIL PROTECTED]'; '[EMAIL PROTECTED]'; '[EMAIL PROTECTED]'; '[EMAIL PROTECTED]'; '[EMAIL PROTECTED]' Cc: '[EMAIL PROTECTED]' Subject: SOLUTION!! -- Cannot load JDBC driver class 'null' Using Sun JDK 1.4.1_02 on Win2k SP2 and Jakarta 4.1.27. The tutorial in the tomcat docs failed for me also with the Cannot load JDBC driver class 'null'. I banged my head and had to get stitches and an ice pack. After that I came back to the office and cleaned out my server.xml and web.xml completely. Then I went to http://localhost:8080/admin http://localhost:8080/admin , browsed to the context that I am writing my app in, the full path from the tree being Tomcat Server/Service (Tomcat-Standalone)/Host (localhost)/Context(/myapp)/Resources/Data Sources. I added the data source from there specifying the JNDI name, driver class, URL, user and pass, etc. Then I did some tests with a jsp to make sure it was really in my context (you may have to restart tomcat, I did). Next I added the code back into my web.xml that is in the tutorial
Re: Cannot load JDBC driver class 'null'
On Fri, 12 Sep 2003 00:16, Ben Anderson wrote: Ok, I know this topic has been posted many times, but I can't find anything to help. There is no help - its a bug. I tried posting a bug on Bugzilla, but I can't find the bug any longer. I'm still running 4.0.4 because I can't easily move to 4.1.27 until this is resolved. I'll try to fix it myself when I get time. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Cannot load JDBC driver class 'null'
On Fri, 12 Sep 2003 04:41, Ben Anderson wrote: I moved the Resource and ResaourceParams tags to myApp.xml and put it in the webapps folder(with the war). I'm still getting the exact same errors. More specifically, in 4.1.27 you can't define your JDBC resources in either the DefaultContext or the GlobalResources. You need to explicitly define a Context for your webapp, and insert the resources into that context. If however you are trying to deploy by copying a war into webapps then you are out of luck, because by having a context it won't unpack the war :( - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat, MySQL JNDI: java.sql.SQLException: Cannot load JDBC driver class 'null'
Ok, first some configuration information: Tomcat 5.09 MySQL Driver 3.08 stable OS: Mac OSX 10.2.6 J2SE 1.4.2 all commons libraries reside in $CATALINA_HOME/common/lib MySQL Driver resides in $CATALINA_HOME/common/lib as well I tried setting up a simple JNDI datasource connection but get the following error message: java.sql.SQLException: Cannot load JDBC driver class 'null' at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource .java:529) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.ja va:312) at foo.DBTest.init(DBTest.java:24) at foo.TestServlet.doGet(TestServlet.java:34) at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) The code and examples are taken from http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasource- examples-howto.html I have searched through tons of archives and websites and mostly this error could be resolved by placing the driver and commons in the common/lib directory. However in my case they are there, so I cannot figure out what's the problem... server.xml: Context path=/DBTest docBase=DBTest debug=5 reloadable=true crossContext=true Logger className=org.apache.catalina.logger.FileLogger directory=logs prefix=localhost_DBTest_log. suffix=.txt timestamp=true/ Resource name=jdbc/TestDB auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/TestDB parameter namedriverClassName/name valueorg.gjt.mm.mysql.Driver/value /parameter parameter nameusername/name valuexxx/value /parameter parameter namepassword/name valuexxx/value /parameter parameter nameurl/name valuejdbc:mysql://localhost/javatest?autoReconnect=true/value /parameter /ResourceParams /Context web.xml ?xml version=1.0 encoding=ISO-8859-1? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd; web-app descriptionMySQL Test App/description resource-ref descriptionDB Connection/description res-ref-namejdbc/TestDB/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref servlet servlet-nameDBTestServlet/servlet-name description Bla... /description servlet-classfoo.TestServlet/servlet-class /servlet servlet-mapping servlet-nameDBTestServlet/servlet-name url-pattern/DBTestServlet/url-pattern /servlet-mapping /web-app - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat, MySQL JNDI: java.sql.SQLException: Cannot load JDBC driver class 'null'
Ilja wrote: Ok, first some configuration information: Tomcat 5.09 MySQL Driver 3.08 stable OS: Mac OSX 10.2.6 J2SE 1.4.2 My config is not the same (TC 4.1.24, OSX 10.2.6, MySQL 3.07), and my parameters are different: ResourceParams name=jdbc/EuratomDB parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter parameter namemaxActive/name value100/value /parameter parameter namemaxIdle/name value3/value /parameter parameter namemaxWait/name value100/value /parameter parameter nameusername/name valuexxx/value /parameter parameter namepassword/name valuexxx/value /parameter parameter namedriverClassName/name valuecom.mysql.jdbc.Driver/value /parameter parameter nameurl/name valuejdbc:mysql://localhost/euratom?autoReconnect=true/value /parameter /ResourceParams This works for me! The main diffs are (i) I specify the factory, and (ii), the driverClassName is com.mysql.jdbc.Driver However, the exception seems to suggest that the correct factory is being used by default. Your driverClassName is the old name, and might not be in the jar file any more. HTH Martin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat, MySQL JNDI: java.sql.SQLException: Cannot load JDBC driver class 'null'
I think I know where lies the problem, however I still don't know how to fix it... I use the sample build.xml file from Tomcat: http://jakarta.apache.org/tomcat/tomcat-5.0-doc/appdev/build.xml.txt to install, reload and distribute my sample application. When I do an ant -install it apparantly installs the application in the Tomcat manager, however the application doesn't show up in the webapps directory. That's 1. So maybe there's a conflict with either the context path, which I don't think so, since my build file has explicitly set the context path to /DBTest: property name=app.name value=DBTest/ property name=app.path value=/${app.name}/ property name=app.version value=/ property name=build.homevalue=${basedir}/build/ property name=catalina.home value=/Library/Tomcat/ !-- UPDATE THIS! -- property name=dist.home value=${basedir}/dist/ property name=docs.home value=${basedir}/docs/ property name=manager.url value=http://localhost:8080/manager/ property name=src.home value=${basedir}/src/ property name=web.home value=${basedir}/web/ Or there's a conflict with the docbase, which I suspect... However I'm not sure why and how to fix it Because when I put the generated war file (when doing an ant -dist) in the webapps directory the connection works! Although this works, it's not very convenient, since it defeats the purpose of the automated installing through ant... Hope I made myself clear? From: Martin Jacobson [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Subject: Re: Tomcat, MySQL JNDI: java.sql.SQLException: Cannot load JDBC driver class 'null' Date: Mon, 15 Sep 2003 14:00:52 +0200 Ilja wrote: Ok, first some configuration information: Tomcat 5.09 MySQL Driver 3.08 stable OS: Mac OSX 10.2.6 J2SE 1.4.2 My config is not the same (TC 4.1.24, OSX 10.2.6, MySQL 3.07), and my parameters are different: ResourceParams name=jdbc/EuratomDB parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter parameter namemaxActive/name value100/value /parameter parameter namemaxIdle/name value3/value /parameter parameter namemaxWait/name value100/value /parameter parameter nameusername/name valuexxx/value /parameter parameter namepassword/name valuexxx/value /parameter parameter namedriverClassName/name valuecom.mysql.jdbc.Driver/value /parameter parameter nameurl/name valuejdbc:mysql://localhost/euratom?autoReconnect=true/value /parameter /ResourceParams This works for me! The main diffs are (i) I specify the factory, and (ii), the driverClassName is com.mysql.jdbc.Driver However, the exception seems to suggest that the correct factory is being used by default. Your driverClassName is the old name, and might not be in the jar file any more. HTH Martin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ MSN Zoeken, voor duidelijke zoekresultaten! http://search.msn.nl - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat, MySQL JNDI: java.sql.SQLException: Cannot load JDBC driver class 'null'
Ilja Hehenkamp wrote: I think I know where lies the problem, however I still don't know how to fix it... I use the sample build.xml file from Tomcat: http://jakarta.apache.org/tomcat/tomcat-5.0-doc/appdev/build.xml.txt to install, reload and distribute my sample application. When I do an ant -install it apparantly installs the application in the Tomcat manager, however the application doesn't show up in the webapps directory. That's 1. So maybe there's a conflict with either the context path, which I don't think so, since my build file has explicitly set the context path to /DBTest: property name=app.name value=DBTest/ property name=app.path value=/${app.name}/ property name=app.version value=/ property name=build.homevalue=${basedir}/build/ property name=catalina.home value=/Library/Tomcat/ !-- UPDATE THIS! -- property name=dist.home value=${basedir}/dist/ property name=docs.home value=${basedir}/docs/ property name=manager.url value=http://localhost:8080/manager/ property name=src.home value=${basedir}/src/ property name=web.home value=${basedir}/web/ Or there's a conflict with the docbase, which I suspect... However I'm not sure why and how to fix it Because when I put the generated war file (when doing an ant -dist) in the webapps directory the connection works! Although this works, it's not very convenient, since it defeats the purpose of the automated installing through ant... Hope I made myself clear? That's much better. I recommend you use the deployer package instead. The instructions from appdev are going to be updated or removed. -- x Rémy Maucherat Senior Developer Consultant JBoss Group (Europe) SàRL x - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat, MySQL JNDI: java.sql.SQLException: Cannot load JDBC driver class 'null'
Sorry, I don't really understand what you mean? Do you mean I shouldn't use the build file anymore? If so: that's too bad, since I like the way of automated updating the tomcat manager... But still: I don't know how to fix the problem: why doesn't the jndi datasource work with the through ant deployed application? From: Remy Maucherat [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Subject: Re: Tomcat, MySQL JNDI: java.sql.SQLException: Cannot load JDBC driver class 'null' Date: Mon, 15 Sep 2003 15:17:53 +0200 Ilja Hehenkamp wrote: I think I know where lies the problem, however I still don't know how to fix it... I use the sample build.xml file from Tomcat: http://jakarta.apache.org/tomcat/tomcat-5.0-doc/appdev/build.xml.txt to install, reload and distribute my sample application. When I do an ant -install it apparantly installs the application in the Tomcat manager, however the application doesn't show up in the webapps directory. That's 1. So maybe there's a conflict with either the context path, which I don't think so, since my build file has explicitly set the context path to /DBTest: property name=app.name value=DBTest/ property name=app.path value=/${app.name}/ property name=app.version value=/ property name=build.homevalue=${basedir}/build/ property name=catalina.home value=/Library/Tomcat/ !-- UPDATE THIS! -- property name=dist.home value=${basedir}/dist/ property name=docs.home value=${basedir}/docs/ property name=manager.url value=http://localhost:8080/manager/ property name=src.home value=${basedir}/src/ property name=web.home value=${basedir}/web/ Or there's a conflict with the docbase, which I suspect... However I'm not sure why and how to fix it Because when I put the generated war file (when doing an ant -dist) in the webapps directory the connection works! Although this works, it's not very convenient, since it defeats the purpose of the automated installing through ant... Hope I made myself clear? That's much better. I recommend you use the deployer package instead. The instructions from appdev are going to be updated or removed. -- x Rémy Maucherat Senior Developer Consultant JBoss Group (Europe) SàRL x - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ MSN Zoeken, voor duidelijke zoekresultaten! http://search.msn.nl - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat, MySQL JNDI: java.sql.SQLException: Cannot load JDBC driver class 'null'
Ilja Hehenkamp wrote: Sorry, I don't really understand what you mean? Do you mean I shouldn't use the build file anymore? If so: that's too bad, since I like the way of automated updating the tomcat manager... I'm sure you do. You seem to be stuck on that particular page of the docs, however, which happens to be out of date, and doesn't actually mention what is important. Read the deployer page instead (http://jakarta.apache.org/tomcat/tomcat-5.0-doc/deployer-howto.html). But still: I don't know how to fix the problem: why doesn't the jndi datasource work with the through ant deployed application? Because I don't think your stuff in server.xml is used at all. -- x Rémy Maucherat Senior Developer Consultant JBoss Group (Europe) SàRL x - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat, MySQL JNDI: java.sql.SQLException: Cannot load JDBC driver class 'null'
Sorry for being such a pain in the ass, but It's still not really clear to me: What do you actually suggest? Are you talking about this client deployer that's listed on that page? Where can I find it? (I cannot find it, neither the build file that's mentioned there) Will this fix my problem? So for confirmation: I shouldn't use the old ant buildfile anymore? Ilja From: Remy Maucherat [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Subject: Re: Tomcat, MySQL JNDI: java.sql.SQLException: Cannot load JDBC driver class 'null' Date: Mon, 15 Sep 2003 15:33:13 +0200 Ilja Hehenkamp wrote: Sorry, I don't really understand what you mean? Do you mean I shouldn't use the build file anymore? If so: that's too bad, since I like the way of automated updating the tomcat manager... I'm sure you do. You seem to be stuck on that particular page of the docs, however, which happens to be out of date, and doesn't actually mention what is important. Read the deployer page instead (http://jakarta.apache.org/tomcat/tomcat-5.0-doc/deployer-howto.html). But still: I don't know how to fix the problem: why doesn't the jndi datasource work with the through ant deployed application? Because I don't think your stuff in server.xml is used at all. -- x Rémy Maucherat Senior Developer Consultant JBoss Group (Europe) SàRL x - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ MSN Zoeken, voor duidelijke zoekresultaten! http://search.msn.nl - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat, MySQL JNDI: java.sql.SQLException: Cannot load JDBC driver class 'null'
it is possible that the problem stems from Tomcat itself. The reason i say that, is because i have setup a dbcp connection (using Tomcat 4.1, jdk 1.4, oracle on win2k), and i have managed to get it to work with a particular application, but get the same Cannot load JDBC driver class 'null' when try to use connection with ROOT application, or with any other application. It is weird, and i have not figured out what problem is. Also, there are many previous emails in this user-group pertaining to this Cannot-load-JDBC error, esp. when associated with use as a global resource. -paul lomack p.s. i would be happy to report my server.xml or web.xml or jsp code for calling connection, if you think it may be of any use to you. - Original Message - From: Ilja Hehenkamp [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, September 15, 2003 9:10 AM Subject: Re: Tomcat, MySQL JNDI: java.sql.SQLException: Cannot load JDBC driver class 'null' I think I know where lies the problem, however I still don't know how to fix it... I use the sample build.xml file from Tomcat: http://jakarta.apache.org/tomcat/tomcat-5.0-doc/appdev/build.xml.txt to install, reload and distribute my sample application. When I do an ant -install it apparantly installs the application in the Tomcat manager, however the application doesn't show up in the webapps directory. That's 1. So maybe there's a conflict with either the context path, which I don't think so, since my build file has explicitly set the context path to /DBTest: property name=app.name value=DBTest/ property name=app.path value=/${app.name}/ property name=app.version value=/ property name=build.homevalue=${basedir}/build/ property name=catalina.home value=/Library/Tomcat/ !-- UPDATE THIS! -- property name=dist.home value=${basedir}/dist/ property name=docs.home value=${basedir}/docs/ property name=manager.url value=http://localhost:8080/manager/ property name=src.home value=${basedir}/src/ property name=web.home value=${basedir}/web/ Or there's a conflict with the docbase, which I suspect... However I'm not sure why and how to fix it Because when I put the generated war file (when doing an ant -dist) in the webapps directory the connection works! Although this works, it's not very convenient, since it defeats the purpose of the automated installing through ant... Hope I made myself clear? From: Martin Jacobson [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Subject: Re: Tomcat, MySQL JNDI: java.sql.SQLException: Cannot load JDBC driver class 'null' Date: Mon, 15 Sep 2003 14:00:52 +0200 Ilja wrote: Ok, first some configuration information: Tomcat 5.09 MySQL Driver 3.08 stable OS: Mac OSX 10.2.6 J2SE 1.4.2 My config is not the same (TC 4.1.24, OSX 10.2.6, MySQL 3.07), and my parameters are different: ResourceParams name=jdbc/EuratomDB parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter parameter namemaxActive/name value100/value /parameter parameter namemaxIdle/name value3/value /parameter parameter namemaxWait/name value100/value /parameter parameter nameusername/name valuexxx/value /parameter parameter namepassword/name valuexxx/value /parameter parameter namedriverClassName/name valuecom.mysql.jdbc.Driver/value /parameter parameter nameurl/name valuejdbc:mysql://localhost/euratom?autoReconnect=true/value /parameter /ResourceParams This works for me! The main diffs are (i) I specify the factory, and (ii), the driverClassName is com.mysql.jdbc.Driver However, the exception seems to suggest that the correct factory is being used by default. Your driverClassName is the old name, and might not be in the jar file any more. HTH Martin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ MSN Zoeken, voor duidelijke zoekresultaten! http://search.msn.nl - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat, MySQL JNDI: java.sql.SQLException: Cannot load JDBC driver class 'null'
It could be related, but I'm not sure. I think the problem lies in the way the application gets deployed with this ant build file. Probably the docbase doesn't match (however that's just a wild guess) Still waiting for some confirmation from Remy Maucherat. He was talking about the client deployer package, however I cannot find it... Ilja _ MSN Zoeken, voor duidelijke zoekresultaten! http://search.msn.nl - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Cannot load JDBC driver class 'null' - Tomcat standalone 4.1. 27 w hen trying instantiate datasource object.
V1.3 C:\jdk1.3.1_08\jre\bin\java -classpath C:\web\Tomcat4.1\bin\bootstrap.jar;C:\jdk1.3.1_08\lib\tools.jar -Dcatalina.home=C:\web\Tomcat4.1 -Dcatalina.base=C:\web\Tomcat4.1 -Original Message- From: Filip Hanik [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 10, 2003 6:20 PM To: Tomcat Users List Subject: Re: Cannot load JDBC driver class 'null' - Tomcat standalone 4.1. 27 w hen trying instantiate datasource object. what JDK are you using? Filip - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Cannot load JDBC driver class 'null'
Ok, I know this topic has been posted many times, but I can't find anything to help. I have OracleDriver in [$CATALINA_HOME]/common/lib here's my server.xml GlobalNamingResources .. Resource name=myDS scope=Shareable type=javax.sql.DataSource auth=Container/ ResourceParams name=myDS parameter namevalidationQuery/name valueselect user from dual;/value /parameter parameter nameurl/name valuejdbc:oracle:thin:myMachine:1521:myDBName/value /parameter parameter nameusername/name valuehris/value /parameter parameter namepassword/name value/value /parameter parameter namemaxActive/name value4/value /parameter parameter namemaxWait/name value5000/value /parameter parameter namedriverClassName/name valueoracle.jdbc.driver.OracleDriver/value /parameter parameter namemaxIdle/name value2/value /parameter /ResourceParams /GlobalNamingResources and my web.xml: resource-ref res-ref-namejdbc/fsaDS/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth res-sharing-scopeShareable/res-sharing-scope /resource-ref in the administrative tool: the top level Resources-DataSources looks ok as MyDS is listed there but the /my_context-Resources-Datasources gives: org.apache.jasper.JasperException: Exception retrieving attribute 'driverClassName' and the localhost_log.xxx.txt (when it tries to use myDS): java.sql.SQLException: Cannot load JDBC driver class 'null Any help would be great - I've been trying everything - reloading with different configurations about 50 times - looking through books, mailing lists/archives. Thanks, Ben _ Get 10MB of e-mail storage! Sign up for Hotmail Extra Storage. http://join.msn.com/?PAGE=features/es - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Cannot load JDBC driver class 'null'
I'm having the same problem. From what I read the most common problem is that you jdbc driver jar is not in tomcatehome/common/lib dir. Apparently if its only the the web apps ../WEB-INF/lib the tomcat runtime does not have access to it. But, I still have the same problem. I know the jar file is getting used from ../common/lib because I can delete it when Tomkitty is fired up. What version of Tomcat are you using. I'm using V4.1.27LE(No sax parser included.) JDK 1.3. I'm currently doing a new install of tomcat LE. If that does not work I'm trying Tomcat standard from http://www.tux.org/pub/net/apache/dist/jakarta/tomcat-4/ Later, Rober Wynkoop -Original Message- From: Ben Anderson [mailto:[EMAIL PROTECTED] Sent: Thursday, September 11, 2003 7:17 AM To: [EMAIL PROTECTED] Subject: Cannot load JDBC driver class 'null' Ok, I know this topic has been posted many times, but I can't find anything to help. I have OracleDriver in [$CATALINA_HOME]/common/lib here's my server.xml GlobalNamingResources .. Resource name=myDS scope=Shareable type=javax.sql.DataSource auth=Container/ ResourceParams name=myDS parameter namevalidationQuery/name valueselect user from dual;/value /parameter parameter nameurl/name valuejdbc:oracle:thin:myMachine:1521:myDBName/value /parameter parameter nameusername/name valuehris/value /parameter parameter namepassword/name value/value /parameter parameter namemaxActive/name value4/value /parameter parameter namemaxWait/name value5000/value /parameter parameter namedriverClassName/name valueoracle.jdbc.driver.OracleDriver/value /parameter parameter namemaxIdle/name value2/value /parameter /ResourceParams /GlobalNamingResources and my web.xml: resource-ref res-ref-namejdbc/fsaDS/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth res-sharing-scopeShareable/res-sharing-scope /resource-ref in the administrative tool: the top level Resources-DataSources looks ok as MyDS is listed there but the /my_context-Resources-Datasources gives: org.apache.jasper.JasperException: Exception retrieving attribute 'driverClassName' and the localhost_log.xxx.txt (when it tries to use myDS): java.sql.SQLException: Cannot load JDBC driver class 'null Any help would be great - I've been trying everything - reloading with different configurations about 50 times - looking through books, mailing lists/archives. Thanks, Ben _ Get 10MB of e-mail storage! Sign up for Hotmail Extra Storage. http://join.msn.com/?PAGE=features/es - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Cannot load JDBC driver class 'null'
I meant to say I can't delete the ../common/lib/classes12.jar when TomCat is running. Blip, Robert Wynkoop -Original Message- From: Wynkoop, Robert M Sent: Thursday, September 11, 2003 7:54 AM To: 'Tomcat Users List' Subject: RE: Cannot load JDBC driver class 'null' I'm having the same problem. From what I read the most common problem is that you jdbc driver jar is not in tomcatehome/common/lib dir. Apparently if its only the the web apps ../WEB-INF/lib the tomcat runtime does not have access to it. But, I still have the same problem. I know the jar file is getting used from ../common/lib because I can delete it when Tomkitty is fired up. What version of Tomcat are you using. I'm using V4.1.27LE(No sax parser included.) JDK 1.3. I'm currently doing a new install of tomcat LE. If that does not work I'm trying Tomcat standard from http://www.tux.org/pub/net/apache/dist/jakarta/tomcat-4/ Later, Rober Wynkoop -Original Message- From: Ben Anderson [mailto:[EMAIL PROTECTED] Sent: Thursday, September 11, 2003 7:17 AM To: [EMAIL PROTECTED] Subject: Cannot load JDBC driver class 'null' Ok, I know this topic has been posted many times, but I can't find anything to help. I have OracleDriver in [$CATALINA_HOME]/common/lib here's my server.xml GlobalNamingResources .. Resource name=myDS scope=Shareable type=javax.sql.DataSource auth=Container/ ResourceParams name=myDS parameter namevalidationQuery/name valueselect user from dual;/value /parameter parameter nameurl/name valuejdbc:oracle:thin:myMachine:1521:myDBName/value /parameter parameter nameusername/name valuehris/value /parameter parameter namepassword/name value/value /parameter parameter namemaxActive/name value4/value /parameter parameter namemaxWait/name value5000/value /parameter parameter namedriverClassName/name valueoracle.jdbc.driver.OracleDriver/value /parameter parameter namemaxIdle/name value2/value /parameter /ResourceParams /GlobalNamingResources and my web.xml: resource-ref res-ref-namejdbc/fsaDS/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth res-sharing-scopeShareable/res-sharing-scope /resource-ref in the administrative tool: the top level Resources-DataSources looks ok as MyDS is listed there but the /my_context-Resources-Datasources gives: org.apache.jasper.JasperException: Exception retrieving attribute 'driverClassName' and the localhost_log.xxx.txt (when it tries to use myDS): java.sql.SQLException: Cannot load JDBC driver class 'null Any help would be great - I've been trying everything - reloading with different configurations about 50 times - looking through books, mailing lists/archives. Thanks, Ben _ Get 10MB of e-mail storage! Sign up for Hotmail Extra Storage. http://join.msn.com/?PAGE=features/es - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Cannot load JDBC driver class 'null'
I have the jar in $CATALINA_HOME/common/lib here's my info: Server Information Tomcat Version JVM Version JVM Vendor OS Name OS Version OS Architecture Apache Tomcat/4.1.24 1.4.1_02-b06 Sun Microsystems Inc. Windows 2000 5.0 x86 -Ben From: Wynkoop, Robert M [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: 'Tomcat Users List' [EMAIL PROTECTED] Subject: RE: Cannot load JDBC driver class 'null' Date: Thu, 11 Sep 2003 08:57:35 -0400 I meant to say I can't delete the ../common/lib/classes12.jar when TomCat is running. Blip, Robert Wynkoop -Original Message- From: Wynkoop, Robert M Sent: Thursday, September 11, 2003 7:54 AM To: 'Tomcat Users List' Subject: RE: Cannot load JDBC driver class 'null' I'm having the same problem. From what I read the most common problem is that you jdbc driver jar is not in tomcatehome/common/lib dir. Apparently if its only the the web apps ../WEB-INF/lib the tomcat runtime does not have access to it. But, I still have the same problem. I know the jar file is getting used from ../common/lib because I can delete it when Tomkitty is fired up. What version of Tomcat are you using. I'm using V4.1.27LE(No sax parser included.) JDK 1.3. I'm currently doing a new install of tomcat LE. If that does not work I'm trying Tomcat standard from http://www.tux.org/pub/net/apache/dist/jakarta/tomcat-4/ Later, Rober Wynkoop -Original Message- From: Ben Anderson [mailto:[EMAIL PROTECTED] Sent: Thursday, September 11, 2003 7:17 AM To: [EMAIL PROTECTED] Subject: Cannot load JDBC driver class 'null' Ok, I know this topic has been posted many times, but I can't find anything to help. I have OracleDriver in [$CATALINA_HOME]/common/lib here's my server.xml GlobalNamingResources .. Resource name=myDS scope=Shareable type=javax.sql.DataSource auth=Container/ ResourceParams name=myDS parameter namevalidationQuery/name valueselect user from dual;/value /parameter parameter nameurl/name valuejdbc:oracle:thin:myMachine:1521:myDBName/value /parameter parameter nameusername/name valuehris/value /parameter parameter namepassword/name value/value /parameter parameter namemaxActive/name value4/value /parameter parameter namemaxWait/name value5000/value /parameter parameter namedriverClassName/name valueoracle.jdbc.driver.OracleDriver/value /parameter parameter namemaxIdle/name value2/value /parameter /ResourceParams /GlobalNamingResources and my web.xml: resource-ref res-ref-namejdbc/fsaDS/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth res-sharing-scopeShareable/res-sharing-scope /resource-ref in the administrative tool: the top level Resources-DataSources looks ok as MyDS is listed there but the /my_context-Resources-Datasources gives: org.apache.jasper.JasperException: Exception retrieving attribute 'driverClassName' and the localhost_log.xxx.txt (when it tries to use myDS): java.sql.SQLException: Cannot load JDBC driver class 'null Any help would be great - I've been trying everything - reloading with different configurations about 50 times - looking through books, mailing lists/archives. Thanks, Ben _ Get 10MB of e-mail storage! Sign up for Hotmail Extra Storage. http://join.msn.com/?PAGE=features/es - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Fast, faster, fastest: Upgrade to Cable or DSL today! https://broadband.msn.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Cannot load JDBC driver class 'null'
I'm still not working after a fresh install of Tomcat. Maybe this is just a Oracle thing. I'm going to check with my DBA's here. Later, Robert Wynkoop -Original Message- From: Ben Anderson [mailto:[EMAIL PROTECTED] Sent: Thursday, September 11, 2003 8:04 AM To: [EMAIL PROTECTED] Subject: RE: Cannot load JDBC driver class 'null' I have the jar in $CATALINA_HOME/common/lib here's my info: Server Information Tomcat Version JVM Version JVM Vendor OS Name OS Version OS Architecture Apache Tomcat/4.1.241.4.1_02-b06Sun Microsystems Inc. Windows 2000 5.0 x86 -Ben From: Wynkoop, Robert M [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: 'Tomcat Users List' [EMAIL PROTECTED] Subject: RE: Cannot load JDBC driver class 'null' Date: Thu, 11 Sep 2003 08:57:35 -0400 I meant to say I can't delete the ../common/lib/classes12.jar when TomCat is running. Blip, Robert Wynkoop -Original Message- From: Wynkoop, Robert M Sent: Thursday, September 11, 2003 7:54 AM To: 'Tomcat Users List' Subject: RE: Cannot load JDBC driver class 'null' I'm having the same problem. From what I read the most common problem is that you jdbc driver jar is not in tomcatehome/common/lib dir. Apparently if its only the the web apps ../WEB-INF/lib the tomcat runtime does not have access to it. But, I still have the same problem. I know the jar file is getting used from ../common/lib because I can delete it when Tomkitty is fired up. What version of Tomcat are you using. I'm using V4.1.27LE(No sax parser included.) JDK 1.3. I'm currently doing a new install of tomcat LE. If that does not work I'm trying Tomcat standard from http://www.tux.org/pub/net/apache/dist/jakarta/tomcat-4/ Later, Rober Wynkoop -Original Message- From: Ben Anderson [mailto:[EMAIL PROTECTED] Sent: Thursday, September 11, 2003 7:17 AM To: [EMAIL PROTECTED] Subject: Cannot load JDBC driver class 'null' Ok, I know this topic has been posted many times, but I can't find anything to help. I have OracleDriver in [$CATALINA_HOME]/common/lib here's my server.xml GlobalNamingResources .. Resource name=myDS scope=Shareable type=javax.sql.DataSource auth=Container/ ResourceParams name=myDS parameter namevalidationQuery/name valueselect user from dual;/value /parameter parameter nameurl/name valuejdbc:oracle:thin:myMachine:1521:myDBName/value /parameter parameter nameusername/name valuehris/value /parameter parameter namepassword/name value/value /parameter parameter namemaxActive/name value4/value /parameter parameter namemaxWait/name value5000/value /parameter parameter namedriverClassName/name valueoracle.jdbc.driver.OracleDriver/value /parameter parameter namemaxIdle/name value2/value /parameter /ResourceParams /GlobalNamingResources and my web.xml: resource-ref res-ref-namejdbc/fsaDS/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth res-sharing-scopeShareable/res-sharing-scope /resource-ref in the administrative tool: the top level Resources-DataSources looks ok as MyDS is listed there but the /my_context-Resources-Datasources gives: org.apache.jasper.JasperException: Exception retrieving attribute 'driverClassName' and the localhost_log.xxx.txt (when it tries to use myDS): java.sql.SQLException: Cannot load JDBC driver class 'null Any help would be great - I've been trying everything - reloading with different configurations about 50 times - looking through books, mailing lists/archives. Thanks, Ben _ Get 10MB of e-mail storage! Sign up for Hotmail Extra Storage. http://join.msn.com/?PAGE=features/es - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Fast, faster, fastest: Upgrade to Cable or DSL today! https://broadband.msn.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL
RE: Cannot load JDBC driver class 'null'
Rather than changing your server XML create an xml file in your webapps directory with the same name as your app directory. Here is an example:- - Context className=org.apache.catalina.core.StandardContext crossContext=false reloadable=false mapperClass=org.apache.catalina.core.StandardContextMapper useNaming=true debug=0 swallowOutput=false privileged=false displayName=Shilton wrapperClass=org.apache.catalina.core.StandardWrapper docBase=C:/Tomcat4.1/webapps/shilton cookies=true path=/shilton cachingAllowed=true charsetMapperClass=org.apache.catalina.util.CharsetMapper Resource name=mail/Session scope=Shareable type=javax.mail.Session auth=Container description=Resource reference to a factory for javax.mail.Session instances that may be used for sending electronic mail messages, preconfigured to connect to the appropriate SMTP server. / Resource name=jdbc/shiltonDB auth=Container type=javax.sql.DataSource / - ResourceParams name=jdbc/shiltonDB - parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter - parameter namemaxActive/name value100/value /parameter - parameter namemaxIdle/name value5/value /parameter - parameter namemaxWait/name value100/value /parameter - parameter nameusername/name valueINTERNET/value /parameter - parameter namepassword/name value**/value /parameter - parameter namedriverClassName/name valuecom.ibm.as400.access.AS400JDBCDriver/value /parameter - parameter nameurl/name valuejdbc:as400://REX/value /parameter /ResourceParams /Context Stop and re-start Tomcat and hey presto!! OK I mine is for DB2 on an iSeries - by hey it works !! Anyway shouldn't your Web XML file have myDS not fsaDS. Good luck Kevin -Original Message- From: Ben Anderson [mailto:[EMAIL PROTECTED] Sent: 11 September 2003 13:17 To: [EMAIL PROTECTED] Subject: Cannot load JDBC driver class 'null' Ok, I know this topic has been posted many times, but I can't find anything to help. I have OracleDriver in [$CATALINA_HOME]/common/lib here's my server.xml GlobalNamingResources .. Resource name=myDS scope=Shareable type=javax.sql.DataSource auth=Container/ ResourceParams name=myDS parameter namevalidationQuery/name valueselect user from dual;/value /parameter parameter nameurl/name valuejdbc:oracle:thin:myMachine:1521:myDBName/value /parameter parameter nameusername/name valuehris/value /parameter parameter namepassword/name value/value /parameter parameter namemaxActive/name value4/value /parameter parameter namemaxWait/name value5000/value /parameter parameter namedriverClassName/name valueoracle.jdbc.driver.OracleDriver/value /parameter parameter namemaxIdle/name value2/value /parameter /ResourceParams /GlobalNamingResources and my web.xml: resource-ref res-ref-namejdbc/fsaDS/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth res-sharing-scopeShareable/res-sharing-scope /resource-ref in the administrative tool: the top level Resources-DataSources looks ok as MyDS is listed there but the /my_context-Resources-Datasources gives: org.apache.jasper.JasperException: Exception retrieving attribute 'driverClassName' and the localhost_log.xxx.txt (when it tries to use myDS): java.sql.SQLException: Cannot load JDBC driver class 'null Any help would be great - I've been trying everything - reloading with different configurations about 50 times - looking through books, mailing lists/archives. Thanks, Ben _ Get 10MB of e-mail storage! Sign up for Hotmail Extra Storage. http://join.msn.com/?PAGE=features/es - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Cannot load JDBC driver class 'null'
Assuming it's not a typo, your url is broken. It should be jdbc:oracle:thin:@myMachine:1521:myDBName not jdbc:oracle:thin:myMachine:1521:myDBName Note the '@' sign. I don't know if this would cause the error you are seeing. G. Wade Ben Anderson wrote: Ok, I know this topic has been posted many times, but I can't find anything to help. I have OracleDriver in [$CATALINA_HOME]/common/lib here's my server.xml GlobalNamingResources .. Resource name=myDS scope=Shareable type=javax.sql.DataSource auth=Container/ ResourceParams name=myDS parameter namevalidationQuery/name valueselect user from dual;/value /parameter parameter nameurl/name valuejdbc:oracle:thin:myMachine:1521:myDBName/value /parameter parameter nameusername/name valuehris/value /parameter parameter namepassword/name value/value /parameter parameter namemaxActive/name value4/value /parameter parameter namemaxWait/name value5000/value /parameter parameter namedriverClassName/name valueoracle.jdbc.driver.OracleDriver/value /parameter parameter namemaxIdle/name value2/value /parameter /ResourceParams /GlobalNamingResources and my web.xml: resource-ref res-ref-namejdbc/fsaDS/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth res-sharing-scopeShareable/res-sharing-scope /resource-ref in the administrative tool: the top level Resources-DataSources looks ok as MyDS is listed there but the /my_context-Resources-Datasources gives: org.apache.jasper.JasperException: Exception retrieving attribute 'driverClassName' and the localhost_log.xxx.txt (when it tries to use myDS): java.sql.SQLException: Cannot load JDBC driver class 'null Any help would be great - I've been trying everything - reloading with different configurations about 50 times - looking through books, mailing lists/archives. Thanks, Ben _ Get 10MB of e-mail storage! Sign up for Hotmail Extra Storage. http://join.msn.com/?PAGE=features/es - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Cannot load JDBC driver class 'null' - Tomcat standalone 4.1. 27 w hen trying instantiate datasource object.
Are you declaring the JNDI resource in DefaultContext or with ResourceLink? if yes, try with a normal Context and Resource. Regards, _ Manolo Ramirez T. Wynkoop, Robert M wrote: Yeah I had already tried that. When It was not there I got this message on Tomcat startup - java.lang.reflect.InvocationTargetException: java.lang.NoClassDefFoundError: javax/sql/DataSource I'm kind of stumped on this. Any other ideas? Later, Robert Wynkoop -Original Message- From: Phillip Qin [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 10, 2003 5:11 PM To: 'Tomcat Users List' Subject: RE: Cannot load JDBC driver class 'null' - Tomcat standalone 4.1. 27 w hen trying instantiate datasource object. If you use oracle jdbc driver, put classes12.jar in common/lib -Original Message- From: Wynkoop, Robert M [mailto:[EMAIL PROTECTED] Sent: September 10, 2003 6:06 PM To: Tomcat Mailing List (E-mail) Subject: Cannot load JDBC driver class 'null' - Tomcat standalone 4.1.27 w hen trying instantiate datasource object. The error(Wen I try to use a JNDI resource in my webapp.): C:\jdk1.3.1_08\jre\bin\java -classpath C:\web\Tomcat4.1\bin\bootstrap.jar;C:\jdk1.3.1_08\lib\tools.jar -Dcatalina.home=C:\web\Tomcat4.1 -Dcatalina.base=C:\web\Tomcat4.1 org.apache.catalina.startup.Bootstrap start [INFO] Registry - -Loading registry information [INFO] Registry - -Creating new Registry instance [INFO] Registry - -Creating MBeanServer [INFO] Http11Protocol - -Initializing Coyote HTTP/1.1 on port 8080 Starting service Tomcat-Standalone Apache Tomcat/4.1.18-LE-jdk14 [INFO] PropertyMessageResources - -Initializing, config='org.apache.struts.util.LocalStrings', returnNull=true [INFO] PropertyMessageResources - -Initializing, config='org.apache.struts.action.ActionResources', returnNull=true [INFO] PropertyMessageResources - -Initializing, config='remic_msgcat', returnNull=true [INFO] Http11Protocol - -Starting Coyote HTTP/1.1 on port 8080 [INFO] ChannelSocket - -JK2: ajp13 listening on 0.0.0.0/0.0.0.0:8009 [INFO] JkMain - -Jk running ID=0 time=0/200 config=C:\web\Tomcat4.1\conf\jk2.properties Cannot load JDBC driver class 'null' java.lang.NullPointerException at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:115) at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.jav a:523) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:3 29) at com.citimortgage.common.datasource.DataSourceManager.getConnection(DataSourc eManager.java:80) I know I have the Oracle jar in the right place because I get this msg when if I don't have it in tomcatHome/common/lib. C:\jdk1.3.1_08\jre\bin\java -classpath C:\web\Tomcat4.1\bin\bootstrap.jar;C:\jdk1.3.1_08\lib\tools.jar -Dcatalina.home=C:\web\Tomcat4.1 -Dcatalina.base=C:\web\Tomcat4.1 org.apache.catalina.startup.Bootstrap start [INFO] Registry - -Loading registry information [INFO] Registry - -Creating new Registry instance [INFO] Registry - -Creating MBeanServer [INFO] Http11Protocol - -Initializing Coyote HTTP/1.1 on port 8080 Exception during startup processing java.lang.reflect.InvocationTargetException: java.lang.NoClassDefFoundError: javax/sql/DataSource at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:488) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:106) I googled for this answer. The most common problem is not finding the database driver in tomcatHome/common/lib. Later, Robert Wynkoop - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Cannot load JDBC driver class 'null' and org.apache.jasper.Ja sperException: Exception retrieving attribute 'driverClassName'
I thought about this and then went into the Tomcat admin. Under service/localhost/contextmyapp When I click Datasource(under my apps context) I get the error: org.apache.jasper.JasperException: Exception retrieving attribute 'driverClassName' at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:2 54) in my browser window. My app is at p:.../somename/web/WEB-INF/. So are you telling me I need to create a file called web.xml. Can't do that. I already have my real web.xml there. Where can I find more information on this config file in the tomcat docs? Later, Robert Wynkoop -Original Message- From: Kevin Passey [mailto:[EMAIL PROTECTED] Sent: Thursday, September 11, 2003 8:26 AM To: 'Tomcat Users List' Subject: RE: Cannot load JDBC driver class 'null' Rather than changing your server XML create an xml file in your webapps directory with the same name as your app directory. Here is an example:- - Context className=org.apache.catalina.core.StandardContext crossContext=false reloadable=false mapperClass=org.apache.catalina.core.StandardContextMapper useNaming=true debug=0 swallowOutput=false privileged=false displayName=Shilton wrapperClass=org.apache.catalina.core.StandardWrapper docBase=C:/Tomcat4.1/webapps/shilton cookies=true path=/shilton cachingAllowed=true charsetMapperClass=org.apache.catalina.util.CharsetMapper Resource name=mail/Session scope=Shareable type=javax.mail.Session auth=Container description=Resource reference to a factory for javax.mail.Session instances that may be used for sending electronic mail messages, preconfigured to connect to the appropriate SMTP server. / Resource name=jdbc/shiltonDB auth=Container type=javax.sql.DataSource / - ResourceParams name=jdbc/shiltonDB - parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter - parameter namemaxActive/name value100/value /parameter - parameter namemaxIdle/name value5/value /parameter - parameter namemaxWait/name value100/value /parameter - parameter nameusername/name valueINTERNET/value /parameter - parameter namepassword/name value**/value /parameter - parameter namedriverClassName/name valuecom.ibm.as400.access.AS400JDBCDriver/value /parameter - parameter nameurl/name valuejdbc:as400://REX/value /parameter /ResourceParams /Context Stop and re-start Tomcat and hey presto!! OK I mine is for DB2 on an iSeries - by hey it works !! Anyway shouldn't your Web XML file have myDS not fsaDS. Good luck Kevin -Original Message- From: Ben Anderson [mailto:[EMAIL PROTECTED] Sent: 11 September 2003 13:17 To: [EMAIL PROTECTED] Subject: Cannot load JDBC driver class 'null' Ok, I know this topic has been posted many times, but I can't find anything to help. I have OracleDriver in [$CATALINA_HOME]/common/lib here's my server.xml GlobalNamingResources .. Resource name=myDS scope=Shareable type=javax.sql.DataSource auth=Container/ ResourceParams name=myDS parameter namevalidationQuery/name valueselect user from dual;/value /parameter parameter nameurl/name valuejdbc:oracle:thin:myMachine:1521:myDBName/value /parameter parameter nameusername/name valuehris/value /parameter parameter namepassword/name value/value /parameter parameter namemaxActive/name value4/value /parameter parameter namemaxWait/name value5000/value /parameter parameter namedriverClassName/name valueoracle.jdbc.driver.OracleDriver/value /parameter parameter namemaxIdle/name value2/value /parameter /ResourceParams /GlobalNamingResources and my web.xml: resource-ref res-ref-namejdbc/fsaDS/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth res-sharing-scopeShareable/res-sharing-scope /resource-ref in the administrative tool: the top level Resources-DataSources looks ok as MyDS is listed there but the /my_context-Resources-Datasources gives: org.apache.jasper.JasperException: Exception retrieving attribute 'driverClassName' and the localhost_log.xxx.txt (when it tries to use myDS): java.sql.SQLException: Cannot load JDBC driver class 'null Any help would be great - I've been trying everything - reloading with different configurations about 50 times - looking through books, mailing lists/archives. Thanks, Ben _ Get 10MB of e-mail storage! Sign up for Hotmail Extra Storage. http://join.msn.com/?PAGE=features/es - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED
RE: Cannot load JDBC driver class 'null' and org.apache.jasper.Ja sperException: Exception retrieving attribute 'driverClassName'
No the xml file should be called myapp.xml in webapps along with your war file Did you note my other comment about myDS and fsaDS that looks like it's more your problem. Leave it how you had it and just change that - stop and start tomcat and see if that flies. Regards Kevin -Original Message- From: Wynkoop, Robert M [mailto:[EMAIL PROTECTED] Sent: 11 September 2003 14:54 To: 'Tomcat Users List' Subject: RE: Cannot load JDBC driver class 'null' and org.apache.jasper.Ja sperException: Exception retrieving attribute 'driverClassName' I thought about this and then went into the Tomcat admin. Under service/localhost/contextmyapp When I click Datasource(under my apps context) I get the error: org.apache.jasper.JasperException: Exception retrieving attribute 'driverClassName' at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:2 54) in my browser window. My app is at p:.../somename/web/WEB-INF/. So are you telling me I need to create a file called web.xml. Can't do that. I already have my real web.xml there. Where can I find more information on this config file in the tomcat docs? Later, Robert Wynkoop -Original Message- From: Kevin Passey [mailto:[EMAIL PROTECTED] Sent: Thursday, September 11, 2003 8:26 AM To: 'Tomcat Users List' Subject: RE: Cannot load JDBC driver class 'null' Rather than changing your server XML create an xml file in your webapps directory with the same name as your app directory. Here is an example:- - Context className=org.apache.catalina.core.StandardContext crossContext=false reloadable=false mapperClass=org.apache.catalina.core.StandardContextMapper useNaming=true debug=0 swallowOutput=false privileged=false displayName=Shilton wrapperClass=org.apache.catalina.core.StandardWrapper docBase=C:/Tomcat4.1/webapps/shilton cookies=true path=/shilton cachingAllowed=true charsetMapperClass=org.apache.catalina.util.CharsetMapper Resource name=mail/Session scope=Shareable type=javax.mail.Session auth=Container description=Resource reference to a factory for javax.mail.Session instances that may be used for sending electronic mail messages, preconfigured to connect to the appropriate SMTP server. / Resource name=jdbc/shiltonDB auth=Container type=javax.sql.DataSource / - ResourceParams name=jdbc/shiltonDB - parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter - parameter namemaxActive/name value100/value /parameter - parameter namemaxIdle/name value5/value /parameter - parameter namemaxWait/name value100/value /parameter - parameter nameusername/name valueINTERNET/value /parameter - parameter namepassword/name value**/value /parameter - parameter namedriverClassName/name valuecom.ibm.as400.access.AS400JDBCDriver/value /parameter - parameter nameurl/name valuejdbc:as400://REX/value /parameter /ResourceParams /Context Stop and re-start Tomcat and hey presto!! OK I mine is for DB2 on an iSeries - by hey it works !! Anyway shouldn't your Web XML file have myDS not fsaDS. Good luck Kevin -Original Message- From: Ben Anderson [mailto:[EMAIL PROTECTED] Sent: 11 September 2003 13:17 To: [EMAIL PROTECTED] Subject: Cannot load JDBC driver class 'null' Ok, I know this topic has been posted many times, but I can't find anything to help. I have OracleDriver in [$CATALINA_HOME]/common/lib here's my server.xml GlobalNamingResources .. Resource name=myDS scope=Shareable type=javax.sql.DataSource auth=Container/ ResourceParams name=myDS parameter namevalidationQuery/name valueselect user from dual;/value /parameter parameter nameurl/name valuejdbc:oracle:thin:myMachine:1521:myDBName/value /parameter parameter nameusername/name valuehris/value /parameter parameter namepassword/name value/value /parameter parameter namemaxActive/name value4/value /parameter parameter namemaxWait/name value5000/value /parameter parameter namedriverClassName/name valueoracle.jdbc.driver.OracleDriver/value /parameter parameter namemaxIdle/name value2/value /parameter /ResourceParams /GlobalNamingResources and my web.xml: resource-ref res-ref-namejdbc/fsaDS/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth res-sharing-scopeShareable/res-sharing-scope /resource-ref in the administrative tool: the top level Resources-DataSources looks ok as MyDS is listed there but the /my_context-Resources-Datasources gives: org.apache.jasper.JasperException: Exception retrieving attribute 'driverClassName' and the localhost_log.xxx.txt (when it tries to use myDS): java.sql.SQLException: Cannot load JDBC
RE: Cannot load JDBC driver class 'null' - Tomcat standalone 4.1. 27 w hen trying instantiate datasource object.
I don't know how to answer other than I have it in: GlobalNamingResources When you say normal context, what are we talking about? :) Are talking about something like: !-- Tomcat Examples Context -- Context path=/examples blah, blah, blah. **snip Resource name=jdbc/EmployeeAppDb auth=SERVLET type=javax.sql.DataSource/ ResourceParams name=jdbc/EmployeeAppDb parameternameuser/namevaluesa/value/parameter parameternamepassword/namevalue//parameter parameternamedriverClassName/name valueorg.hsql.jdbcDriver/value/parameter parameternamedriverName/name valuejdbc:HypersonicSQL:database/value/parameter /ResourceParams /Context Thanks, Robert Wynkoop -Original Message- From: Manolo Ramirez T. [mailto:[EMAIL PROTECTED] Sent: Thursday, September 11, 2003 9:27 AM To: Tomcat Users List Subject: Re: Cannot load JDBC driver class 'null' - Tomcat standalone 4.1. 27 w hen trying instantiate datasource object. Are you declaring the JNDI resource in DefaultContext or with ResourceLink? if yes, try with a normal Context and Resource. Regards, _ Manolo Ramirez T. Wynkoop, Robert M wrote: Yeah I had already tried that. When It was not there I got this message on Tomcat startup - java.lang.reflect.InvocationTargetException: java.lang.NoClassDefFoundError: javax/sql/DataSource I'm kind of stumped on this. Any other ideas? Later, Robert Wynkoop -Original Message- From: Phillip Qin [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 10, 2003 5:11 PM To: 'Tomcat Users List' Subject: RE: Cannot load JDBC driver class 'null' - Tomcat standalone 4.1. 27 w hen trying instantiate datasource object. If you use oracle jdbc driver, put classes12.jar in common/lib -Original Message- From: Wynkoop, Robert M [mailto:[EMAIL PROTECTED] Sent: September 10, 2003 6:06 PM To: Tomcat Mailing List (E-mail) Subject: Cannot load JDBC driver class 'null' - Tomcat standalone 4.1.27 w hen trying instantiate datasource object. The error(Wen I try to use a JNDI resource in my webapp.): C:\jdk1.3.1_08\jre\bin\java -classpath C:\web\Tomcat4.1\bin\bootstrap.jar;C:\jdk1.3.1_08\lib\tools.jar -Dcatalina.home=C:\web\Tomcat4.1 -Dcatalina.base=C:\web\Tomcat4.1 org.apache.catalina.startup.Bootstrap start [INFO] Registry - -Loading registry information [INFO] Registry - -Creating new Registry instance [INFO] Registry - -Creating MBeanServer [INFO] Http11Protocol - -Initializing Coyote HTTP/1.1 on port 8080 Starting service Tomcat-Standalone Apache Tomcat/4.1.18-LE-jdk14 [INFO] PropertyMessageResources - -Initializing, config='org.apache.struts.util.LocalStrings', returnNull=true [INFO] PropertyMessageResources - -Initializing, config='org.apache.struts.action.ActionResources', returnNull=true [INFO] PropertyMessageResources - -Initializing, config='remic_msgcat', returnNull=true [INFO] Http11Protocol - -Starting Coyote HTTP/1.1 on port 8080 [INFO] ChannelSocket - -JK2: ajp13 listening on 0.0.0.0/0.0.0.0:8009 [INFO] JkMain - -Jk running ID=0 time=0/200 config=C:\web\Tomcat4.1\conf\jk2.properties Cannot load JDBC driver class 'null' java.lang.NullPointerException at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:115) at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.jav a:523) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:3 29) at com.citimortgage.common.datasource.DataSourceManager.getConnection(DataSourc eManager.java:80) I know I have the Oracle jar in the right place because I get this msg when if I don't have it in tomcatHome/common/lib. C:\jdk1.3.1_08\jre\bin\java -classpath C:\web\Tomcat4.1\bin\bootstrap.jar;C:\jdk1.3.1_08\lib\tools.jar -Dcatalina.home=C:\web\Tomcat4.1 -Dcatalina.base=C:\web\Tomcat4.1 org.apache.catalina.startup.Bootstrap start [INFO] Registry - -Loading registry information [INFO] Registry - -Creating new Registry instance [INFO] Registry - -Creating MBeanServer [INFO] Http11Protocol - -Initializing Coyote HTTP/1.1 on port 8080 Exception during startup processing java.lang.reflect.InvocationTargetException: java.lang.NoClassDefFoundError: javax/sql/DataSource at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:488) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:106) I googled for this answer. The most common problem is not finding the database driver in tomcatHome/common/lib. Later, Robert Wynkoop - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED
RE: Cannot load JDBC driver class 'null' and org.apache.jasper.Ja sperException: Exception retrieving attribute 'driverClassName'
I don't see your comments about myDS and fsaDS. Can you echo them again. :) Thanks, Robert Wynkoop -Original Message- From: Kevin Passey [mailto:[EMAIL PROTECTED] Sent: Thursday, September 11, 2003 8:55 AM To: 'Tomcat Users List' Subject: RE: Cannot load JDBC driver class 'null' and org.apache.jasper.Ja sperException: Exception retrieving attribute 'driverClassName' No the xml file should be called myapp.xml in webapps along with your war file Did you note my other comment about myDS and fsaDS that looks like it's more your problem. Leave it how you had it and just change that - stop and start tomcat and see if that flies. Regards Kevin -Original Message- From: Wynkoop, Robert M [mailto:[EMAIL PROTECTED] Sent: 11 September 2003 14:54 To: 'Tomcat Users List' Subject: RE: Cannot load JDBC driver class 'null' and org.apache.jasper.Ja sperException: Exception retrieving attribute 'driverClassName' I thought about this and then went into the Tomcat admin. Under service/localhost/contextmyapp When I click Datasource(under my apps context) I get the error: org.apache.jasper.JasperException: Exception retrieving attribute 'driverClassName' at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:2 54) in my browser window. My app is at p:.../somename/web/WEB-INF/. So are you telling me I need to create a file called web.xml. Can't do that. I already have my real web.xml there. Where can I find more information on this config file in the tomcat docs? Later, Robert Wynkoop -Original Message- From: Kevin Passey [mailto:[EMAIL PROTECTED] Sent: Thursday, September 11, 2003 8:26 AM To: 'Tomcat Users List' Subject: RE: Cannot load JDBC driver class 'null' Rather than changing your server XML create an xml file in your webapps directory with the same name as your app directory. Here is an example:- - Context className=org.apache.catalina.core.StandardContext crossContext=false reloadable=false mapperClass=org.apache.catalina.core.StandardContextMapper useNaming=true debug=0 swallowOutput=false privileged=false displayName=Shilton wrapperClass=org.apache.catalina.core.StandardWrapper docBase=C:/Tomcat4.1/webapps/shilton cookies=true path=/shilton cachingAllowed=true charsetMapperClass=org.apache.catalina.util.CharsetMapper Resource name=mail/Session scope=Shareable type=javax.mail.Session auth=Container description=Resource reference to a factory for javax.mail.Session instances that may be used for sending electronic mail messages, preconfigured to connect to the appropriate SMTP server. / Resource name=jdbc/shiltonDB auth=Container type=javax.sql.DataSource / - ResourceParams name=jdbc/shiltonDB - parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter - parameter namemaxActive/name value100/value /parameter - parameter namemaxIdle/name value5/value /parameter - parameter namemaxWait/name value100/value /parameter - parameter nameusername/name valueINTERNET/value /parameter - parameter namepassword/name value**/value /parameter - parameter namedriverClassName/name valuecom.ibm.as400.access.AS400JDBCDriver/value /parameter - parameter nameurl/name valuejdbc:as400://REX/value /parameter /ResourceParams /Context Stop and re-start Tomcat and hey presto!! OK I mine is for DB2 on an iSeries - by hey it works !! Anyway shouldn't your Web XML file have myDS not fsaDS. Good luck Kevin -Original Message- From: Ben Anderson [mailto:[EMAIL PROTECTED] Sent: 11 September 2003 13:17 To: [EMAIL PROTECTED] Subject: Cannot load JDBC driver class 'null' Ok, I know this topic has been posted many times, but I can't find anything to help. I have OracleDriver in [$CATALINA_HOME]/common/lib here's my server.xml GlobalNamingResources .. Resource name=myDS scope=Shareable type=javax.sql.DataSource auth=Container/ ResourceParams name=myDS parameter namevalidationQuery/name valueselect user from dual;/value /parameter parameter nameurl/name valuejdbc:oracle:thin:myMachine:1521:myDBName/value /parameter parameter nameusername/name valuehris/value /parameter parameter namepassword/name value/value /parameter parameter namemaxActive/name value4/value /parameter parameter namemaxWait/name value5000/value /parameter parameter namedriverClassName/name valueoracle.jdbc.driver.OracleDriver/value /parameter parameter namemaxIdle/name value2/value /parameter /ResourceParams /GlobalNamingResources and my web.xml: resource-ref res-ref-namejdbc/fsaDS/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth res-sharing
RE: Cannot load JDBC driver class 'null' and org.apache.jasper.Ja sperException:
whoops - the myDS and fsaDS was a copy and paste error on my part. Attempting to not include private info, I try to change everything to mySomething. This is not my problem - sorry about the mixup. I will try the myApp.xml solution. Thanks, Ben From: Wynkoop, Robert M [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: 'Tomcat Users List' [EMAIL PROTECTED] Subject: RE: Cannot load JDBC driver class 'null' and org.apache.jasper.Ja sperException: Exception retrieving attribute 'driverClassName' Date: Thu, 11 Sep 2003 10:06:12 -0400 I don't see your comments about myDS and fsaDS. Can you echo them again. :) Thanks, Robert Wynkoop -Original Message- From: Kevin Passey [mailto:[EMAIL PROTECTED] Sent: Thursday, September 11, 2003 8:55 AM To: 'Tomcat Users List' Subject: RE: Cannot load JDBC driver class 'null' and org.apache.jasper.Ja sperException: Exception retrieving attribute 'driverClassName' No the xml file should be called myapp.xml in webapps along with your war file Did you note my other comment about myDS and fsaDS that looks like it's more your problem. Leave it how you had it and just change that - stop and start tomcat and see if that flies. Regards Kevin -Original Message- From: Wynkoop, Robert M [mailto:[EMAIL PROTECTED] Sent: 11 September 2003 14:54 To: 'Tomcat Users List' Subject: RE: Cannot load JDBC driver class 'null' and org.apache.jasper.Ja sperException: Exception retrieving attribute 'driverClassName' I thought about this and then went into the Tomcat admin. Under service/localhost/contextmyapp When I click Datasource(under my apps context) I get the error: org.apache.jasper.JasperException: Exception retrieving attribute 'driverClassName' at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:2 54) in my browser window. My app is at p:.../somename/web/WEB-INF/. So are you telling me I need to create a file called web.xml. Can't do that. I already have my real web.xml there. Where can I find more information on this config file in the tomcat docs? Later, Robert Wynkoop -Original Message- From: Kevin Passey [mailto:[EMAIL PROTECTED] Sent: Thursday, September 11, 2003 8:26 AM To: 'Tomcat Users List' Subject: RE: Cannot load JDBC driver class 'null' Rather than changing your server XML create an xml file in your webapps directory with the same name as your app directory. Here is an example:- - Context className=org.apache.catalina.core.StandardContext crossContext=false reloadable=false mapperClass=org.apache.catalina.core.StandardContextMapper useNaming=true debug=0 swallowOutput=false privileged=false displayName=Shilton wrapperClass=org.apache.catalina.core.StandardWrapper docBase=C:/Tomcat4.1/webapps/shilton cookies=true path=/shilton cachingAllowed=true charsetMapperClass=org.apache.catalina.util.CharsetMapper Resource name=mail/Session scope=Shareable type=javax.mail.Session auth=Container description=Resource reference to a factory for javax.mail.Session instances that may be used for sending electronic mail messages, preconfigured to connect to the appropriate SMTP server. / Resource name=jdbc/shiltonDB auth=Container type=javax.sql.DataSource / - ResourceParams name=jdbc/shiltonDB - parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter - parameter namemaxActive/name value100/value /parameter - parameter namemaxIdle/name value5/value /parameter - parameter namemaxWait/name value100/value /parameter - parameter nameusername/name valueINTERNET/value /parameter - parameter namepassword/name value**/value /parameter - parameter namedriverClassName/name valuecom.ibm.as400.access.AS400JDBCDriver/value /parameter - parameter nameurl/name valuejdbc:as400://REX/value /parameter /ResourceParams /Context Stop and re-start Tomcat and hey presto!! OK I mine is for DB2 on an iSeries - by hey it works !! Anyway shouldn't your Web XML file have myDS not fsaDS. Good luck Kevin -Original Message- From: Ben Anderson [mailto:[EMAIL PROTECTED] Sent: 11 September 2003 13:17 To: [EMAIL PROTECTED] Subject: Cannot load JDBC driver class 'null' Ok, I know this topic has been posted many times, but I can't find anything to help. I have OracleDriver in [$CATALINA_HOME]/common/lib here's my server.xml GlobalNamingResources .. Resource name=myDS scope=Shareable type=javax.sql.DataSource auth=Container/ ResourceParams name=myDS parameter namevalidationQuery/name valueselect user from dual;/value /parameter parameter nameurl/name valuejdbc:oracle:thin:myMachine:1521:myDBName/value /parameter parameter nameusername/name valuehris/value /parameter parameter namepassword/name value/value /parameter parameter namemaxActive/name value4/value
RE: Cannot load JDBC driver class 'null'
My advice: 1. Never put jdbc in your classpath. It is in $CATALINA_HOME/common/lib/classes12.jar. Tomcat classloader handles it. 2. If you want to do a compile, use ant and put it in your ant script. Below is my setup Context path=/myapp docBase=myapp debug=5 reloadable=true crossContext=false Logger className=org.apache.catalina.logger.FileLogger prefix=myapp_log. suffix=.txt timestamp=true/ Resource name=jdbc/myapp auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/myapp parameter namedriverClassName/name valueoracle.jdbc.driver.OracleDriver/value /parameter parameter nameurl/name valuejdbc:oracle:thin:@myoracleserver.com:1521:PROD/value /parameter parameter nameusername/name value***/value /parameter parameter namepassword/name value***/value /parameter parameter namemaxActive/name value20/value /parameter parameter namemaxIdle/name value10/value /parameter parameter nameminIdle/name value10/value /parameter parameter namemaxWait/name value15000/value /parameter parameter nameremoveAbandoned/name valuetrue/value /parameter parameter namelogAbandoned/name valuetrue/value /parameter parameter namevalidationQuery/name valueSELECT SYSDATE FROM DUAL/value /parameter parameter nametestOnBorrow/name valuetrue/value /parameter parameter nameminEvictableIdleTimeMillis/name value-1/value /parameter !-- sleeps 5 minutes -- parameter nametimeBetweenEvictionRunsMillis/name value30/value /parameter parameter namenumTestsPerEvictionRun/name value1/value /parameter parameter nametestWhileIdle/name valuetrue/value /parameter /ResourceParams /Context In web.xml: resource-ref descriptionOracle Datasource/description res-ref-namejdbc/myapp/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref -Original Message- From: Ben Anderson [mailto:[EMAIL PROTECTED] Sent: September 11, 2003 8:17 AM To: [EMAIL PROTECTED] Subject: Cannot load JDBC driver class 'null' Ok, I know this topic has been posted many times, but I can't find anything to help. I have OracleDriver in [$CATALINA_HOME]/common/lib here's my server.xml GlobalNamingResources .. Resource name=myDS scope=Shareable type=javax.sql.DataSource auth=Container/ ResourceParams name=myDS parameter namevalidationQuery/name valueselect user from dual;/value /parameter parameter nameurl/name valuejdbc:oracle:thin:myMachine:1521:myDBName/value /parameter parameter nameusername/name valuehris/value /parameter parameter namepassword/name value/value /parameter parameter namemaxActive/name value4/value /parameter parameter namemaxWait/name value5000/value /parameter parameter namedriverClassName/name valueoracle.jdbc.driver.OracleDriver/value /parameter parameter namemaxIdle/name value2/value /parameter /ResourceParams /GlobalNamingResources and my web.xml: resource-ref res-ref-namejdbc/fsaDS/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth res-sharing-scopeShareable/res-sharing-scope /resource-ref in the administrative tool: the top level Resources-DataSources looks ok as MyDS is listed there but the /my_context-Resources-Datasources gives: org.apache.jasper.JasperException: Exception retrieving attribute 'driverClassName' and the localhost_log.xxx.txt (when it tries to use myDS): java.sql.SQLException: Cannot load JDBC driver class 'null Any help would be great - I've been trying everything - reloading with different configurations about 50 times - looking through books, mailing lists/archives. Thanks, Ben _ Get 10MB of e-mail storage! Sign up for Hotmail Extra Storage. http://join.msn.com/?PAGE=features/es - To unsubscribe, e-mail: [EMAIL PROTECTED
Re: Cannot load JDBC driver class 'null' - Tomcat standalone 4.1. 27 w hen trying instantiate datasource object.
Yep, that's what I'm talking about, check the archives, some people had problems with ResourceLink's and DefaultContext. Defining your context in a myApp.xml is the best option to avoid it, you must to follow Phillip Qin advise. Happy Coding! Regards, __ Manolo Ramirez T. Wynkoop, Robert M wrote: I don't know how to answer other than I have it in: GlobalNamingResources When you say normal context, what are we talking about? :) Are talking about something like: !-- Tomcat Examples Context -- Context path=/examples blah, blah, blah. **snip Resource name=jdbc/EmployeeAppDb auth=SERVLET type=javax.sql.DataSource/ ResourceParams name=jdbc/EmployeeAppDb parameternameuser/namevaluesa/value/parameter parameternamepassword/namevalue//parameter parameternamedriverClassName/name valueorg.hsql.jdbcDriver/value/parameter parameternamedriverName/name valuejdbc:HypersonicSQL:database/value/parameter /ResourceParams /Context Thanks, Robert Wynkoop -Original Message- From: Manolo Ramirez T. [mailto:[EMAIL PROTECTED] Sent: Thursday, September 11, 2003 9:27 AM To: Tomcat Users List Subject: Re: Cannot load JDBC driver class 'null' - Tomcat standalone 4.1. 27 w hen trying instantiate datasource object. Are you declaring the JNDI resource in DefaultContext or with ResourceLink? if yes, try with a normal Context and Resource. Regards, _ Manolo Ramirez T. Wynkoop, Robert M wrote: Yeah I had already tried that. When It was not there I got this message on Tomcat startup - java.lang.reflect.InvocationTargetException: java.lang.NoClassDefFoundError: javax/sql/DataSource I'm kind of stumped on this. Any other ideas? Later, Robert Wynkoop -Original Message- From: Phillip Qin [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 10, 2003 5:11 PM To: 'Tomcat Users List' Subject: RE: Cannot load JDBC driver class 'null' - Tomcat standalone 4.1. 27 w hen trying instantiate datasource object. If you use oracle jdbc driver, put classes12.jar in common/lib -Original Message- From: Wynkoop, Robert M [mailto:[EMAIL PROTECTED] Sent: September 10, 2003 6:06 PM To: Tomcat Mailing List (E-mail) Subject: Cannot load JDBC driver class 'null' - Tomcat standalone 4.1.27 w hen trying instantiate datasource object. The error(Wen I try to use a JNDI resource in my webapp.): C:\jdk1.3.1_08\jre\bin\java -classpath C:\web\Tomcat4.1\bin\bootstrap.jar;C:\jdk1.3.1_08\lib\tools.jar -Dcatalina.home=C:\web\Tomcat4.1 -Dcatalina.base=C:\web\Tomcat4.1 org.apache.catalina.startup.Bootstrap start [INFO] Registry - -Loading registry information [INFO] Registry - -Creating new Registry instance [INFO] Registry - -Creating MBeanServer [INFO] Http11Protocol - -Initializing Coyote HTTP/1.1 on port 8080 Starting service Tomcat-Standalone Apache Tomcat/4.1.18-LE-jdk14 [INFO] PropertyMessageResources - -Initializing, config='org.apache.struts.util.LocalStrings', returnNull=true [INFO] PropertyMessageResources - -Initializing, config='org.apache.struts.action.ActionResources', returnNull=true [INFO] PropertyMessageResources - -Initializing, config='remic_msgcat', returnNull=true [INFO] Http11Protocol - -Starting Coyote HTTP/1.1 on port 8080 [INFO] ChannelSocket - -JK2: ajp13 listening on 0.0.0.0/0.0.0.0:8009 [INFO] JkMain - -Jk running ID=0 time=0/200 config=C:\web\Tomcat4.1\conf\jk2.properties Cannot load JDBC driver class 'null' java.lang.NullPointerException at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:115) at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.jav a:523) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:3 29) at com.citimortgage.common.datasource.DataSourceManager.getConnection(DataSourc eManager.java:80) I know I have the Oracle jar in the right place because I get this msg when if I don't have it in tomcatHome/common/lib. C:\jdk1.3.1_08\jre\bin\java -classpath C:\web\Tomcat4.1\bin\bootstrap.jar;C:\jdk1.3.1_08\lib\tools.jar -Dcatalina.home=C:\web\Tomcat4.1 -Dcatalina.base=C:\web\Tomcat4.1 org.apache.catalina.startup.Bootstrap start [INFO] Registry - -Loading registry information [INFO] Registry - -Creating new Registry instance [INFO] Registry - -Creating MBeanServer [INFO] Http11Protocol - -Initializing Coyote HTTP/1.1 on port 8080 Exception during startup processing java.lang.reflect.InvocationTargetException: java.lang.NoClassDefFoundError: javax/sql/DataSource at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:488) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:106) I googled for this answer. The most common problem is not finding the database driver in tomcatHome/common/lib. Later, Robert Wynkoop
RE: Cannot load JDBC driver class 'null' - Tomcat standalone 4.1. 27 w hen trying instantiate datasource object.
I moved the resources to the webApps context in server.xml. Now I'm getting this error when I try to get a connection. java.lang.UnsupportedOperationException at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.ja va:125) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:3 29) I will check my jar versions. Has anyone seen this? Later, Robert Wynkoop -Original Message- From: Manolo Ramirez T. [mailto:[EMAIL PROTECTED] Sent: Thursday, September 11, 2003 10:44 AM To: Tomcat Users List Subject: Re: Cannot load JDBC driver class 'null' - Tomcat standalone 4.1. 27 w hen trying instantiate datasource object. Yep, that's what I'm talking about, check the archives, some people had problems with ResourceLink's and DefaultContext. Defining your context in a myApp.xml is the best option to avoid it, you must to follow Phillip Qin advise. Happy Coding! Regards, __ Manolo Ramirez T. Wynkoop, Robert M wrote: I don't know how to answer other than I have it in: GlobalNamingResources When you say normal context, what are we talking about? :) Are talking about something like: !-- Tomcat Examples Context -- Context path=/examples blah, blah, blah. **snip Resource name=jdbc/EmployeeAppDb auth=SERVLET type=javax.sql.DataSource/ ResourceParams name=jdbc/EmployeeAppDb parameternameuser/namevaluesa/value/parameter parameternamepassword/namevalue//parameter parameternamedriverClassName/name valueorg.hsql.jdbcDriver/value/parameter parameternamedriverName/name valuejdbc:HypersonicSQL:database/value/parameter /ResourceParams /Context Thanks, Robert Wynkoop -Original Message- From: Manolo Ramirez T. [mailto:[EMAIL PROTECTED] Sent: Thursday, September 11, 2003 9:27 AM To: Tomcat Users List Subject: Re: Cannot load JDBC driver class 'null' - Tomcat standalone 4.1. 27 w hen trying instantiate datasource object. Are you declaring the JNDI resource in DefaultContext or with ResourceLink? if yes, try with a normal Context and Resource. Regards, _ Manolo Ramirez T. Wynkoop, Robert M wrote: Yeah I had already tried that. When It was not there I got this message on Tomcat startup - java.lang.reflect.InvocationTargetException: java.lang.NoClassDefFoundError: javax/sql/DataSource I'm kind of stumped on this. Any other ideas? Later, Robert Wynkoop -Original Message- From: Phillip Qin [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 10, 2003 5:11 PM To: 'Tomcat Users List' Subject: RE: Cannot load JDBC driver class 'null' - Tomcat standalone 4.1. 27 w hen trying instantiate datasource object. If you use oracle jdbc driver, put classes12.jar in common/lib -Original Message- From: Wynkoop, Robert M [mailto:[EMAIL PROTECTED] Sent: September 10, 2003 6:06 PM To: Tomcat Mailing List (E-mail) Subject: Cannot load JDBC driver class 'null' - Tomcat standalone 4.1.27 w hen trying instantiate datasource object. The error(Wen I try to use a JNDI resource in my webapp.): C:\jdk1.3.1_08\jre\bin\java -classpath C:\web\Tomcat4.1\bin\bootstrap.jar;C:\jdk1.3.1_08\lib\tools.jar -Dcatalina.home=C:\web\Tomcat4.1 -Dcatalina.base=C:\web\Tomcat4.1 org.apache.catalina.startup.Bootstrap start [INFO] Registry - -Loading registry information [INFO] Registry - -Creating new Registry instance [INFO] Registry - -Creating MBeanServer [INFO] Http11Protocol - -Initializing Coyote HTTP/1.1 on port 8080 Starting service Tomcat-Standalone Apache Tomcat/4.1.18-LE-jdk14 [INFO] PropertyMessageResources - -Initializing, config='org.apache.struts.util.LocalStrings', returnNull=true [INFO] PropertyMessageResources - -Initializing, config='org.apache.struts.action.ActionResources', returnNull=true [INFO] PropertyMessageResources - -Initializing, config='remic_msgcat', returnNull=true [INFO] Http11Protocol - -Starting Coyote HTTP/1.1 on port 8080 [INFO] ChannelSocket - -JK2: ajp13 listening on 0.0.0.0/0.0.0.0:8009 [INFO] JkMain - -Jk running ID=0 time=0/200 config=C:\web\Tomcat4.1\conf\jk2.properties Cannot load JDBC driver class 'null' java.lang.NullPointerException at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:115) at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.jav a:523) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:3 29) at com.citimortgage.common.datasource.DataSourceManager.getConnection(DataSourc eManager.java:80) I know I have the Oracle jar in the right place because I get this msg when if I don't have it in tomcatHome/common/lib. C:\jdk1.3.1_08\jre\bin\java -classpath C:\web\Tomcat4.1\bin\bootstrap.jar;C:\jdk1.3.1_08\lib\tools.jar -Dcatalina.home=C:\web\Tomcat4.1 -Dcatalina.base=C
RE: Cannot load JDBC driver class 'null'
I moved the Resource and ResaourceParams tags to myApp.xml and put it in the webapps folder(with the war). I'm still getting the exact same errors. From: Phillip Qin [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: 'Tomcat Users List' [EMAIL PROTECTED] Subject: RE: Cannot load JDBC driver class 'null' Date: Thu, 11 Sep 2003 10:32:47 -0400 My advice: 1. Never put jdbc in your classpath. It is in $CATALINA_HOME/common/lib/classes12.jar. Tomcat classloader handles it. 2. If you want to do a compile, use ant and put it in your ant script. Below is my setup Context path=/myapp docBase=myapp debug=5 reloadable=true crossContext=false Logger className=org.apache.catalina.logger.FileLogger prefix=myapp_log. suffix=.txt timestamp=true/ Resource name=jdbc/myapp auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/myapp parameter namedriverClassName/name valueoracle.jdbc.driver.OracleDriver/value /parameter parameter nameurl/name valuejdbc:oracle:thin:@myoracleserver.com:1521:PROD/value /parameter parameter nameusername/name value***/value /parameter parameter namepassword/name value***/value /parameter parameter namemaxActive/name value20/value /parameter parameter namemaxIdle/name value10/value /parameter parameter nameminIdle/name value10/value /parameter parameter namemaxWait/name value15000/value /parameter parameter nameremoveAbandoned/name valuetrue/value /parameter parameter namelogAbandoned/name valuetrue/value /parameter parameter namevalidationQuery/name valueSELECT SYSDATE FROM DUAL/value /parameter parameter nametestOnBorrow/name valuetrue/value /parameter parameter nameminEvictableIdleTimeMillis/name value-1/value /parameter !-- sleeps 5 minutes -- parameter nametimeBetweenEvictionRunsMillis/name value30/value /parameter parameter namenumTestsPerEvictionRun/name value1/value /parameter parameter nametestWhileIdle/name valuetrue/value /parameter /ResourceParams /Context In web.xml: resource-ref descriptionOracle Datasource/description res-ref-namejdbc/myapp/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref -Original Message- From: Ben Anderson [mailto:[EMAIL PROTECTED] Sent: September 11, 2003 8:17 AM To: [EMAIL PROTECTED] Subject: Cannot load JDBC driver class 'null' Ok, I know this topic has been posted many times, but I can't find anything to help. I have OracleDriver in [$CATALINA_HOME]/common/lib here's my server.xml GlobalNamingResources .. Resource name=myDS scope=Shareable type=javax.sql.DataSource auth=Container/ ResourceParams name=myDS parameter namevalidationQuery/name valueselect user from dual;/value /parameter parameter nameurl/name valuejdbc:oracle:thin:myMachine:1521:myDBName/value /parameter parameter nameusername/name valuehris/value /parameter parameter namepassword/name value/value /parameter parameter namemaxActive/name value4/value /parameter parameter namemaxWait/name value5000/value /parameter parameter namedriverClassName/name valueoracle.jdbc.driver.OracleDriver/value /parameter parameter namemaxIdle/name value2/value /parameter /ResourceParams /GlobalNamingResources and my web.xml: resource-ref res-ref-namejdbc/fsaDS/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth res-sharing-scopeShareable/res-sharing-scope /resource-ref in the administrative tool: the top level Resources-DataSources looks ok as MyDS is listed there but the /my_context-Resources-Datasources gives: org.apache.jasper.JasperException: Exception retrieving attribute 'driverClassName' and the localhost_log.xxx.txt (when it tries to use myDS): java.sql.SQLException: Cannot load JDBC driver class 'null Any help would be great - I've been trying everything - reloading with different configurations about 50 times - looking through
RE: Cannot load JDBC driver class 'null' - Tomcat standalone 4.1. 27 w hen trying instantiate datasource object.
Reply to myself. Dam - commons-dbcp.jar does not support: getConnection(String uname, String passwd) throws SQLException. Only. getConnection() throws SQLException I guess I need to talk to the comons-dbcp group. So why did I have to move the resources to the webApp group to make this work? P.S. - So moving the resources to the webApp context did fix my problem. Later, Robert Wynkoop -Original Message- From: Wynkoop, Robert M Sent: Thursday, September 11, 2003 10:53 AM To: 'Tomcat Users List' Subject: RE: Cannot load JDBC driver class 'null' - Tomcat standalone 4.1. 27 w hen trying instantiate datasource object. I moved the resources to the webApps context in server.xml. Now I'm getting this error when I try to get a connection. java.lang.UnsupportedOperationException at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.ja va:125) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:3 29) I will check my jar versions. Has anyone seen this? Later, Robert Wynkoop -Original Message- From: Manolo Ramirez T. [mailto:[EMAIL PROTECTED] Sent: Thursday, September 11, 2003 10:44 AM To: Tomcat Users List Subject: Re: Cannot load JDBC driver class 'null' - Tomcat standalone 4.1. 27 w hen trying instantiate datasource object. Yep, that's what I'm talking about, check the archives, some people had problems with ResourceLink's and DefaultContext. Defining your context in a myApp.xml is the best option to avoid it, you must to follow Phillip Qin advise. Happy Coding! Regards, __ Manolo Ramirez T. Wynkoop, Robert M wrote: I don't know how to answer other than I have it in: GlobalNamingResources When you say normal context, what are we talking about? :) Are talking about something like: !-- Tomcat Examples Context -- Context path=/examples blah, blah, blah. **snip Resource name=jdbc/EmployeeAppDb auth=SERVLET type=javax.sql.DataSource/ ResourceParams name=jdbc/EmployeeAppDb parameternameuser/namevaluesa/value/parameter parameternamepassword/namevalue//parameter parameternamedriverClassName/name valueorg.hsql.jdbcDriver/value/parameter parameternamedriverName/name valuejdbc:HypersonicSQL:database/value/parameter /ResourceParams /Context Thanks, Robert Wynkoop -Original Message- From: Manolo Ramirez T. [mailto:[EMAIL PROTECTED] Sent: Thursday, September 11, 2003 9:27 AM To: Tomcat Users List Subject: Re: Cannot load JDBC driver class 'null' - Tomcat standalone 4.1. 27 w hen trying instantiate datasource object. Are you declaring the JNDI resource in DefaultContext or with ResourceLink? if yes, try with a normal Context and Resource. Regards, _ Manolo Ramirez T. Wynkoop, Robert M wrote: Yeah I had already tried that. When It was not there I got this message on Tomcat startup - java.lang.reflect.InvocationTargetException: java.lang.NoClassDefFoundError: javax/sql/DataSource I'm kind of stumped on this. Any other ideas? Later, Robert Wynkoop -Original Message- From: Phillip Qin [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 10, 2003 5:11 PM To: 'Tomcat Users List' Subject: RE: Cannot load JDBC driver class 'null' - Tomcat standalone 4.1. 27 w hen trying instantiate datasource object. If you use oracle jdbc driver, put classes12.jar in common/lib -Original Message- From: Wynkoop, Robert M [mailto:[EMAIL PROTECTED] Sent: September 10, 2003 6:06 PM To: Tomcat Mailing List (E-mail) Subject: Cannot load JDBC driver class 'null' - Tomcat standalone 4.1.27 w hen trying instantiate datasource object. The error(Wen I try to use a JNDI resource in my webapp.): C:\jdk1.3.1_08\jre\bin\java -classpath C:\web\Tomcat4.1\bin\bootstrap.jar;C:\jdk1.3.1_08\lib\tools.jar -Dcatalina.home=C:\web\Tomcat4.1 -Dcatalina.base=C:\web\Tomcat4.1 org.apache.catalina.startup.Bootstrap start [INFO] Registry - -Loading registry information [INFO] Registry - -Creating new Registry instance [INFO] Registry - -Creating MBeanServer [INFO] Http11Protocol - -Initializing Coyote HTTP/1.1 on port 8080 Starting service Tomcat-Standalone Apache Tomcat/4.1.18-LE-jdk14 [INFO] PropertyMessageResources - -Initializing, config='org.apache.struts.util.LocalStrings', returnNull=true [INFO] PropertyMessageResources - -Initializing, config='org.apache.struts.action.ActionResources', returnNull=true [INFO] PropertyMessageResources - -Initializing, config='remic_msgcat', returnNull=true [INFO] Http11Protocol - -Starting Coyote HTTP/1.1 on port 8080 [INFO] ChannelSocket - -JK2: ajp13 listening on 0.0.0.0/0.0.0.0:8009 [INFO] JkMain - -Jk running ID=0 time=0/200 config=C:\web\Tomcat4.1\conf\jk2.properties Cannot load JDBC driver class 'null' java.lang.NullPointerException at java.lang.Class.forName0(Native Method
Cannot load JDBC driver class 'null' - Tomcat standalone 4.1.27 w hen trying instantiate datasource object.
The error(Wen I try to use a JNDI resource in my webapp.): C:\jdk1.3.1_08\jre\bin\java -classpath C:\web\Tomcat4.1\bin\bootstrap.jar;C:\jdk1.3.1_08\lib\tools.jar -Dcatalina.home=C:\web\Tomcat4.1 -Dcatalina.base=C:\web\Tomcat4.1 org.apache.catalina.startup.Bootstrap start [INFO] Registry - -Loading registry information [INFO] Registry - -Creating new Registry instance [INFO] Registry - -Creating MBeanServer [INFO] Http11Protocol - -Initializing Coyote HTTP/1.1 on port 8080 Starting service Tomcat-Standalone Apache Tomcat/4.1.18-LE-jdk14 [INFO] PropertyMessageResources - -Initializing, config='org.apache.struts.util.LocalStrings', returnNull=true [INFO] PropertyMessageResources - -Initializing, config='org.apache.struts.action.ActionResources', returnNull=true [INFO] PropertyMessageResources - -Initializing, config='remic_msgcat', returnNull=true [INFO] Http11Protocol - -Starting Coyote HTTP/1.1 on port 8080 [INFO] ChannelSocket - -JK2: ajp13 listening on 0.0.0.0/0.0.0.0:8009 [INFO] JkMain - -Jk running ID=0 time=0/200 config=C:\web\Tomcat4.1\conf\jk2.properties Cannot load JDBC driver class 'null' java.lang.NullPointerException at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:115) at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.jav a:523) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:3 29) at com.citimortgage.common.datasource.DataSourceManager.getConnection(DataSourc eManager.java:80) I know I have the Oracle jar in the right place because I get this msg when if I don't have it in tomcatHome/common/lib. C:\jdk1.3.1_08\jre\bin\java -classpath C:\web\Tomcat4.1\bin\bootstrap.jar;C:\jdk1.3.1_08\lib\tools.jar -Dcatalina.home=C:\web\Tomcat4.1 -Dcatalina.base=C:\web\Tomcat4.1 org.apache.catalina.startup.Bootstrap start [INFO] Registry - -Loading registry information [INFO] Registry - -Creating new Registry instance [INFO] Registry - -Creating MBeanServer [INFO] Http11Protocol - -Initializing Coyote HTTP/1.1 on port 8080 Exception during startup processing java.lang.reflect.InvocationTargetException: java.lang.NoClassDefFoundError: javax/sql/DataSource at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:488) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:106) I googled for this answer. The most common problem is not finding the database driver in tomcatHome/common/lib. Later, Robert Wynkoop - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Cannot load JDBC driver class 'null' - Tomcat standalone 4.1. 27 w hen trying instantiate datasource object.
If you use oracle jdbc driver, put classes12.jar in common/lib -Original Message- From: Wynkoop, Robert M [mailto:[EMAIL PROTECTED] Sent: September 10, 2003 6:06 PM To: Tomcat Mailing List (E-mail) Subject: Cannot load JDBC driver class 'null' - Tomcat standalone 4.1.27 w hen trying instantiate datasource object. The error(Wen I try to use a JNDI resource in my webapp.): C:\jdk1.3.1_08\jre\bin\java -classpath C:\web\Tomcat4.1\bin\bootstrap.jar;C:\jdk1.3.1_08\lib\tools.jar -Dcatalina.home=C:\web\Tomcat4.1 -Dcatalina.base=C:\web\Tomcat4.1 org.apache.catalina.startup.Bootstrap start [INFO] Registry - -Loading registry information [INFO] Registry - -Creating new Registry instance [INFO] Registry - -Creating MBeanServer [INFO] Http11Protocol - -Initializing Coyote HTTP/1.1 on port 8080 Starting service Tomcat-Standalone Apache Tomcat/4.1.18-LE-jdk14 [INFO] PropertyMessageResources - -Initializing, config='org.apache.struts.util.LocalStrings', returnNull=true [INFO] PropertyMessageResources - -Initializing, config='org.apache.struts.action.ActionResources', returnNull=true [INFO] PropertyMessageResources - -Initializing, config='remic_msgcat', returnNull=true [INFO] Http11Protocol - -Starting Coyote HTTP/1.1 on port 8080 [INFO] ChannelSocket - -JK2: ajp13 listening on 0.0.0.0/0.0.0.0:8009 [INFO] JkMain - -Jk running ID=0 time=0/200 config=C:\web\Tomcat4.1\conf\jk2.properties Cannot load JDBC driver class 'null' java.lang.NullPointerException at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:115) at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.jav a:523) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:3 29) at com.citimortgage.common.datasource.DataSourceManager.getConnection(DataSourc eManager.java:80) I know I have the Oracle jar in the right place because I get this msg when if I don't have it in tomcatHome/common/lib. C:\jdk1.3.1_08\jre\bin\java -classpath C:\web\Tomcat4.1\bin\bootstrap.jar;C:\jdk1.3.1_08\lib\tools.jar -Dcatalina.home=C:\web\Tomcat4.1 -Dcatalina.base=C:\web\Tomcat4.1 org.apache.catalina.startup.Bootstrap start [INFO] Registry - -Loading registry information [INFO] Registry - -Creating new Registry instance [INFO] Registry - -Creating MBeanServer [INFO] Http11Protocol - -Initializing Coyote HTTP/1.1 on port 8080 Exception during startup processing java.lang.reflect.InvocationTargetException: java.lang.NoClassDefFoundError: javax/sql/DataSource at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:488) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:106) I googled for this answer. The most common problem is not finding the database driver in tomcatHome/common/lib. Later, Robert Wynkoop - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Cannot load JDBC driver class 'null' - Tomcat standalone 4.1. 27 w hen trying instantiate datasource object.
Yeah I had already tried that. When It was not there I got this message on Tomcat startup - java.lang.reflect.InvocationTargetException: java.lang.NoClassDefFoundError: javax/sql/DataSource I'm kind of stumped on this. Any other ideas? Later, Robert Wynkoop -Original Message- From: Phillip Qin [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 10, 2003 5:11 PM To: 'Tomcat Users List' Subject: RE: Cannot load JDBC driver class 'null' - Tomcat standalone 4.1. 27 w hen trying instantiate datasource object. If you use oracle jdbc driver, put classes12.jar in common/lib -Original Message- From: Wynkoop, Robert M [mailto:[EMAIL PROTECTED] Sent: September 10, 2003 6:06 PM To: Tomcat Mailing List (E-mail) Subject: Cannot load JDBC driver class 'null' - Tomcat standalone 4.1.27 w hen trying instantiate datasource object. The error(Wen I try to use a JNDI resource in my webapp.): C:\jdk1.3.1_08\jre\bin\java -classpath C:\web\Tomcat4.1\bin\bootstrap.jar;C:\jdk1.3.1_08\lib\tools.jar -Dcatalina.home=C:\web\Tomcat4.1 -Dcatalina.base=C:\web\Tomcat4.1 org.apache.catalina.startup.Bootstrap start [INFO] Registry - -Loading registry information [INFO] Registry - -Creating new Registry instance [INFO] Registry - -Creating MBeanServer [INFO] Http11Protocol - -Initializing Coyote HTTP/1.1 on port 8080 Starting service Tomcat-Standalone Apache Tomcat/4.1.18-LE-jdk14 [INFO] PropertyMessageResources - -Initializing, config='org.apache.struts.util.LocalStrings', returnNull=true [INFO] PropertyMessageResources - -Initializing, config='org.apache.struts.action.ActionResources', returnNull=true [INFO] PropertyMessageResources - -Initializing, config='remic_msgcat', returnNull=true [INFO] Http11Protocol - -Starting Coyote HTTP/1.1 on port 8080 [INFO] ChannelSocket - -JK2: ajp13 listening on 0.0.0.0/0.0.0.0:8009 [INFO] JkMain - -Jk running ID=0 time=0/200 config=C:\web\Tomcat4.1\conf\jk2.properties Cannot load JDBC driver class 'null' java.lang.NullPointerException at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:115) at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.jav a:523) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:3 29) at com.citimortgage.common.datasource.DataSourceManager.getConnection(DataSourc eManager.java:80) I know I have the Oracle jar in the right place because I get this msg when if I don't have it in tomcatHome/common/lib. C:\jdk1.3.1_08\jre\bin\java -classpath C:\web\Tomcat4.1\bin\bootstrap.jar;C:\jdk1.3.1_08\lib\tools.jar -Dcatalina.home=C:\web\Tomcat4.1 -Dcatalina.base=C:\web\Tomcat4.1 org.apache.catalina.startup.Bootstrap start [INFO] Registry - -Loading registry information [INFO] Registry - -Creating new Registry instance [INFO] Registry - -Creating MBeanServer [INFO] Http11Protocol - -Initializing Coyote HTTP/1.1 on port 8080 Exception during startup processing java.lang.reflect.InvocationTargetException: java.lang.NoClassDefFoundError: javax/sql/DataSource at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:488) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:106) I googled for this answer. The most common problem is not finding the database driver in tomcatHome/common/lib. Later, Robert Wynkoop - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Cannot load JDBC driver class 'null' - Tomcat standalone 4.1. 27 w hen trying instantiate datasource object.
what JDK are you using? Filip - Original Message - From: Wynkoop, Robert M [EMAIL PROTECTED] To: 'Tomcat Users List' [EMAIL PROTECTED] Sent: Wednesday, September 10, 2003 3:14 PM Subject: RE: Cannot load JDBC driver class 'null' - Tomcat standalone 4.1. 27 w hen trying instantiate datasource object. Yeah I had already tried that. When It was not there I got this message on Tomcat startup - java.lang.reflect.InvocationTargetException: java.lang.NoClassDefFoundError: javax/sql/DataSource I'm kind of stumped on this. Any other ideas? Later, Robert Wynkoop -Original Message- From: Phillip Qin [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 10, 2003 5:11 PM To: 'Tomcat Users List' Subject: RE: Cannot load JDBC driver class 'null' - Tomcat standalone 4.1. 27 w hen trying instantiate datasource object. If you use oracle jdbc driver, put classes12.jar in common/lib -Original Message- From: Wynkoop, Robert M [mailto:[EMAIL PROTECTED] Sent: September 10, 2003 6:06 PM To: Tomcat Mailing List (E-mail) Subject: Cannot load JDBC driver class 'null' - Tomcat standalone 4.1.27 w hen trying instantiate datasource object. The error(Wen I try to use a JNDI resource in my webapp.): C:\jdk1.3.1_08\jre\bin\java -classpath C:\web\Tomcat4.1\bin\bootstrap.jar;C:\jdk1.3.1_08\lib\tools.jar -Dcatalina.home=C:\web\Tomcat4.1 -Dcatalina.base=C:\web\Tomcat4.1 org.apache.catalina.startup.Bootstrap start [INFO] Registry - -Loading registry information [INFO] Registry - -Creating new Registry instance [INFO] Registry - -Creating MBeanServer [INFO] Http11Protocol - -Initializing Coyote HTTP/1.1 on port 8080 Starting service Tomcat-Standalone Apache Tomcat/4.1.18-LE-jdk14 [INFO] PropertyMessageResources - -Initializing, config='org.apache.struts.util.LocalStrings', returnNull=true [INFO] PropertyMessageResources - -Initializing, config='org.apache.struts.action.ActionResources', returnNull=true [INFO] PropertyMessageResources - -Initializing, config='remic_msgcat', returnNull=true [INFO] Http11Protocol - -Starting Coyote HTTP/1.1 on port 8080 [INFO] ChannelSocket - -JK2: ajp13 listening on 0.0.0.0/0.0.0.0:8009 [INFO] JkMain - -Jk running ID=0 time=0/200 config=C:\web\Tomcat4.1\conf\jk2.properties Cannot load JDBC driver class 'null' java.lang.NullPointerException at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:115) at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.jav a:523) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:3 29) at com.citimortgage.common.datasource.DataSourceManager.getConnection(DataSourc eManager.java:80) I know I have the Oracle jar in the right place because I get this msg when if I don't have it in tomcatHome/common/lib. C:\jdk1.3.1_08\jre\bin\java -classpath C:\web\Tomcat4.1\bin\bootstrap.jar;C:\jdk1.3.1_08\lib\tools.jar -Dcatalina.home=C:\web\Tomcat4.1 -Dcatalina.base=C:\web\Tomcat4.1 org.apache.catalina.startup.Bootstrap start [INFO] Registry - -Loading registry information [INFO] Registry - -Creating new Registry instance [INFO] Registry - -Creating MBeanServer [INFO] Http11Protocol - -Initializing Coyote HTTP/1.1 on port 8080 Exception during startup processing java.lang.reflect.InvocationTargetException: java.lang.NoClassDefFoundError: javax/sql/DataSource at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:488) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:106) I googled for this answer. The most common problem is not finding the database driver in tomcatHome/common/lib. Later, Robert Wynkoop - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Connecting to MySql. Cannot load JDBC driver class 'null'
Hi there, I hope this to be useful to somebody. I installed Tomcat 4.1.24 y MySql 3.23 en Linux Red Hat 8.0 Followed the steps within jakarta page: http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-how to.html in order to get connected to my database. However, I found the next error: Cannot load JDBC driver class 'null'. After some troubleshooting, I finnaly got with two problem causes: 1. For some reason, Mysql's JDBC Driver tries to connect to localhost.localdomain. Which means, that when you specify into the connection string (in my case) jdbc:mysql://localhost:3306/DBPrueba java tries always to connect to localhost.localdomain. I solved this problem assigning permission to the Database in Mysql for my test user, only that this time for different domain: GRANT ALL PRIVILEGES ON DBPrueba.* TO 'administrator'@'localhost.localdomain' IDENTIFIED BY 'passwd'; 2. Tha Database version I'm using doesn't recognize the default parameter used by Resource within server.xml, to setup JDBC driver manager. Which for I had to modifify the next lines: parameter namedriverClassName/name valueorg.gjt.mm.mysql.Driver/value /parameter for these ones: parameter namedriverName/name valueorg.gjt.mm.mysql.Driver/value /parameter The steps I made here are an adition over the manual found in Tomcat web page. For further reference, please follow th link shown in this mail. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: java.sql.SQLException: Cannot load JDBC driver class 'null'
Hi, If you have declared your database connection pools ast the GlobalNamingResource level, but do not have your contexts declarared in server.xml, you probably need to have context.xml files in your META-INF subdirectory which contain your ResourceLink definitions for the context. HTH -Original Message- From: Michael Holly [mailto:[EMAIL PROTECTED] Sent: 18 June 2003 17:21 To: [EMAIL PROTECTED] Subject: java.sql.SQLException: Cannot load JDBC driver class 'null' In trying to make the move to automate my testing I have come up against a problem. First some background. I am running Tomcat 4.1.18, Java 1.3.1, Win 2k Part of getting on automated testing was getting the ANT build to undeploy and then redeploy the war after it got created. In addition, I decided that it was more convenient to have the Test classes located in myapp.war instead of a seperate war. Part of getting this dynamic undeploy/deploy cycle to work was removing the context from the server.xml. The reason I want to do this is I have 2 connection pools located there. In a dynamic deploy tomcat generates it's own context for the app. I found there were three ways I could do this. #1. put the connection pool into the GlobalNamingResources section of server.xml #2. create a $APP_NAME.xml file that contains the context of the app and put it into $TOMCAT_HOME/webapps. Both the Tomcat manager and Admin apps do this. #3. Possibly put the context info in the web.xml file for the app. I have tried both 1 and 2 and I am getting a java.sql.SQLException: Cannot load JDBC driver class 'null' error when the DBCP is accessed. The classes12.jar file is located in $TOMCAT_HOME/common/lib. It has been renamed from .zip to .jar Is there something special that I have to do to make the pools available to my application? As you can tell from the included files I am using configuring a connection pool for two different connections. Below are my files for Option #2 (the one I would like to go with). Do I have the resource-ref defined correctly? Is there something I am missing? Some Observations. The app seems to deploy correctly. ( I can see app in Tomcat manager ) Using the Tomcat Admin facility I can see my DataSources. WEB.XML- ?xml version=1.0 encoding=ISO-8859-1? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd; web-app display-nameTSR Application/display-name descriptionThis is the web configuration for the TSR application/description !-- SERVLET LISTINGS -- servlet servlet-nameTestServlet/servlet-name servlet-classnet.talisen.tsr.servlets.TestServlet/servlet-class /servlet servlet servlet-nameControllerServlet/servlet-name servlet-classnet.talisen.tsr.servlets.ControllerServlet/servlet-class /servlet servlet servlet-nameFileDownloadServlet/servlet-name servlet-classnet.talisen.tsr.servlets.FileDownloadServlet/servlet-class /servlet servlet servlet-nameStartupServlet/servlet-name servlet-classnet.talisen.tsr.servlets.StartupServlet/servlet-class load-on-startup1/load-on-startup /servlet !--servlet servlet-namelog4j-init/servlet-name servlet-classnet.talisen.tsr.servlets.Log4jInit/servlet-class load-on-startup1/load-on-startup init-param param-namelog4j-init-file/param-name param-valueWEB-INF\classes\log4j.properties/param-value /init-param /servlet-- !-- integrate the testing -- servlet servlet-nameJUnitEETestServlet/servlet-name descriptionJUnitEE test runner/description servlet-classorg.junitee.servlet.JUnitEEServlet/servlet-class /servlet !-- SERVLET MAPPINGS -- servlet-mapping servlet-nameTestServlet/servlet-name url-pattern/test/url-pattern /servlet-mapping servlet-mapping servlet-nameStartupServlet/servlet-name url-pattern/startup/url-pattern /servlet-mapping servlet-mapping servlet-nameControllerServlet/servlet-name url-pattern/controller/url-pattern /servlet-mapping servlet-mapping servlet-nameFileDownloadServlet/servlet-name url-pattern/download/url-pattern /servlet-mapping !-- integrate the testing -- servlet-mapping servlet-nameJUnitEETestServlet/servlet-name url-pattern/TestServlet/*/url-pattern /servlet-mapping !-- JNDI resource for DB connection pool -- resource-ref description Resource reference to a factory for java.sql.Connection instances that may be used for talking to a particular database that is configured in the server.xml file. /description res-ref-name jdbc/oracle_tsr /res-ref-name res-type javax.sql.DataSource /res-type res-auth
java.sql.SQLException: Cannot load JDBC driver class 'null'
I cannot seem to set up a datasource correctly. I get the java.sql.SQLException: Cannot load JDBC driver class 'null' exception. I have read numerous threads with things to check, but still get it. I deploy my application using ant and the catalina-ant.jar. I have the mysql jar in the /common/lib directory The server.xml is setup correctly (url, driverclass, etc) So is the web.xml I have checked and double checked, no luck. If someone who posted this earlier and eventually got it fixed can maybe send me a step-by-step solution or things to look for, I would appreciate it. Why can't I set up a general datasource that can be used by all applications and does not need to be configured in the web.xml? And why should I configure the datasource in server.xml and not the admin console? __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Firebird|Tomcat java.sql.SQLException: Cannot load JDBC driver class 'null'
Thank you Chong for your reply, Perhaps I need to clarify, I have downloaded the FirebirdSQL-1.0.0 (Jaybird) driver and am following the directions in the FAQ file, with modifications to the connection url for the fact that I am on a windows system. As far as the type 4 driver that is included (that you mentioned), I do not see any info other than release notes (which seem to indicate the driver I downloaded and installed are same as the one included) the information in the release are very general in nature and not help in the way of installation and testing. The Jaybird driver is the one I wish to use due to the connection pooling feature, I am following the information in the Tomcat jndi-datasource howto in the Tomcat docs, although as indicated in my previous email, I am having little luck. In addition, I want to confirm that I have placed all relevant .jars in the commom/lib directory. Again thank you for your previous response - any additional assistance will be very helpful. Thank you, Rob Chong Yu Meng wrote: Hello Rob ! I'm not sure if you are aware : the Firebird database comes with 2 JDBC flavors, a Type 4 JDBC driver (which is a separate download) and Interclient (which is really more of a JDBC mediation component). The configuration for Interclient is covered in this link : http://www.kpi.com.au/interbase/index.jsp while the configuration for the Type 4 JDBC driver is in the README file that comes with the driver download. Depending on which driver you use, the configuration is *very* different! If you are following the MySQL examples, you should use the Type 4 driver. Second, make sure that your JDBC driver is in your CLASSPATH and that Tomcat can see it. That is, either point to it explicitly in your CLASSPATH, or save the jar file into $TOMCAT_HOME/common/lib. HTH Regards, pascal chong Rob Casteen wrote: Hey guys, I am hoping I could get some help with this issue. The research I have done online reveals this error with several databases although I have yet to find a actionable answer nor anything firebird spoecific. I am attempting to connect Firebird to Tomcat based on the MYSQL example in the Tomcat Docs and through the datasource setup in the administration console. I have attempted to include all relevant data to show the activity on my server, including the log, the example code, and the relevant server.xml code. I appreciate all help that you can offer. Rob **Log java.sql.SQLException: Cannot load JDBC driver class 'null' at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource .java:529) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.ja va:312) at foo.DBTest.init(DBTest.java:23) at org.apache.jsp.test_jsp._jspService(test_jsp.java:49) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja va:204) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica tionFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt erChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv e.java:260) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 80) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv e.java:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 80) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:241 5) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java :180) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:643) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherVa lve.java:170) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:641) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java :172
Re: Firebird|Tomcat java.sql.SQLException: Cannot load JDBC driver class 'null'
On Sat, 24 May 2003 06:53, Rob Casteen wrote: You need this first: Resource name=jdbc/TestDB auth=Container type=javax.sql.DataSource/ ***Server.xml additions: ResourceParams name=TestDB Should be ResourceParams name=jdbc/TestDB valuejdbc:firebirdsql:localhost/3050:C:\\Firebird\\DBcontain\\JAVATEST.FD B/value /parameter That doesn't look right, I would have expected it to be something like jdbc:firebirdsql:localhost:3050/JAVATEST although if you are using the intermediary driver I could be wrong, I'd look it up but I'm in the middle of building KDE and Konqueror is currently borked. You will also need to use the jdbc/TestDB name to reference the DataSource as well. Regards, -- Jason Bainbridge KDE Web Team - http://kde.org [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: java.sql.SQLException: Cannot load JDBC driver class 'null'
Hi Michael, I sent an email to this list yesterday saying that I figured out the problemand yes, I only have the JAR under /lib. Thanks! Tam, Michael [EMAIL PROTECTED] To: 'Tomcat Users List' [EMAIL PROTECTED] can.gc.ca cc: Subject: RE: java.sql.SQLException: Cannot load JDBC driver class 03/12/2003 11:23'null' AM Please respond to Tomcat Users List Hi Kevin, You should not put any CLASS in lib at all. It is the place for jars only. Get rib of all the MySQL JDBC driver files anywhere in your webapp and put the mysql jdbc driver jar file into lib and restart tomcat and see if this will resolve your problem. By the way, which version of the driver are you using, I believe the recent versions are changing the url to something like 'com.mysql.jdbc.Driver'. 'org.gjt.mm.mysql.Driver' is still valid but I believe it will phase out eventually. Regards, Michael -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 11, 2003 1:58 PM To: [EMAIL PROTECTED] Subject: java.sql.SQLException: Cannot load JDBC driver class 'null' Tomcat version - 4.1.12 MySQL version - 3.23.55-nt OS - WinNT JDK - 1.4.1_01 I have researched this problem on the internet and in the documentation for Tomcat, and I still haven't resolved this issue. So, I'm looking for help from someone from this list. Here is my URL that I invoke: http://localhost:8080/dbtest/test.jsp Here is the error I receive: java.sql.SQLException: Cannot load JDBC driver class 'null' at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSou rce.java:529) Referencing this URL - http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-how to.html: 1. I have a database and table with 1 row of data 2. Here is the chunk of code that I inserted into my $CATALINA_HOME/conf/server.xml. !-- Database configuration for MySQL -- Context path=/DBTest docBase=DBTest debug=5 reloadable=true crossContext=true Logger className=org.apache.catalina.logger.FileLogger prefix=localhost_DBTest_log. suffix=.txt timestamp=true/ Resource name=jdbc/TestDB auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/TestDB parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter !-- Maximum number of dB connections in pool. Make sure you configure your mysqld max_connections large enough to handle all of your db connections. Set to 0 for no limit. -- parameter namemaxActive/name value100/value /parameter !-- Maximum number of idle dB connections to retain in pool. Set to 0 for no limit. -- parameter namemaxIdle/name value30/value /parameter !-- Maximum time to wait for a dB connection to become available in ms, in this example 10 seconds. An Exception is thrown if this timeout is exceeded. Set to -1 to wait indefinitely. -- parameter namemaxWait/name value1/value /parameter !-- MySQL dB username and password for dB connections -- parameter nameusername/name valuebugtracker/value /parameter parameter namepassword/name valuefootin/value /parameter !-- Class name for mm.mysql JDBC driver -- parameter
AW: java.sql.SQLException: Cannot load JDBC driver class 'null'
Hi where ist your Database Connection? In the server.xml in the context for your test application. The jdbc.driver must be placed into the directory common/lib. I hope this will help. Regards Gerlinde -Ursprungliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 11. Marz 2003 22:58 An: [EMAIL PROTECTED] Betreff: java.sql.SQLException: Cannot load JDBC driver class 'null' Tomcat version - 4.1.12 MySQL version - 3.23.55-nt OS - WinNT JDK - 1.4.1_01 I have researched this problem on the internet and in the documentation for Tomcat, and I still haven't resolved this issue. So, I'm looking for help from someone from this list. Here is my URL that I invoke: http://localhost:8080/dbtest/test.jsp Here is the error I receive: java.sql.SQLException: Cannot load JDBC driver class 'null' at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSou rce.java:529) Referencing this URL - http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-ex amples-howto.html: 1. I have a database and table with 1 row of data 2. Here is the chunk of code that I inserted into my $CATALINA_HOME/conf/server.xml. !-- Database configuration for MySQL -- Context path=/DBTest docBase=DBTest debug=5 reloadable=true crossContext=true Logger className=org.apache.catalina.logger.FileLogger prefix=localhost_DBTest_log. suffix=.txt timestamp=true/ Resource name=jdbc/TestDB auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/TestDB parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter !-- Maximum number of dB connections in pool. Make sure you configure your mysqld max_connections large enough to handle all of your db connections. Set to 0 for no limit. -- parameter namemaxActive/name value100/value /parameter !-- Maximum number of idle dB connections to retain in pool. Set to 0 for no limit. -- parameter namemaxIdle/name value30/value /parameter !-- Maximum time to wait for a dB connection to become available in ms, in this example 10 seconds. An Exception is thrown if this timeout is exceeded. Set to -1 to wait indefinitely. -- parameter namemaxWait/name value1/value /parameter !-- MySQL dB username and password for dB connections -- parameter nameusername/name valuebugtracker/value /parameter parameter namepassword/name valuefootin/value /parameter !-- Class name for mm.mysql JDBC driver -- parameter namedriverClassName/name valueorg.gjt.mm.mysql.Driver/value /parameter !-- The JDBC connection url for connecting to your MySQL dB. The autoReconnect=true argument to the url makes sure that the mm.mysql JDBC Driver will automatically reconnect if mysqld closed the connection. mysqld by default closes idle connections after 8 hours. -- parameter nameurl/name !-- valuejdbc:mysql://localhost:3306/javatest?autoReconnect=true/value-- valuejdbc:mysql://localhost:3306/bugtracker/value /parameter /ResourceParams /Context 3. Here is my web.xml under $CATALINA_HOME/webapps/dbtest/web-inf/web.xml: ?xml version=1.0 encoding=ISO-8859-1? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd; web-app descriptionMySQL Test App/description resource-ref descriptionDB Connection/description res-ref-namejdbc/TestDB/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref /web-app 4. Added my DB Driver under $CATALINA_HOME/webapps/dbtest/lib/org/git/mm/mysql/Driver.class. I also tried just putting the jar file under the /lib. 5. Created a JSP and class just like in the example above. I just changed my select statement inside the class, that's all. 6. I have verified that my database is indeed running. 7. In my.ini
Re: AW: java.sql.SQLException: Cannot load JDBC driver class 'null'
Gerlinde, Thanks for the response! I placed my jdbc jar file under common/lib, but I still get the same error message. If you or anyone else has any other ideas, that would be greatly appreciated. Gerlinde Fischer [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] amberg.de cc: Subject: AW: java.sql.SQLException: Cannot load JDBC driver class 03/12/2003 05:47 AM 'null' Please respond to Tomcat Users List Hi where ist your Database Connection? In the server.xml in the context for your test application. The jdbc.driver must be placed into the directory common/lib. I hope this will help. Regards Gerlinde -Ursprungliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 11. Marz 2003 22:58 An: [EMAIL PROTECTED] Betreff: java.sql.SQLException: Cannot load JDBC driver class 'null' Tomcat version - 4.1.12 MySQL version - 3.23.55-nt OS - WinNT JDK - 1.4.1_01 I have researched this problem on the internet and in the documentation for Tomcat, and I still haven't resolved this issue. So, I'm looking for help from someone from this list. Here is my URL that I invoke: http://localhost:8080/dbtest/test.jsp Here is the error I receive: java.sql.SQLException: Cannot load JDBC driver class 'null' at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSou rce.java:529) Referencing this URL - http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-ex amples-howto.html: 1. I have a database and table with 1 row of data 2. Here is the chunk of code that I inserted into my $CATALINA_HOME/conf/server.xml. !-- Database configuration for MySQL -- Context path=/DBTest docBase=DBTest debug=5 reloadable=true crossContext=true Logger className=org.apache.catalina.logger.FileLogger prefix=localhost_DBTest_log. suffix=.txt timestamp=true/ Resource name=jdbc/TestDB auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/TestDB parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter !-- Maximum number of dB connections in pool. Make sure you configure your mysqld max_connections large enough to handle all of your db connections. Set to 0 for no limit. -- parameter namemaxActive/name value100/value /parameter !-- Maximum number of idle dB connections to retain in pool. Set to 0 for no limit. -- parameter namemaxIdle/name value30/value /parameter !-- Maximum time to wait for a dB connection to become available in ms, in this example 10 seconds. An Exception is thrown if this timeout is exceeded. Set to -1 to wait indefinitely. -- parameter namemaxWait/name value1/value /parameter !-- MySQL dB username and password for dB connections -- parameter nameusername/name valuebugtracker/value /parameter parameter namepassword/name valuefootin/value /parameter !-- Class name for mm.mysql JDBC driver -- parameter namedriverClassName/name valueorg.gjt.mm.mysql.Driver/value /parameter !-- The JDBC connection url for connecting to your
Re: AW: java.sql.SQLException: Cannot load JDBC driver class 'null'
I am not absolutely sure if this is the problem, but I have placed the database related jars under server/lib. It works for me. -- Uddhav - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, March 12, 2003 6:04 PM Subject: Re: AW: java.sql.SQLException: Cannot load JDBC driver class 'null' Gerlinde, Thanks for the response! I placed my jdbc jar file under common/lib, but I still get the same error message. If you or anyone else has any other ideas, that would be greatly appreciated. Gerlinde Fischer [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] amberg.de cc: Subject: AW: java.sql.SQLException: Cannot load JDBC driver class 03/12/2003 05:47 AM 'null' Please respond to Tomcat Users List Hi where ist your Database Connection? In the server.xml in the context for your test application. The jdbc.driver must be placed into the directory common/lib. I hope this will help. Regards Gerlinde -Ursprungliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 11. Marz 2003 22:58 An: [EMAIL PROTECTED] Betreff: java.sql.SQLException: Cannot load JDBC driver class 'null' Tomcat version - 4.1.12 MySQL version - 3.23.55-nt OS - WinNT JDK - 1.4.1_01 I have researched this problem on the internet and in the documentation for Tomcat, and I still haven't resolved this issue. So, I'm looking for help from someone from this list. Here is my URL that I invoke: http://localhost:8080/dbtest/test.jsp Here is the error I receive: java.sql.SQLException: Cannot load JDBC driver class 'null' at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSou rce.java:529) Referencing this URL - http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-ex amples-howto.html: 1. I have a database and table with 1 row of data 2. Here is the chunk of code that I inserted into my $CATALINA_HOME/conf/server.xml. !-- Database configuration for MySQL -- Context path=/DBTest docBase=DBTest debug=5 reloadable=true crossContext=true Logger className=org.apache.catalina.logger.FileLogger prefix=localhost_DBTest_log. suffix=.txt timestamp=true/ Resource name=jdbc/TestDB auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/TestDB parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter !-- Maximum number of dB connections in pool. Make sure you configure your mysqld max_connections large enough to handle all of your db connections. Set to 0 for no limit. -- parameter namemaxActive/name value100/value /parameter !-- Maximum number of idle dB connections to retain in pool. Set to 0 for no limit. -- parameter namemaxIdle/name value30/value /parameter !-- Maximum time to wait for a dB connection to become available in ms, in this example 10 seconds. An Exception is thrown if this timeout is exceeded. Set to -1 to wait indefinitely. -- parameter namemaxWait/name value1/value /parameter !-- MySQL dB username and password for dB onnections -- parameter nameusername/name valuebugtracker/value /parameter parameter namepassword/name valuefootin/value /parameter !-- Class name for mm.mysql JDBC driver -- parameter namedriverClassName/name valueorg.gjt.mm.mysql.Driver/value /parameter !-- The JDBC connection url for connecting to your MySQL dB. The autoReconnect=true argument to the url makes sure that the mm.mysql JDBC Driver will automatically reconnect if mysqld closed the connection. mysqld by default closes idle connections after 8 hours. -- parameter nameurl/name
Re: AW: java.sql.SQLException: Cannot load JDBC driver class 'null'
I put it under server/lib, but no such luck.still the same error message. hmmm Uddhav Shirname [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] ent.co.in cc: Subject: Re: AW: java.sql.SQLException: Cannot load JDBC driver class 03/12/2003 06:43 AM 'null' Please respond to Tomcat Users List I am not absolutely sure if this is the problem, but I have placed the database related jars under server/lib. It works for me. -- Uddhav - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, March 12, 2003 6:04 PM Subject: Re: AW: java.sql.SQLException: Cannot load JDBC driver class 'null' Gerlinde, Thanks for the response! I placed my jdbc jar file under common/lib, but I still get the same error message. If you or anyone else has any other ideas, that would be greatly appreciated. Gerlinde Fischer [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] amberg.de cc: Subject: AW: java.sql.SQLException: Cannot load JDBC driver class 03/12/2003 05:47 AM 'null' Please respond to Tomcat Users List Hi where ist your Database Connection? In the server.xml in the context for your test application. The jdbc.driver must be placed into the directory common/lib. I hope this will help. Regards Gerlinde -Ursprungliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 11. Marz 2003 22:58 An: [EMAIL PROTECTED] Betreff: java.sql.SQLException: Cannot load JDBC driver class 'null' Tomcat version - 4.1.12 MySQL version - 3.23.55-nt OS - WinNT JDK - 1.4.1_01 I have researched this problem on the internet and in the documentation for Tomcat, and I still haven't resolved this issue. So, I'm looking for help from someone from this list. Here is my URL that I invoke: http://localhost:8080/dbtest/test.jsp Here is the error I receive: java.sql.SQLException: Cannot load JDBC driver class 'null' at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSou rce.java:529) Referencing this URL - http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-ex amples-howto.html: 1. I have a database and table with 1 row of data 2. Here is the chunk of code that I inserted into my $CATALINA_HOME/conf/server.xml. !-- Database configuration for MySQL -- Context path=/DBTest docBase=DBTest debug=5 reloadable=true crossContext=true Logger className=org.apache.catalina.logger.FileLogger prefix=localhost_DBTest_log. suffix=.txt timestamp=true/ Resource name=jdbc/TestDB auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/TestDB parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter !-- Maximum number of dB connections in pool. Make sure you configure your mysqld max_connections large enough to handle all of your db connections. Set to 0 for no limit. -- parameter namemaxActive/name value100/value /parameter !-- Maximum number of idle dB connections to retain in pool. Set to 0 for no limit. -- parameter namemaxIdle/name value30/value /parameter !-- Maximum time to wait for a dB connection to become available
RE: AW: java.sql.SQLException: Cannot load JDBC driver class 'null'
Did you define the driver in you classpath? / Clarence Dahlin -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: den 12 mars 2003 13:49 To: [EMAIL PROTECTED] Subject: Re: AW: java.sql.SQLException: Cannot load JDBC driver class 'null' I put it under server/lib, but no such luck.still the same error message. hmmm Uddhav Shirname [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] ent.co.in cc: Subject: Re: AW: java.sql.SQLException: Cannot load JDBC driver class 03/12/2003 06:43 AM 'null' Please respond to Tomcat Users List I am not absolutely sure if this is the problem, but I have placed the database related jars under server/lib. It works for me. -- Uddhav - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, March 12, 2003 6:04 PM Subject: Re: AW: java.sql.SQLException: Cannot load JDBC driver class 'null' Gerlinde, Thanks for the response! I placed my jdbc jar file under common/lib, but I still get the same error message. If you or anyone else has any other ideas, that would be greatly appreciated. Gerlinde Fischer [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] amberg.de cc: Subject: AW: java.sql.SQLException: Cannot load JDBC driver class 03/12/2003 05:47 AM 'null' Please respond to Tomcat Users List Hi where ist your Database Connection? In the server.xml in the context for your test application. The jdbc.driver must be placed into the directory common/lib. I hope this will help. Regards Gerlinde -Ursprungliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 11. Marz 2003 22:58 An: [EMAIL PROTECTED] Betreff: java.sql.SQLException: Cannot load JDBC driver class 'null' Tomcat version - 4.1.12 MySQL version - 3.23.55-nt OS - WinNT JDK - 1.4.1_01 I have researched this problem on the internet and in the documentation for Tomcat, and I still haven't resolved this issue. So, I'm looking for help from someone from this list. Here is my URL that I invoke: http://localhost:8080/dbtest/test.jsp Here is the error I receive: java.sql.SQLException: Cannot load JDBC driver class 'null' at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSou rce.java:529) Referencing this URL - http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-ex amples-howto.html: 1. I have a database and table with 1 row of data 2. Here is the chunk of code that I inserted into my $CATALINA_HOME/conf/server.xml. !-- Database configuration for MySQL -- Context path=/DBTest docBase=DBTest debug=5 reloadable=true crossContext=true Logger className=org.apache.catalina.logger.FileLogger prefix=localhost_DBTest_log. suffix=.txt timestamp=true/ Resource name=jdbc/TestDB auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/TestDB parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter !-- Maximum number of dB connections in pool. Make sure you configure your mysqld max_connections large enough to handle all of your db connections. Set to 0 for no limit. -- parameter namemaxActive/name value100/value /parameter !-- Maximum number of idle dB connections to retain in pool
RE: AW: java.sql.SQLException: Cannot load JDBC driver class 'null'
No I did not, but now I do and I still receive the same error. I have printed out my classpath on the tomcat startup DOS window. This is: setting the jdbc jar to classpath * * classpath is: C:\Development\j2sdk1.4.1_01\lib\tools.jar;C:\development\ja karta-tomcat-4.1.12\common\lib\mysql-connector-java-3.0.6-stable-bin.jar; ** Currently, I have the jdbc jar file under common\lib, server\lib and webapps\dbtest\WEB-INF\lib, hoping Tomcat will 'see' it under one of these locations. btw, I'm a first-timer for connecting Tomcat to a database. Thanks Clarence DahlinTo: Tomcat Users List [EMAIL PROTECTED] clarence.dahlin cc: @pitch.se Subject: RE: AW: java.sql.SQLException: Cannot load JDBC driver class 'null' 03/12/2003 06:55 AM Please respond to Tomcat Users List Did you define the driver in you classpath? / Clarence Dahlin -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: den 12 mars 2003 13:49 To: [EMAIL PROTECTED] Subject: Re: AW: java.sql.SQLException: Cannot load JDBC driver class 'null' I put it under server/lib, but no such luck.still the same error message. hmmm Uddhav Shirname [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] ent.co.in cc: Subject: Re: AW: java.sql.SQLException: Cannot load JDBC driver class 03/12/2003 06:43 AM 'null' Please respond to Tomcat Users List I am not absolutely sure if this is the problem, but I have placed the database related jars under server/lib. It works for me. -- Uddhav - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, March 12, 2003 6:04 PM Subject: Re: AW: java.sql.SQLException: Cannot load JDBC driver class 'null' Gerlinde, Thanks for the response! I placed my jdbc jar file under common/lib, but I still get the same error message. If you or anyone else has any other ideas, that would be greatly appreciated. Gerlinde Fischer [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] amberg.de cc: Subject: AW: java.sql.SQLException: Cannot load JDBC driver class 03/12/2003 05:47 AM 'null' Please respond to Tomcat Users List Hi where ist your Database Connection? In the server.xml in the context for your test application. The jdbc.driver must be placed into the directory common/lib. I hope this will help. Regards Gerlinde -Ursprungliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 11. Marz 2003 22:58 An: [EMAIL PROTECTED] Betreff: java.sql.SQLException: Cannot load JDBC driver class 'null' Tomcat version - 4.1.12 MySQL version - 3.23.55-nt OS - WinNT JDK - 1.4.1_01 I have researched this problem on the internet and in the documentation for Tomcat, and I still haven't resolved this issue. So, I'm looking for help from someone from this list. Here is my URL that I invoke: http://localhost:8080/dbtest/test.jsp Here is the error I receive: java.sql.SQLException: Cannot load JDBC driver class 'null' at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSou rce.java:529) Referencing this URL - http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-ex amples
AW: AW: java.sql.SQLException: Cannot load JDBC driver class 'null'
Hi Kevin, have you started the tomcat afterwards. Regards Gerlinde -Ursprungliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 12. Marz 2003 13:34 An: [EMAIL PROTECTED] Betreff: Re: AW: java.sql.SQLException: Cannot load JDBC driver class 'null' Gerlinde, Thanks for the response! I placed my jdbc jar file under common/lib, but I still get the same error message. If you or anyone else has any other ideas, that would be greatly appreciated. Gerlinde Fischer [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] amberg.de cc: Subject: AW: java.sql.SQLException: Cannot load JDBC driver class 03/12/2003 05:47 AM 'null' Please respond to Tomcat Users List Hi where ist your Database Connection? In the server.xml in the context for your test application. The jdbc.driver must be placed into the directory common/lib. I hope this will help. Regards Gerlinde -Ursprungliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 11. Marz 2003 22:58 An: [EMAIL PROTECTED] Betreff: java.sql.SQLException: Cannot load JDBC driver class 'null' Tomcat version - 4.1.12 MySQL version - 3.23.55-nt OS - WinNT JDK - 1.4.1_01 I have researched this problem on the internet and in the documentation for Tomcat, and I still haven't resolved this issue. So, I'm looking for help from someone from this list. Here is my URL that I invoke: http://localhost:8080/dbtest/test.jsp Here is the error I receive: java.sql.SQLException: Cannot load JDBC driver class 'null' at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSou rce.java:529) Referencing this URL - http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-ex amples-howto.html: 1. I have a database and table with 1 row of data 2. Here is the chunk of code that I inserted into my $CATALINA_HOME/conf/server.xml. !-- Database configuration for MySQL -- Context path=/DBTest docBase=DBTest debug=5 reloadable=true crossContext=true Logger className=org.apache.catalina.logger.FileLogger prefix=localhost_DBTest_log. suffix=.txt timestamp=true/ Resource name=jdbc/TestDB auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/TestDB parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter !-- Maximum number of dB connections in pool. Make sure you configure your mysqld max_connections large enough to handle all of your db connections. Set to 0 for no limit. -- parameter namemaxActive/name value100/value /parameter !-- Maximum number of idle dB connections to retain in pool. Set to 0 for no limit. -- parameter namemaxIdle/name value30/value /parameter !-- Maximum time to wait for a dB connection to become available in ms, in this example 10 seconds. An Exception is thrown if this timeout is exceeded. Set to -1 to wait indefinitely. -- parameter namemaxWait/name value1/value /parameter !-- MySQL dB username and password for dB connections -- parameter nameusername/name valuebugtracker/value /parameter parameter namepassword/name valuefootin/value /parameter !-- Class name for mm.mysql JDBC driver -- parameter namedriverClassName/name valueorg.gjt.mm.mysql.Driver/value /parameter !-- The JDBC connection url for connecting to your MySQL dB. The autoReconnect=true argument to the url makes sure that the mm.mysql JDBC Driver will automatically reconnect if mysqld closed the connection. mysqld by default closes idle connections after 8 hours. -- parameter nameurl/name
Re: AW: java.sql.SQLException: Cannot load JDBC driver class 'null'
sorry ..you mail arrive in mail address... - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, March 12, 2003 2:20 PM Subject: RE: AW: java.sql.SQLException: Cannot load JDBC driver class 'null' No I did not, but now I do and I still receive the same error. I have printed out my classpath on the tomcat startup DOS window. This is: setting the jdbc jar to classpath * * classpath is: C:\Development\j2sdk1.4.1_01\lib\tools.jar;C:\development\ja karta-tomcat-4.1.12\common\lib\mysql-connector-java-3.0.6-stable-bin.jar; ** Currently, I have the jdbc jar file under common\lib, server\lib and webapps\dbtest\WEB-INF\lib, hoping Tomcat will 'see' it under one of these locations. btw, I'm a first-timer for connecting Tomcat to a database. Thanks Clarence DahlinTo: Tomcat Users List [EMAIL PROTECTED] clarence.dahlin cc: @pitch.se Subject: RE: AW: java.sql.SQLException: Cannot load JDBC driver class 'null' 03/12/2003 06:55 AM Please respond to Tomcat Users List Did you define the driver in you classpath? / Clarence Dahlin -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: den 12 mars 2003 13:49 To: [EMAIL PROTECTED] Subject: Re: AW: java.sql.SQLException: Cannot load JDBC driver class 'null' I put it under server/lib, but no such luck.still the same error message. hmmm Uddhav Shirname [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] ent.co.in cc: Subject: Re: AW: java.sql.SQLException: Cannot load JDBC driver class 03/12/2003 06:43 AM 'null' Please respond to Tomcat Users List I am not absolutely sure if this is the problem, but I have placed the database related jars under server/lib. It works for me. -- Uddhav - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, March 12, 2003 6:04 PM Subject: Re: AW: java.sql.SQLException: Cannot load JDBC driver class 'null' Gerlinde, Thanks for the response! I placed my jdbc jar file under common/lib, but I still get the same error message. If you or anyone else has any other ideas, that would be greatly appreciated. Gerlinde Fischer [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] amberg.de cc: Subject: AW: java.sql.SQLException: Cannot load JDBC driver class 03/12/2003 05:47 AM 'null' Please respond to Tomcat Users List Hi where ist your Database Connection? In the server.xml in the context for your test application. The jdbc.driver must be placed into the directory common/lib. I hope this will help. Regards Gerlinde -Ursprungliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 11. Marz 2003 22:58 An: [EMAIL PROTECTED] Betreff: java.sql.SQLException: Cannot load JDBC driver class 'null' Tomcat version - 4.1.12 MySQL version - 3.23.55-nt OS - WinNT JDK - 1.4.1_01 I have researched this problem on the internet and in the documentation for Tomcat, and I still haven't resolved this issue. So, I'm looking for help from someone from this list. Here is my URL that I invoke: http://localhost:8080/dbtest/test.jsp Here is the error I receive: java.sql.SQLException: Cannot load JDBC driver class 'null' at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSou rce.java:529) Referencing this URL - http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-ex amples-howto.html: 1. I have a database and table with 1 row of data 2. Here is the chunk of code that I inserted into my $CATALINA_HOME/conf/server.xml. !-- Database configuration for MySQL -- Context path=/DBTest docBase=DBTest debug=5 reloadable=true crossContext=true Logger className=org.apache.catalina.logger.FileLogger prefix=localhost_DBTest_log. suffix=.txt timestamp=true/ Resource name=jdbc/TestDB auth=Container type=javax.sql.DataSource/ ResourceParams name
Re: AW: java.sql.SQLException: Cannot load JDBC driver class 'null'
Hi, Are you looking in a load-on-startup servlet Pratt. - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, March 12, 2003 6:50 PM Subject: RE: AW: java.sql.SQLException: Cannot load JDBC driver class 'null' No I did not, but now I do and I still receive the same error. I have printed out my classpath on the tomcat startup DOS window. This is: setting the jdbc jar to classpath * * classpath is: C:\Development\j2sdk1.4.1_01\lib\tools.jar;C:\development\ja karta-tomcat-4.1.12\common\lib\mysql-connector-java-3.0.6-stable-bin.jar; ** Currently, I have the jdbc jar file under common\lib, server\lib and webapps\dbtest\WEB-INF\lib, hoping Tomcat will 'see' it under one of these locations. btw, I'm a first-timer for connecting Tomcat to a database. Thanks Clarence DahlinTo: Tomcat Users List [EMAIL PROTECTED] clarence.dahlin cc: @pitch.se Subject: RE: AW: java.sql.SQLException: Cannot load JDBC driver class 'null' 03/12/2003 06:55 AM Please respond to Tomcat Users List Did you define the driver in you classpath? / Clarence Dahlin -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: den 12 mars 2003 13:49 To: [EMAIL PROTECTED] Subject: Re: AW: java.sql.SQLException: Cannot load JDBC driver class 'null' I put it under server/lib, but no such luck.still the same error message. hmmm Uddhav Shirname [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] ent.co.in cc: Subject: Re: AW: java.sql.SQLException: Cannot load JDBC driver class 03/12/2003 06:43 AM 'null' Please respond to Tomcat Users List I am not absolutely sure if this is the problem, but I have placed the database related jars under server/lib. It works for me. -- Uddhav - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, March 12, 2003 6:04 PM Subject: Re: AW: java.sql.SQLException: Cannot load JDBC driver class 'null' Gerlinde, Thanks for the response! I placed my jdbc jar file under common/lib, but I still get the same error message. If you or anyone else has any other ideas, that would be greatly appreciated. Gerlinde Fischer [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] amberg.de cc: Subject: AW: java.sql.SQLException: Cannot load JDBC driver class 03/12/2003 05:47 AM 'null' Please respond to Tomcat Users List Hi where ist your Database Connection? In the server.xml in the context for your test application. The jdbc.driver must be placed into the directory common/lib. I hope this will help. Regards Gerlinde -Ursprungliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 11. Marz 2003 22:58 An: [EMAIL PROTECTED] Betreff: java.sql.SQLException: Cannot load JDBC driver class 'null' Tomcat version - 4.1.12 MySQL version - 3.23.55-nt OS - WinNT JDK - 1.4.1_01 I have researched this problem on the internet and in the documentation for Tomcat, and I still haven't resolved this issue. So, I'm looking for help from someone from this list. Here is my URL that I invoke: http://localhost:8080/dbtest/test.jsp Here is the error I receive: java.sql.SQLException: Cannot load JDBC driver class 'null' at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSou rce.java:529) Referencing this URL - http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-ex amples-howto.html: 1. I have a database and table with 1 row of data 2. Here is the chunk of code that I inserted into my $CATALINA_HOME/conf/server.xml. !-- Database configuration for MySQL -- Context path=/DBTest docBase=DBTest debug=5 reloadable=true crossContext=true Logger className=org.apache.catalina.logger.FileLogger prefix=localhost_DBTest_log. suffix=.txt timestamp=true/ Resource name=jdbc/TestDB auth=Container type=javax.sql.DataSource
Re: AW: java.sql.SQLException: Cannot load JDBC driver class 'null'
1. starting from tomcat-home\bin, I type in the command - startup. 2. starting from tomcat-home\bin, I type in the command - shutdown. I do this after every change I make to the tomcat configuration. After I issue the command 'startup,' then I see the classpath output in that same DOS window. Does my server.xml and web.xml setting look correct to all? Tomcat-RND [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] mail.comcc: Subject: Re: AW: java.sql.SQLException: Cannot load JDBC driver class 03/12/2003'null' 07:22 AM Please respond to Tomcat Users List Hi, Are you looking in a load-on-startup servlet Pratt. - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, March 12, 2003 6:50 PM Subject: RE: AW: java.sql.SQLException: Cannot load JDBC driver class 'null' No I did not, but now I do and I still receive the same error. I have printed out my classpath on the tomcat startup DOS window. This is: setting the jdbc jar to classpath * * classpath is: C:\Development\j2sdk1.4.1_01\lib\tools.jar;C:\development\ja karta-tomcat-4.1.12\common\lib\mysql-connector-java-3.0.6-stable-bin.jar; ** Currently, I have the jdbc jar file under common\lib, server\lib and webapps\dbtest\WEB-INF\lib, hoping Tomcat will 'see' it under one of these locations. btw, I'm a first-timer for connecting Tomcat to a database. Thanks Clarence DahlinTo: Tomcat Users List [EMAIL PROTECTED] clarence.dahlin cc: @pitch.se Subject: RE: AW: java.sql.SQLException: Cannot load JDBC driver class 'null' 03/12/2003 06:55 AM Please respond to Tomcat Users List Did you define the driver in you classpath? / Clarence Dahlin -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: den 12 mars 2003 13:49 To: [EMAIL PROTECTED] Subject: Re: AW: java.sql.SQLException: Cannot load JDBC driver class 'null' I put it under server/lib, but no such luck.still the same error message. hmmm Uddhav Shirname [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] ent.co.in cc: Subject: Re: AW: java.sql.SQLException: Cannot load JDBC driver class 03/12/2003 06:43 AM 'null' Please respond to Tomcat Users List I am not absolutely sure if this is the problem, but I have placed the database related jars under server/lib. It works for me. -- Uddhav - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, March 12, 2003 6:04 PM Subject: Re: AW: java.sql.SQLException: Cannot load JDBC driver class 'null' Gerlinde, Thanks for the response! I placed my jdbc jar file under common/lib, but I still get the same error message. If you or anyone else has any other ideas, that would be greatly appreciated. Gerlinde Fischer [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] amberg.de cc: Subject: AW: java.sql.SQLException: Cannot load JDBC driver class 03/12/2003 05:47 AM 'null' Please respond to Tomcat Users List Hi where ist your Database
Re: AW: java.sql.SQLException: Cannot load JDBC driver class 'null'
please control whern send a mail - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, March 12, 2003 2:37 PM Subject: Re: AW: java.sql.SQLException: Cannot load JDBC driver class 'null' 1. starting from tomcat-home\bin, I type in the command - startup. 2. starting from tomcat-home\bin, I type in the command - shutdown. I do this after every change I make to the tomcat configuration. After I issue the command 'startup,' then I see the classpath output in that same DOS window. Does my server.xml and web.xml setting look correct to all? Tomcat-RND [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] mail.comcc: Subject: Re: AW: java.sql.SQLException: Cannot load JDBC driver class 03/12/2003'null' 07:22 AM Please respond to Tomcat Users List Hi, Are you looking in a load-on-startup servlet Pratt. - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, March 12, 2003 6:50 PM Subject: RE: AW: java.sql.SQLException: Cannot load JDBC driver class 'null' No I did not, but now I do and I still receive the same error. I have printed out my classpath on the tomcat startup DOS window. This is: setting the jdbc jar to classpath * * classpath is: C:\Development\j2sdk1.4.1_01\lib\tools.jar;C:\development\ja karta-tomcat-4.1.12\common\lib\mysql-connector-java-3.0.6-stable-bin.jar; ** Currently, I have the jdbc jar file under common\lib, server\lib and webapps\dbtest\WEB-INF\lib, hoping Tomcat will 'see' it under one of these locations. btw, I'm a first-timer for connecting Tomcat to a database. Thanks Clarence DahlinTo: Tomcat Users List [EMAIL PROTECTED] clarence.dahlin cc: @pitch.se Subject: RE: AW: java.sql.SQLException: Cannot load JDBC driver class 'null' 03/12/2003 06:55 AM Please respond to Tomcat Users List Did you define the driver in you classpath? / Clarence Dahlin -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: den 12 mars 2003 13:49 To: [EMAIL PROTECTED] Subject: Re: AW: java.sql.SQLException: Cannot load JDBC driver class 'null' I put it under server/lib, but no such luck.still the same error message. hmmm Uddhav Shirname [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] ent.co.in cc: Subject: Re: AW: java.sql.SQLException: Cannot load JDBC driver class 03/12/2003 06:43 AM 'null' Please respond to Tomcat Users List I am not absolutely sure if this is the problem, but I have placed the database related jars under server/lib. It works for me. -- Uddhav - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, March 12, 2003 6:04 PM Subject: Re: AW: java.sql.SQLException: Cannot load JDBC driver class 'null' Gerlinde, Thanks for the response! I placed my jdbc jar file under common/lib, but I still get the same error message. If you or anyone else has any other ideas, that would be greatly appreciated. Gerlinde Fischer [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] amberg.de cc: Subject: AW: java.sql.SQLException: Cannot load JDBC driver class 03/12/2003 05:47 AM 'null' Please respond to Tomcat Users List Hi where ist your Database Connection? In the server.xml in the context for your test application. The jdbc.driver must be placed into the directory common/lib. I hope this will help. Regards Gerlinde -Ursprungliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 11. Marz 2003 22:58 An: [EMAIL PROTECTED] Betreff: java.sql.SQLException: Cannot load JDBC driver class 'null' Tomcat version - 4.1.12 MySQL version - 3.23.55-nt OS - WinNT JDK - 1.4.1_01 I have researched
Re: AW: java.sql.SQLException: Cannot load JDBC driver class 'null'
'please control whern send a mail' I'm not sure what you mean by this statement? alessio marinelli To: Tomcat Users List [EMAIL PROTECTED] alessio_marinel cc: [EMAIL PROTECTED] Subject: Re: AW: java.sql.SQLException: Cannot load JDBC driver class 'null' 03/12/1998 07:42 AM Please respond to Tomcat Users List please control whern send a mail - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, March 12, 2003 2:37 PM Subject: Re: AW: java.sql.SQLException: Cannot load JDBC driver class 'null' 1. starting from tomcat-home\bin, I type in the command - startup. 2. starting from tomcat-home\bin, I type in the command - shutdown. I do this after every change I make to the tomcat configuration. After I issue the command 'startup,' then I see the classpath output in that same DOS window. Does my server.xml and web.xml setting look correct to all? Tomcat-RND [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] mail.comcc: Subject: Re: AW: java.sql.SQLException: Cannot load JDBC driver class 03/12/2003'null' 07:22 AM Please respond to Tomcat Users List Hi, Are you looking in a load-on-startup servlet Pratt. - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, March 12, 2003 6:50 PM Subject: RE: AW: java.sql.SQLException: Cannot load JDBC driver class 'null' No I did not, but now I do and I still receive the same error. I have printed out my classpath on the tomcat startup DOS window. This is: setting the jdbc jar to classpath * * classpath is: C:\Development\j2sdk1.4.1_01\lib\tools.jar;C:\development\ja karta-tomcat-4.1.12\common\lib\mysql-connector-java-3.0.6-stable-bin.jar; ** Currently, I have the jdbc jar file under common\lib, server\lib and webapps\dbtest\WEB-INF\lib, hoping Tomcat will 'see' it under one of these locations. btw, I'm a first-timer for connecting Tomcat to a database. Thanks Clarence DahlinTo: Tomcat Users List [EMAIL PROTECTED] clarence.dahlin cc: @pitch.se Subject: RE: AW: java.sql.SQLException: Cannot load JDBC driver class 'null' 03/12/2003 06:55 AM Please respond to Tomcat Users List Did you define the driver in you classpath? / Clarence Dahlin -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: den 12 mars 2003 13:49 To: [EMAIL PROTECTED] Subject: Re: AW: java.sql.SQLException: Cannot load JDBC driver class 'null' I put it under server/lib, but no such luck.still the same error message. hmmm Uddhav Shirname [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] ent.co.in cc: Subject: Re: AW: java.sql.SQLException: Cannot load JDBC driver class 03/12/2003 06:43 AM 'null' Please respond to Tomcat Users List I am not absolutely sure if this is the problem, but I
Re: AW: java.sql.SQLException: Cannot load JDBC driver class 'null'
when you send a mail [EMAIL PROTECTED] this mail arrive at me - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, March 12, 2003 2:43 PM Subject: Re: AW: java.sql.SQLException: Cannot load JDBC driver class 'null' 'please control whern send a mail' I'm not sure what you mean by this statement? alessio marinelli To: Tomcat Users List [EMAIL PROTECTED] alessio_marinel cc: [EMAIL PROTECTED] Subject: Re: AW: java.sql.SQLException: Cannot load JDBC driver class 'null' 03/12/1998 07:42 AM Please respond to Tomcat Users List please control whern send a mail - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, March 12, 2003 2:37 PM Subject: Re: AW: java.sql.SQLException: Cannot load JDBC driver class 'null' 1. starting from tomcat-home\bin, I type in the command - startup. 2. starting from tomcat-home\bin, I type in the command - shutdown. I do this after every change I make to the tomcat configuration. After I issue the command 'startup,' then I see the classpath output in that same DOS window. Does my server.xml and web.xml setting look correct to all? Tomcat-RND [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] mail.comcc: Subject: Re: AW: java.sql.SQLException: Cannot load JDBC driver class 03/12/2003'null' 07:22 AM Please respond to Tomcat Users List Hi, Are you looking in a load-on-startup servlet Pratt. - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, March 12, 2003 6:50 PM Subject: RE: AW: java.sql.SQLException: Cannot load JDBC driver class 'null' No I did not, but now I do and I still receive the same error. I have printed out my classpath on the tomcat startup DOS window. This is: setting the jdbc jar to classpath * * classpath is: C:\Development\j2sdk1.4.1_01\lib\tools.jar;C:\development\ja karta-tomcat-4.1.12\common\lib\mysql-connector-java-3.0.6-stable-bin.jar; ** Currently, I have the jdbc jar file under common\lib, server\lib and webapps\dbtest\WEB-INF\lib, hoping Tomcat will 'see' it under one of these locations. btw, I'm a first-timer for connecting Tomcat to a database. Thanks Clarence DahlinTo: Tomcat Users List [EMAIL PROTECTED] clarence.dahlin cc: @pitch.se Subject: RE: AW: java.sql.SQLException: Cannot load JDBC driver class 'null' 03/12/2003 06:55 AM Please respond to Tomcat Users List Did you define the driver in you classpath? / Clarence Dahlin -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: den 12 mars 2003 13:49 To: [EMAIL PROTECTED] Subject: Re: AW: java.sql.SQLException: Cannot load JDBC driver class 'null' I put it under server/lib, but no such luck.still the same error message. hmmm Uddhav Shirname [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] ent.co.in cc: Subject: Re: AW: java.sql.SQLException: Cannot load JDBC driver class 03/12/2003 06:43 AM 'null' Please respond to Tomcat Users List I am not absolutely sure if this is the problem, but I have placed the database related jars under server/lib. It works for me. -- Uddhav - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, March 12, 2003 6:04 PM Subject: Re: AW: java.sql.SQLException: Cannot load JDBC driver class 'null' Gerlinde, Thanks for the response! I placed my jdbc jar file under common/lib, but I still get the same error message. If you or anyone else has any other ideas, that would be greatly appreciated. Gerlinde Fischer [EMAIL
Re: AW: java.sql.SQLException: Cannot load JDBC driver class 'null'
If you don't want to be on the mailing list, then you can just unsubscribe. alessio marinelli To: Tomcat Users List [EMAIL PROTECTED] alessio_marinel cc: [EMAIL PROTECTED] Subject: Re: AW: java.sql.SQLException: Cannot load JDBC driver class 'null' 03/12/1998 07:49 AM Please respond to Tomcat Users List when you send a mail [EMAIL PROTECTED] this mail arrive at me - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, March 12, 2003 2:43 PM Subject: Re: AW: java.sql.SQLException: Cannot load JDBC driver class 'null' 'please control whern send a mail' I'm not sure what you mean by this statement? alessio marinelli To: Tomcat Users List [EMAIL PROTECTED] alessio_marinel cc: [EMAIL PROTECTED] Subject: Re: AW: java.sql.SQLException: Cannot load JDBC driver class 'null' 03/12/1998 07:42 AM Please respond to Tomcat Users List please control whern send a mail - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, March 12, 2003 2:37 PM Subject: Re: AW: java.sql.SQLException: Cannot load JDBC driver class 'null' 1. starting from tomcat-home\bin, I type in the command - startup. 2. starting from tomcat-home\bin, I type in the command - shutdown. I do this after every change I make to the tomcat configuration. After I issue the command 'startup,' then I see the classpath output in that same DOS window. Does my server.xml and web.xml setting look correct to all? Tomcat-RND [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] mail.comcc: Subject: Re: AW: java.sql.SQLException: Cannot load JDBC driver class 03/12/2003'null' 07:22 AM Please respond to Tomcat Users List Hi, Are you looking in a load-on-startup servlet Pratt. - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, March 12, 2003 6:50 PM Subject: RE: AW: java.sql.SQLException: Cannot load JDBC driver class 'null' No I did not, but now I do and I still receive the same error. I have printed out my classpath on the tomcat startup DOS window. This is: setting the jdbc jar to classpath * * classpath is: C:\Development\j2sdk1.4.1_01\lib\tools.jar;C:\development\ja karta-tomcat-4.1.12\common\lib\mysql-connector-java-3.0.6-stable-bin.jar; ** Currently, I have the jdbc jar file under common\lib, server\lib and webapps\dbtest\WEB-INF\lib, hoping Tomcat will 'see' it under one of these locations. btw, I'm a first-timer for connecting Tomcat to a database. Thanks Clarence DahlinTo: Tomcat Users List [EMAIL PROTECTED] clarence.dahlin cc: @pitch.se Subject: RE: AW: java.sql.SQLException: Cannot load JDBC driver class 'null' 03/12/2003 06:55 AM Please respond to Tomcat Users List
Re: AW: java.sql.SQLException: Cannot load JDBC driver class 'null'
I have this working now. Here is what I did: * First of all, I changed my server.xml. Here is the section of that file that matters to this issue: !-- Database configuration for MySQL -- Context path=/bugtracker docBase=bugtracker debug=5 reloadable =true crossContext=true Logger className=org.apache.catalina.logger.FileLogger prefix =localhost_DBTest_log. suffix=.txt timestamp=true/ Resource name=jdbc/bugtracker auth=Container type =javax.sql.DataSource/ ResourceParams name=jdbc/bugtracker parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter !-- Maximum number of dB connections in pool. Make sure you configure your mysqld max_connections large enough to handle all of your db connections. Set to 0 for no limit. -- parameter namemaxActive/name value100/value /parameter !-- Maximum number of idle dB connections to retain in pool. Set to 0 for no limit. -- parameter namemaxIdle/name value30/value /parameter !-- Maximum time to wait for a dB connection to become available in ms, in this example 10 seconds. An Exception is thrown if this timeout is exceeded. Set to -1 to wait indefinitely. -- parameter namemaxWait/name value1/value /parameter !-- MySQL dB username and password for dB connections -- parameter nameusername/name valuebugtracker/value /parameter parameter namepassword/name valuefootin/value /parameter !-- Class name for mm.mysql JDBC driver -- parameter namedriverClassName/name valuecom.mysql.jdbc.Driver/value /parameter !-- The JDBC connection url for connecting to your MySQL dB. The autoReconnect=true argument to the url makes sure that the mm.mysql JDBC Driver will automatically reconnect if mysqld closed the connection. mysqld by default closes idle connections after 8 hours. -- parameter nameurl/name valuejdbc:mysql://localhost:3306/bugtracker?autoReconnect=true/value /parameter /ResourceParams /Context * The jdbc jar file only works under \common\lib * Changed the jndi line in the Java class to reference 'bugtracker' * Thanks for all your help! Gerlinde Fischer [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] amberg.de cc: Subject: AW: java.sql.SQLException: Cannot load JDBC driver class 03/12/2003 05:47 AM 'null' Please respond to Tomcat Users List Hi where ist your Database Connection? In the server.xml in the context for your test application. The jdbc.driver must be placed into the directory common/lib. I hope this will help. Regards Gerlinde -Ursprungliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 11. Marz 2003 22:58 An: [EMAIL PROTECTED] Betreff: java.sql.SQLException: Cannot load JDBC driver class 'null' Tomcat version - 4.1.12 MySQL version - 3.23.55-nt OS - WinNT JDK - 1.4.1_01 I have researched this problem on the internet and in the documentation for Tomcat, and I still haven't resolved this issue. So, I'm looking for help from someone from this list. Here is my URL that I invoke: http
RE: java.sql.SQLException: Cannot load JDBC driver class 'null'
Hi Kevin, You should not put any CLASS in lib at all. It is the place for jars only. Get rib of all the MySQL JDBC driver files anywhere in your webapp and put the mysql jdbc driver jar file into lib and restart tomcat and see if this will resolve your problem. By the way, which version of the driver are you using, I believe the recent versions are changing the url to something like 'com.mysql.jdbc.Driver'. 'org.gjt.mm.mysql.Driver' is still valid but I believe it will phase out eventually. Regards, Michael -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 11, 2003 1:58 PM To: [EMAIL PROTECTED] Subject: java.sql.SQLException: Cannot load JDBC driver class 'null' Tomcat version - 4.1.12 MySQL version - 3.23.55-nt OS - WinNT JDK - 1.4.1_01 I have researched this problem on the internet and in the documentation for Tomcat, and I still haven't resolved this issue. So, I'm looking for help from someone from this list. Here is my URL that I invoke: http://localhost:8080/dbtest/test.jsp Here is the error I receive: java.sql.SQLException: Cannot load JDBC driver class 'null' at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSou rce.java:529) Referencing this URL - http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-how to.html: 1. I have a database and table with 1 row of data 2. Here is the chunk of code that I inserted into my $CATALINA_HOME/conf/server.xml. !-- Database configuration for MySQL -- Context path=/DBTest docBase=DBTest debug=5 reloadable=true crossContext=true Logger className=org.apache.catalina.logger.FileLogger prefix=localhost_DBTest_log. suffix=.txt timestamp=true/ Resource name=jdbc/TestDB auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/TestDB parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter !-- Maximum number of dB connections in pool. Make sure you configure your mysqld max_connections large enough to handle all of your db connections. Set to 0 for no limit. -- parameter namemaxActive/name value100/value /parameter !-- Maximum number of idle dB connections to retain in pool. Set to 0 for no limit. -- parameter namemaxIdle/name value30/value /parameter !-- Maximum time to wait for a dB connection to become available in ms, in this example 10 seconds. An Exception is thrown if this timeout is exceeded. Set to -1 to wait indefinitely. -- parameter namemaxWait/name value1/value /parameter !-- MySQL dB username and password for dB connections -- parameter nameusername/name valuebugtracker/value /parameter parameter namepassword/name valuefootin/value /parameter !-- Class name for mm.mysql JDBC driver -- parameter namedriverClassName/name valueorg.gjt.mm.mysql.Driver/value /parameter !-- The JDBC connection url for connecting to your MySQL dB. The autoReconnect=true argument to the url makes sure that the mm.mysql JDBC Driver will automatically reconnect if mysqld closed the connection. mysqld by default closes idle connections after 8 hours. -- parameter nameurl/name !-- valuejdbc:mysql://localhost:3306/javatest?autoReconnect=true/value-- valuejdbc:mysql://localhost:3306/bugtracker/value /parameter /ResourceParams /Context 3. Here is my web.xml under $CATALINA_HOME/webapps/dbtest/web-inf/web.xml: ?xml version=1.0 encoding=ISO-8859-1? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd; web-app descriptionMySQL Test App/description resource-ref descriptionDB Connection/description res-ref-namejdbc/TestDB/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref /web-app 4. Added my DB Driver under $CATALINA_HOME/webapps/dbtest/lib/org/git/mm/mysql/Driver.class. I also tried just putting the jar file under the /lib. 5. Created a JSP
java.sql.SQLException: Cannot load JDBC driver class 'null'
Tomcat version - 4.1.12 MySQL version - 3.23.55-nt OS - WinNT JDK - 1.4.1_01 I have researched this problem on the internet and in the documentation for Tomcat, and I still haven't resolved this issue. So, I'm looking for help from someone from this list. Here is my URL that I invoke: http://localhost:8080/dbtest/test.jsp Here is the error I receive: java.sql.SQLException: Cannot load JDBC driver class 'null' at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSou rce.java:529) Referencing this URL - http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-howto.html: 1. I have a database and table with 1 row of data 2. Here is the chunk of code that I inserted into my $CATALINA_HOME/conf/server.xml. !-- Database configuration for MySQL -- Context path=/DBTest docBase=DBTest debug=5 reloadable=true crossContext=true Logger className=org.apache.catalina.logger.FileLogger prefix=localhost_DBTest_log. suffix=.txt timestamp=true/ Resource name=jdbc/TestDB auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/TestDB parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter !-- Maximum number of dB connections in pool. Make sure you configure your mysqld max_connections large enough to handle all of your db connections. Set to 0 for no limit. -- parameter namemaxActive/name value100/value /parameter !-- Maximum number of idle dB connections to retain in pool. Set to 0 for no limit. -- parameter namemaxIdle/name value30/value /parameter !-- Maximum time to wait for a dB connection to become available in ms, in this example 10 seconds. An Exception is thrown if this timeout is exceeded. Set to -1 to wait indefinitely. -- parameter namemaxWait/name value1/value /parameter !-- MySQL dB username and password for dB connections -- parameter nameusername/name valuebugtracker/value /parameter parameter namepassword/name valuefootin/value /parameter !-- Class name for mm.mysql JDBC driver -- parameter namedriverClassName/name valueorg.gjt.mm.mysql.Driver/value /parameter !-- The JDBC connection url for connecting to your MySQL dB. The autoReconnect=true argument to the url makes sure that the mm.mysql JDBC Driver will automatically reconnect if mysqld closed the connection. mysqld by default closes idle connections after 8 hours. -- parameter nameurl/name !-- valuejdbc:mysql://localhost:3306/javatest?autoReconnect=true/value-- valuejdbc:mysql://localhost:3306/bugtracker/value /parameter /ResourceParams /Context 3. Here is my web.xml under $CATALINA_HOME/webapps/dbtest/web-inf/web.xml: ?xml version=1.0 encoding=ISO-8859-1? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd; web-app descriptionMySQL Test App/description resource-ref descriptionDB Connection/description res-ref-namejdbc/TestDB/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref /web-app 4. Added my DB Driver under $CATALINA_HOME/webapps/dbtest/lib/org/git/mm/mysql/Driver.class. I also tried just putting the jar file under the /lib. 5. Created a JSP and class just like in the example above. I just changed my select statement inside the class, that's all. 6. I have verified that my database is indeed running. 7. In my.ini (for MySQL), the port setting is NOT commented. The bind-address IS commented out. Thanks for any help! Kevin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Cannot load JDBC driver class 'null' , again
On the end I managed to open datasource, it was stupd spelling mistake, but I was too tired to see it. Thanx all for answering. -Original Message- From: Sean Dockery [mailto:[EMAIL PROTECTED]] Sent: Friday, February 07, 2003 03:16 To: Tomcat Users List Subject: RE: Cannot load JDBC driver class 'null' , again So, when you execute the following command... jar -tf HSQLDB.jar ...you see the line... org/hsqldb/jdbcDriver.class ...Correct? Odd naming convention for a class--having jdbc in jdbcDriver in lower case... Have you attempted connecting to the database without using DBCP? That is, trying... snip Class.forName(org.hsqldb.jdbcDriver); String url = jdbc:hsqldb:hsql://asterix; String username = iuser; String password = iuser; Connection conn = DriverManager.getConnection(url, username, password); if(conn != null) out.println(Success.); else out.println(Failure.); /snip At 17:31 2003-02-06 +0100, you wrote: Yes, HSQLDB.jar -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 06, 2003 17:25 To: [EMAIL PROTECTED] Subject: RE: Cannot load JDBC driver class 'null' , again Is your jdbc driver in jar file? Regards, PQ This Guy Thinks He Knows Everything This Guy Thinks He Knows What He Is Doing -Original Message- From: Uros Kotnik [mailto:[EMAIL PROTECTED]] Sent: February 6, 2003 11:24 AM To: [EMAIL PROTECTED] Subject: Cannot load JDBC driver class 'null' , again Hi, This question was probbably posted many times but I didn't found answer and I really need it. I'm using TC 4.1 DB : Hypersonic HSQLDB.jar in \tomcat_home\common\lib Server.xml -- Context path=/DBTest docBase=DBTest debug=5 reloadable=true crossContext=true Logger className=org.apache.catalina.logger.FileLogger prefix=localhost_DBTest_log. suffix=.txt timestamp=true/ Resource name=jdbc/TestDB auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/TestDB parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter !-- Maximum number of dB connections in pool. Make sure you configure your mysqld max_connections large enough to handle all of your db connections. Set to 0 for no limit. -- parameter namemaxActive/name value100/value /parameter !-- Maximum number of idle dB connections to retain in pool. Set to 0 for no limit. -- parameter namemaxIdle/name value30/value /parameter !-- Maximum time to wait for a dB connection to become available in ms, in this example 10 seconds. An Exception is thrown if this timeout is exceeded. Set to -1 to wait indefinitely. -- parameter namemaxWait/name value1/value /parameter !-- username and password for dB connections -- parameter nameusername/name valueiuser/value /parameter parameter namepassword/name valueiuser/value /parameter !-- Class name for JDBC driver -- parameter namedriverClassName/name valueorg.hsqldb.jdbcDriver/value /parameter parameter nameurl/name valuejdbc:hsqldb:hsql://asterix/value /parameter /ResourceParams /Context WEB.XML resource-ref descriptionDB Connection/description res-ref-namejdbc/TestDB/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref Servlet code - Context initCtx = new InitialContext(); Context envCtx = (Context) initCtx.lookup(java:comp/env); DataSource ds = (DataSource)envCtx.lookup(jdbc/TestDB); if (ds != null) { Connection conn = ds.getConnection(); //value of DS is org.apache.commons.dbcp.BasicDataSource@b6548 //and here is exception in Connection conn = ds.getConnection(); java.sql.SQLException: Cannot load JDBC driver class 'null' at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSou rce.java:529) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource .java:312) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Sean Dockery [EMAIL PROTECTED] Certified Java Web Component Developer Certified Delphi Programmer SBD Consultants http://www.sbdconsultants.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED
Cannot load JDBC driver class 'null' , again
Hi, This question was probbably posted many times but I didn't found answer and I really need it. I'm using TC 4.1 DB : Hypersonic HSQLDB.jar in \tomcat_home\common\lib Server.xml -- Context path=/DBTest docBase=DBTest debug=5 reloadable=true crossContext=true Logger className=org.apache.catalina.logger.FileLogger prefix=localhost_DBTest_log. suffix=.txt timestamp=true/ Resource name=jdbc/TestDB auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/TestDB parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter !-- Maximum number of dB connections in pool. Make sure you configure your mysqld max_connections large enough to handle all of your db connections. Set to 0 for no limit. -- parameter namemaxActive/name value100/value /parameter !-- Maximum number of idle dB connections to retain in pool. Set to 0 for no limit. -- parameter namemaxIdle/name value30/value /parameter !-- Maximum time to wait for a dB connection to become available in ms, in this example 10 seconds. An Exception is thrown if this timeout is exceeded. Set to -1 to wait indefinitely. -- parameter namemaxWait/name value1/value /parameter !-- username and password for dB connections -- parameter nameusername/name valueiuser/value /parameter parameter namepassword/name valueiuser/value /parameter !-- Class name for JDBC driver -- parameter namedriverClassName/name valueorg.hsqldb.jdbcDriver/value /parameter parameter nameurl/name valuejdbc:hsqldb:hsql://asterix/value /parameter /ResourceParams /Context WEB.XML resource-ref descriptionDB Connection/description res-ref-namejdbc/TestDB/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref Servlet code - Context initCtx = new InitialContext(); Context envCtx = (Context) initCtx.lookup(java:comp/env); DataSource ds = (DataSource)envCtx.lookup(jdbc/TestDB); if (ds != null) { Connection conn = ds.getConnection(); //value of DS is org.apache.commons.dbcp.BasicDataSource@b6548 //and here is exception in Connection conn = ds.getConnection(); java.sql.SQLException: Cannot load JDBC driver class 'null' at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSou rce.java:529) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource .java:312) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Cannot load JDBC driver class 'null' , again
Is your jdbc driver in jar file? Regards, PQ This Guy Thinks He Knows Everything This Guy Thinks He Knows What He Is Doing -Original Message- From: Uros Kotnik [mailto:[EMAIL PROTECTED]] Sent: February 6, 2003 11:24 AM To: [EMAIL PROTECTED] Subject: Cannot load JDBC driver class 'null' , again Hi, This question was probbably posted many times but I didn't found answer and I really need it. I'm using TC 4.1 DB : Hypersonic HSQLDB.jar in \tomcat_home\common\lib Server.xml -- Context path=/DBTest docBase=DBTest debug=5 reloadable=true crossContext=true Logger className=org.apache.catalina.logger.FileLogger prefix=localhost_DBTest_log. suffix=.txt timestamp=true/ Resource name=jdbc/TestDB auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/TestDB parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter !-- Maximum number of dB connections in pool. Make sure you configure your mysqld max_connections large enough to handle all of your db connections. Set to 0 for no limit. -- parameter namemaxActive/name value100/value /parameter !-- Maximum number of idle dB connections to retain in pool. Set to 0 for no limit. -- parameter namemaxIdle/name value30/value /parameter !-- Maximum time to wait for a dB connection to become available in ms, in this example 10 seconds. An Exception is thrown if this timeout is exceeded. Set to -1 to wait indefinitely. -- parameter namemaxWait/name value1/value /parameter !-- username and password for dB connections -- parameter nameusername/name valueiuser/value /parameter parameter namepassword/name valueiuser/value /parameter !-- Class name for JDBC driver -- parameter namedriverClassName/name valueorg.hsqldb.jdbcDriver/value /parameter parameter nameurl/name valuejdbc:hsqldb:hsql://asterix/value /parameter /ResourceParams /Context WEB.XML resource-ref descriptionDB Connection/description res-ref-namejdbc/TestDB/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref Servlet code - Context initCtx = new InitialContext(); Context envCtx = (Context) initCtx.lookup(java:comp/env); DataSource ds = (DataSource)envCtx.lookup(jdbc/TestDB); if (ds != null) { Connection conn = ds.getConnection(); //value of DS is org.apache.commons.dbcp.BasicDataSource@b6548 //and here is exception in Connection conn = ds.getConnection(); java.sql.SQLException: Cannot load JDBC driver class 'null' at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSou rce.java:529) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource .java:312) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Cannot load JDBC driver class 'null' , again
Yes, HSQLDB.jar -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 06, 2003 17:25 To: [EMAIL PROTECTED] Subject: RE: Cannot load JDBC driver class 'null' , again Is your jdbc driver in jar file? Regards, PQ This Guy Thinks He Knows Everything This Guy Thinks He Knows What He Is Doing -Original Message- From: Uros Kotnik [mailto:[EMAIL PROTECTED]] Sent: February 6, 2003 11:24 AM To: [EMAIL PROTECTED] Subject: Cannot load JDBC driver class 'null' , again Hi, This question was probbably posted many times but I didn't found answer and I really need it. I'm using TC 4.1 DB : Hypersonic HSQLDB.jar in \tomcat_home\common\lib Server.xml -- Context path=/DBTest docBase=DBTest debug=5 reloadable=true crossContext=true Logger className=org.apache.catalina.logger.FileLogger prefix=localhost_DBTest_log. suffix=.txt timestamp=true/ Resource name=jdbc/TestDB auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/TestDB parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter !-- Maximum number of dB connections in pool. Make sure you configure your mysqld max_connections large enough to handle all of your db connections. Set to 0 for no limit. -- parameter namemaxActive/name value100/value /parameter !-- Maximum number of idle dB connections to retain in pool. Set to 0 for no limit. -- parameter namemaxIdle/name value30/value /parameter !-- Maximum time to wait for a dB connection to become available in ms, in this example 10 seconds. An Exception is thrown if this timeout is exceeded. Set to -1 to wait indefinitely. -- parameter namemaxWait/name value1/value /parameter !-- username and password for dB connections -- parameter nameusername/name valueiuser/value /parameter parameter namepassword/name valueiuser/value /parameter !-- Class name for JDBC driver -- parameter namedriverClassName/name valueorg.hsqldb.jdbcDriver/value /parameter parameter nameurl/name valuejdbc:hsqldb:hsql://asterix/value /parameter /ResourceParams /Context WEB.XML resource-ref descriptionDB Connection/description res-ref-namejdbc/TestDB/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref Servlet code - Context initCtx = new InitialContext(); Context envCtx = (Context) initCtx.lookup(java:comp/env); DataSource ds = (DataSource)envCtx.lookup(jdbc/TestDB); if (ds != null) { Connection conn = ds.getConnection(); //value of DS is org.apache.commons.dbcp.BasicDataSource@b6548 //and here is exception in Connection conn = ds.getConnection(); java.sql.SQLException: Cannot load JDBC driver class 'null' at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSou rce.java:529) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource .java:312) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
BUG...? java.sql.SQLException: Cannot load JDBC driver class 'null'
From examining this list, it seems that a number of folk have tried setting up JNDI datasources as per the Tomcat HOWTOs, but have had this error returned. I've also noticed that it's been logged in Bugzilla as a bug. Does anyone know of a fix/workaround for the issue..? Can we expect it to be fixed in the next release of Tomcat? Regards, Murray - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Cannot load JDBC driver class 'null' , again
So, when you execute the following command... jar -tf HSQLDB.jar ...you see the line... org/hsqldb/jdbcDriver.class ...Correct? Odd naming convention for a class--having jdbc in jdbcDriver in lower case... Have you attempted connecting to the database without using DBCP? That is, trying... snip Class.forName(org.hsqldb.jdbcDriver); String url = jdbc:hsqldb:hsql://asterix; String username = iuser; String password = iuser; Connection conn = DriverManager.getConnection(url, username, password); if(conn != null) out.println(Success.); else out.println(Failure.); /snip At 17:31 2003-02-06 +0100, you wrote: Yes, HSQLDB.jar -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 06, 2003 17:25 To: [EMAIL PROTECTED] Subject: RE: Cannot load JDBC driver class 'null' , again Is your jdbc driver in jar file? Regards, PQ This Guy Thinks He Knows Everything This Guy Thinks He Knows What He Is Doing -Original Message- From: Uros Kotnik [mailto:[EMAIL PROTECTED]] Sent: February 6, 2003 11:24 AM To: [EMAIL PROTECTED] Subject: Cannot load JDBC driver class 'null' , again Hi, This question was probbably posted many times but I didn't found answer and I really need it. I'm using TC 4.1 DB : Hypersonic HSQLDB.jar in \tomcat_home\common\lib Server.xml -- Context path=/DBTest docBase=DBTest debug=5 reloadable=true crossContext=true Logger className=org.apache.catalina.logger.FileLogger prefix=localhost_DBTest_log. suffix=.txt timestamp=true/ Resource name=jdbc/TestDB auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/TestDB parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter !-- Maximum number of dB connections in pool. Make sure you configure your mysqld max_connections large enough to handle all of your db connections. Set to 0 for no limit. -- parameter namemaxActive/name value100/value /parameter !-- Maximum number of idle dB connections to retain in pool. Set to 0 for no limit. -- parameter namemaxIdle/name value30/value /parameter !-- Maximum time to wait for a dB connection to become available in ms, in this example 10 seconds. An Exception is thrown if this timeout is exceeded. Set to -1 to wait indefinitely. -- parameter namemaxWait/name value1/value /parameter !-- username and password for dB connections -- parameter nameusername/name valueiuser/value /parameter parameter namepassword/name valueiuser/value /parameter !-- Class name for JDBC driver -- parameter namedriverClassName/name valueorg.hsqldb.jdbcDriver/value /parameter parameter nameurl/name valuejdbc:hsqldb:hsql://asterix/value /parameter /ResourceParams /Context WEB.XML resource-ref descriptionDB Connection/description res-ref-namejdbc/TestDB/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref Servlet code - Context initCtx = new InitialContext(); Context envCtx = (Context) initCtx.lookup(java:comp/env); DataSource ds = (DataSource)envCtx.lookup(jdbc/TestDB); if (ds != null) { Connection conn = ds.getConnection(); //value of DS is org.apache.commons.dbcp.BasicDataSource@b6548 //and here is exception in Connection conn = ds.getConnection(); java.sql.SQLException: Cannot load JDBC driver class 'null' at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSou rce.java:529) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource .java:312) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Sean Dockery [EMAIL PROTECTED] Certified Java Web Component Developer Certified Delphi Programmer SBD Consultants http://www.sbdconsultants.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Cannot load JDBC driver class 'null'
hello I have run into that problem too, I defined a datasource and put driver and common/lib and defined resource-ref in web.xml of my web. app. but if throws exception when I try to get a connection from datasource I have found. I tried to do it at home with different database with the same result, so I dont think I have mistyped something. I know this problem has been adressed before but I havent found any solution from maillist archives. BTW I have found one related thing: If you open Tomcat admin tool, choose host - context - context name - Data sources it will throw an exception: org.apache.jasper.JasperException: Exception retrieving attribute 'driverClassName' so... I there any known solution ? Maris Orbidans www.datapro.lv - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Cannot load JDBC driver class 'null'
yes it will shutdown tomcat and edit the server.xml file by hand. (add the ResourceParams entry under your context) add the necessary entries, start tomcat and the admin console should work. (at least that's what happens with my tomcat 4.1.18) hope this helps, cristi -Original Message- From: Maris Orbidans [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 30, 2003 11:03 AM To: Tomcat Users List Subject: Cannot load JDBC driver class 'null' hello I have run into that problem too, I defined a datasource and put driver and common/lib and defined resource-ref in web.xml of my web. app. but if throws exception when I try to get a connection from datasource I have found. I tried to do it at home with different database with the same result, so I dont think I have mistyped something. I know this problem has been adressed before but I havent found any solution from maillist archives. BTW I have found one related thing: If you open Tomcat admin tool, choose host - context - context name - Data sources it will throw an exception: org.apache.jasper.JasperException: Exception retrieving attribute 'driverClassName' so... I there any known solution ? Maris Orbidans www.datapro.lv - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Cannot load JDBC driver class 'null'
yeah, as I thought however it's boring , let's hope it will be changed in future releases. Maris -Original Message- From: Cristian Draghici [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 30, 2003 11:07 AM To: Tomcat Users List Subject: RE: Cannot load JDBC driver class 'null' yes it will shutdown tomcat and edit the server.xml file by hand. (add the ResourceParams entry under your context) add the necessary entries, start tomcat and the admin console should work. (at least that's what happens with my tomcat 4.1.18) hope this helps, cristi -Original Message- From: Maris Orbidans [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 30, 2003 11:03 AM To: Tomcat Users List Subject: Cannot load JDBC driver class 'null' hello I have run into that problem too, I defined a datasource and put driver and common/lib and defined resource-ref in web.xml of my web. app. but if throws exception when I try to get a connection from datasource I have found. I tried to do it at home with different database with the same result, so I dont think I have mistyped something. I know this problem has been adressed before but I havent found any solution from maillist archives. BTW I have found one related thing: If you open Tomcat admin tool, choose host - context - context name - Data sources it will throw an exception: org.apache.jasper.JasperException: Exception retrieving attribute 'driverClassName' so... I there any known solution ? Maris Orbidans www.datapro.lv - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Cannot load JDBC driver class 'null'
I keep getting the following error in my catalina.out file. This same application starts up just fine when it has a context path of /cct, but I get the errors when I use path=. Any ideas? WARN [main] JDBCExceptionReporter.logExceptions(35) | SQL Error: 0, SQLState: null ERROR [main] JDBCExceptionReporter.logExceptions(42) | Cannot load JDBC driver class 'null' WARN [main] SessionFactoryImpl.init(163) | Could not obtain connection metadata java.sql.SQLException: Cannot load JDBC driver class 'null' at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.jav a:529) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:3 12) at cirrus.hibernate.connection.DatasourceConnectionProvider.getConnection(Datas ourceConnectionProvider.java:56) at cirrus.hibernate.impl.SessionFactoryImpl.init(SessionFactoryImpl.java:152) at cirrus.hibernate.impl.DatastoreImpl.buildSessionFactory(DatastoreImpl.java:4 03) at cirrus.hibernate.impl.DatastoreImpl.buildSessionFactory(DatastoreImpl.java:3 92) at cirrus.hibernate.cfg.Configuration.configure(Configuration.java:163) at cirrus.hibernate.Hibernate.configure(Hibernate.java:193) at com.comcast.cable.dmc.itd.cct.webapp.StartupServlet.init(StartupServlet.java :58) Also, my oracle connection pool times out after 24 hours - I haven't found a solution after a week or two pinging this list and the struts-user list. Any ideas are greatly appreciated. Setup: 1. classes12.jar in $CATALINA_HOME/common/lib 2. Context file cct.xml in $CATALINA_HOME/webapps - contents are below. 3. web.xml contains JNDI Datasource information. The app works, I just get errors on startup, and timeout after 24 hours. Thanks, Matt web.xml: resource-ref descriptionDB Connection/description res-ref-namejdbc/cctdb/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref cct.xml Context path= docBase=cct debug=99 reloadable=false privileged=true Logger className=org.apache.catalina.logger.FileLogger prefix=cct_log. suffix=.txt timestamp=true/ Realm className=org.apache.catalina.realm.JDBCRealm debug=99 driverName=oracle.jdbc.driver.OracleDriver digest=SHA connectionURL=jdbc:oracle:thin:[EMAIL PROTECTED]:1521:cctprd userTable=user_sys_access userNameCol=userid userCredCol=password userRoleTable=user_role roleNameCol=role_name/ Resource name=jdbc/cctdb auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/cctdb parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter !-- Maximum number of dB connections in pool. Set to 0 for no limit. -- parameter namemaxActive/name value0/value /parameter !-- Maximum number of idle dB connections to retain in pool. Set to 0 for no limit. -- parameter namemaxIdle/name value0/value /parameter !-- Maximum time to wait for a dB connection to become available in ms, in this example 10 seconds. An Exception is thrown if this timeout is exceeded. Set to -1 to wait indefinitely. -- parameter namemaxWait/name value1/value /parameter !-- Database username and password for connections -- parameter nameusername/name valuecct_tool/value /parameter parameter namepassword/name valuetiger/value /parameter !-- Class name for Oracle JDBC driver -- parameter namedriverClassName/name valueoracle.jdbc.pool.OracleConnectionPoolDataSource/value /parameter !-- The JDBC connection url for connecting to your db. -- parameter nameurl/name valuejdbc:oracle:thin:@10.31.41.14:1521:cctprd/value /parameter parameter nameremoveAbandoned/name valuetrue/value /parameter parameter nameremoveAbandonedTimeout/name value60/value /parameter parameter namelogAbandoned/name valuetrue/value /parameter parameter namevalidationQuery/name valueSELECT 1 FROM DUAL/value /parameter /ResourceParams -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Cannot load JDBC driver class 'null'
I am using Apache 1.3.19 and here are the lines I added to the httpd.conf file: IfModule !mod_jk.c LoadModule jk_module libexec/mod_jk.so /IfModule AddModule mod_jk.c #Tomcat jk connector IfModule mod_jk.c JkWorkersFile /usr/local/tomcat/conf/jk/workers.properties JkLogFile /usr/local/tomcat/logs/mod_jk.log JkLogLevel debug JkMount /intranet ajp13 JkMount /intranet/* ajp13 /IfModule My jk connector was compiled from source: jakarta-tomcat-connectors-jk-1.2.0-src.tar I will post my other config files if they are wanted. Note that I was not able to get it working all week with a warp connector and was about to give up when I thought I might as well setup a mod_jk connector since I've been meaning to to do that anyway and as soon as I did it worked. I did not change any of my jdbc/jndi settings at all, just setup the mod_jk instead of warp. Daren On Sat, 11 Jan 2003, Paul Carpenter wrote: Daren That's interesting, I'm using the mod_jk connectot and warp, but still have the null problem. What does your Apache config look like? Paul On Saturday, January 11, 2003, at 08:52 AM, Daren R. Sefcik wrote: Humm...well what do you know..I now have it working! I was using a WARP Connector using mod_webapp. I just configured a mod_jk connector instead and now it works..maybe this is a WARP bug issue?? http://issues.apache.org/bugzilla/show_bug.cgi?id=6048 I am curious to know if anybody else having this problem can confirm they are using WARP or JK as the connector. Daren On Fri, 10 Jan 2003, Daren R. Sefcik wrote: Yes I have..I have been trying for the last week to figure it out. I have found the same thing that BasicDataSource does not load the driverClassName. I have put my jdbcdriver.jar file in the common/lib dir..and I know it's in the classpath of tomcat as I can write a jsp page with a Class.forName and have it work fine.The problem only surfaces when doing jndi Datasource lookups. The driverClassName from the server.xml file is never passed to BasicDataSource. If anyone can spot errors in my configuration please let me know, thanks.. I know that the server.mxl is being read from my logs: 2003-01-10 11:22:29 NamingContextListener[/Apache/localhost/intranet]: Creating JNDI naming context 2003-01-10 11:22:29 NamingContextListener[/Apache/localhost/intranet]: Resource parameters for jdbc/TestDB = ResourceParams[name=jdbc/TestDB, parameters={factory=org.apache.commons.dbcp.BasicDataSourceFactory, password=user, url=jdbc:jtds:sqlserver://ns1:1433/WebDB, driverClassName=net.sourceforge.jtds.jdbcx.TdsDataSource, username=webuser}] 2003-01-10 11:22:29 NamingContextListener[/Apache/localhost/intranet]: Adding resource ref jdbc/TestDB 2003-01-10 11:22:29 NamingContextListener[/Apache/localhost/intranet]: ResourceRef[className=javax.sql.DataSource,factoryClassLocation=null,f actoryClassName=org.apache.naming.factory.ResourceFactory,{type=scope, content=Shareable},{type=auth,content=Container},{type=factory,content =org.apache.commons.dbcp.BasicDataSourceFactory},{type=password,conten t=user},{type=url,content=jdbc:jtds:sqlserver://ns1:1433/ WebDB},{type=driverClassName,content=net.sourceforge.jtds.jdbcx.TdsDat aSource},{type=username,content=webuser}] Here is the error from catalina.out: new context ctx lookup gonna try a ds.getConnection java.sql.SQLException: Cannot load JDBC driver class 'null' at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSour ce.java:529) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource. java:312) at foo.DBTest.init(DBTest.java:34) at org.apache.jsp.test_jsp._jspService(test_jsp.java:49) Here is my server.xml: Server port=8005 shutdown=SHUTDOWN debug=0 GlobalNamingResources Environment name=simpleValue type=java.lang.Integer value=30/ /GlobalNamingResources Service name=Tomcat-Apache Connector className=org.apache.catalina.connector.warp.WarpConnector port=8008 minProcessors=5 maxProcessors=75 enableLookups=true appBase=webapps acceptCount=10 debug=5/ !-- Replace localhost with what your Apache ServerName is set to -- Engine className=org.apache.catalina.connector.warp.WarpEngine name=Apache debug=5 Host name=localhost debug=5 appBase=webapps unpackWARs=true autoDeploy=true Context path=/intranet docBase=intranet debug=5 reloadable=true crossContext=true Resource name=jdbc/TestDB auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/TestDB parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter
Re: Cannot load JDBC driver class 'null'
I have experience that before, but that was my fault rather than tomcat. I put the source jar instead of the driver binary. Other than that DBCP worked as described in the tomcat documents. Cannot load JDBC driver class null usually means that it couldn't find the jdbc driver that you specified in the server.xml . David Durst wrote: Has anyone else experienced this I have read a couple of posts that I found off google, and basically what they are saying is non of the information in the server.xml file is being passed to the Datasource or something of that nature. The suggested fix was to hardcode everything but that kind of defeats the purpose. Does anyone know how to fix this issue w/ out hardcoding?? -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Cannot load JDBC driver class 'null'
I have experience that before, but that was my fault rather than tomcat. I put the source jar instead of the driver binary. Other than that DBCP worked as described in the tomcat documents. Cannot load JDBC driver class null usually means that it couldn't find the jdbc driver that you specified in the server.xml . that is strange cause I have it in $CATALINA_HOME/common/lib And it is exactly the same class that I used when I was using JDBC non-jndi. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Cannot load JDBC driver class 'null'
I had that error too. In my case it had to do with how I configured web.xml and server.xml. I was able to get the example from the docs working but when switching to /root context got mixed up. You aren't using the root context are you? In any case, I would double check again server.xml and web.xml and compare them to the examples. That's where my driver class 'null' problem arose. Shawn - Original Message - From: David Durst [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, January 10, 2003 6:43 PM Subject: Re: Cannot load JDBC driver class 'null' I have experience that before, but that was my fault rather than tomcat. I put the source jar instead of the driver binary. Other than that DBCP worked as described in the tomcat documents. Cannot load JDBC driver class null usually means that it couldn't find the jdbc driver that you specified in the server.xml . that is strange cause I have it in $CATALINA_HOME/common/lib And it is exactly the same class that I used when I was using JDBC non-jndi. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Cannot load JDBC driver class 'null'
Has anyone else experienced this I have read a couple of posts that I found off google, and basically what they are saying is non of the information in the server.xml file is being passed to the Datasource or something of that nature. The suggested fix was to hardcode everything but that kind of defeats the purpose. Does anyone know how to fix this issue w/ out hardcoding?? Does anyone at ALL know how to fix this problem because I have now reached the end of the internet looking for the answer and can not seem to find the actual solution. Let me clarify the issue so someone can give a legitimate answer, not yeah I experience that once but I add a period to some conf file and it work :) Ok I am attempting to create a Global Object Pool of DB connections by using the Global Resource Naming, Resource Resource parameters. I am able to load the Datasource out of JNDI but when I attempt to get a connection it throws the exception. From what I have heard this is caused by the attributes in server.xml not getting to the Object Pool, but I am not familuar w/ the code base enough to go tinkering to try to make it work correctly. P.S. Tomcat 4.1.18 Postgres 7.2.1-5 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Cannot load JDBC driver class 'null'
Yes I have..I have been trying for the last week to figure it out. I have found the same thing that BasicDataSource does not load the driverClassName. I have put my jdbcdriver.jar file in the common/lib dir..and I know it's in the classpath of tomcat as I can write a jsp page with a Class.forName and have it work fine.The problem only surfaces when doing jndi Datasource lookups. The driverClassName from the server.xml file is never passed to BasicDataSource. If anyone can spot errors in my configuration please let me know, thanks.. I know that the server.mxl is being read from my logs: 2003-01-10 11:22:29 NamingContextListener[/Apache/localhost/intranet]: Creating JNDI naming context 2003-01-10 11:22:29 NamingContextListener[/Apache/localhost/intranet]: Resource parameters for jdbc/TestDB = ResourceParams[name=jdbc/TestDB, parameters={factory=org.apache.commons.dbcp.BasicDataSourceFactory, password=user, url=jdbc:jtds:sqlserver://ns1:1433/WebDB, driverClassName=net.sourceforge.jtds.jdbcx.TdsDataSource, username=webuser}] 2003-01-10 11:22:29 NamingContextListener[/Apache/localhost/intranet]: Adding resource ref jdbc/TestDB 2003-01-10 11:22:29 NamingContextListener[/Apache/localhost/intranet]: ResourceRef[className=javax.sql.DataSource,factoryClassLocation=null,factoryClassName=org.apache.naming.factory.ResourceFactory,{type=scope,content=Shareable},{type=auth,content=Container},{type=factory,content=org.apache.commons.dbcp.BasicDataSourceFactory},{type=password,content=user},{type=url,content=jdbc:jtds:sqlserver://ns1:1433/WebDB},{type=driverClassName,content=net.sourceforge.jtds.jdbcx.TdsDataSource},{type=username,content=webuser}] Here is the error from catalina.out: new context ctx lookup gonna try a ds.getConnection java.sql.SQLException: Cannot load JDBC driver class 'null' at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:529) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:312) at foo.DBTest.init(DBTest.java:34) at org.apache.jsp.test_jsp._jspService(test_jsp.java:49) Here is my server.xml: Server port=8005 shutdown=SHUTDOWN debug=0 GlobalNamingResources Environment name=simpleValue type=java.lang.Integer value=30/ /GlobalNamingResources Service name=Tomcat-Apache Connector className=org.apache.catalina.connector.warp.WarpConnector port=8008 minProcessors=5 maxProcessors=75 enableLookups=true appBase=webapps acceptCount=10 debug=5/ !-- Replace localhost with what your Apache ServerName is set to -- Engine className=org.apache.catalina.connector.warp.WarpEngine name=Apache debug=5 Host name=localhost debug=5 appBase=webapps unpackWARs=true autoDeploy=true Context path=/intranet docBase=intranet debug=5 reloadable=true crossContext=true Resource name=jdbc/TestDB auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/TestDB parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter parameter namedriverClassName/name valuenet.sourceforge.jtds.jdbcx.TdsDataSource/value /parameter parameter nameurl/name valuejdbc:jtds:sqlserver://ns1:1433/WebDB/value /parameter parameter nameusername/name valuewebuser/value /parameter parameter namepassword/name valueuser/value /parameter /ResourceParams Logger className=org.apache.catalina.logger.FileLogger prefix=intranet_log. suffix=.txt timestamp=true/ /Context /Host /Engine /Service /Server And here is the webapps/intranet/WEB-INF/web.xml: ?xml version=1.0? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.2//EN http://java.sun.com/j2ee/dtds/web-app_2.2.dtd; web-app resource-ref descriptionDB Connection/description res-ref-namejdbc/TestDB/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref /web-app Has anyone else experienced this I have read a couple of posts that I found off google, and basically what they are saying is non of the information in the server.xml file is being passed to the Datasource or something of that nature. The suggested fix was to hardcode everything but that kind of defeats the purpose. I have experience that before, but that was my fault rather than tomcat. I put the source jar instead of the driver binary. Other than that DBCP worked as described in the tomcat documents. Cannot load JDBC driver class null usually means that it couldn't find the jdbc driver that you specified in the server.xml . that is strange cause I
Re: Cannot load JDBC driver class 'null'
Humm...well what do you know..I now have it working! I was using a WARP Connector using mod_webapp. I just configured a mod_jk connector instead and now it works..maybe this is a WARP bug issue?? http://issues.apache.org/bugzilla/show_bug.cgi?id=6048 I am curious to know if anybody else having this problem can confirm they are using WARP or JK as the connector. Daren On Fri, 10 Jan 2003, Daren R. Sefcik wrote: Yes I have..I have been trying for the last week to figure it out. I have found the same thing that BasicDataSource does not load the driverClassName. I have put my jdbcdriver.jar file in the common/lib dir..and I know it's in the classpath of tomcat as I can write a jsp page with a Class.forName and have it work fine.The problem only surfaces when doing jndi Datasource lookups. The driverClassName from the server.xml file is never passed to BasicDataSource. If anyone can spot errors in my configuration please let me know, thanks.. I know that the server.mxl is being read from my logs: 2003-01-10 11:22:29 NamingContextListener[/Apache/localhost/intranet]: Creating JNDI naming context 2003-01-10 11:22:29 NamingContextListener[/Apache/localhost/intranet]: Resource parameters for jdbc/TestDB = ResourceParams[name=jdbc/TestDB, parameters={factory=org.apache.commons.dbcp.BasicDataSourceFactory, password=user, url=jdbc:jtds:sqlserver://ns1:1433/WebDB, driverClassName=net.sourceforge.jtds.jdbcx.TdsDataSource, username=webuser}] 2003-01-10 11:22:29 NamingContextListener[/Apache/localhost/intranet]: Adding resource ref jdbc/TestDB 2003-01-10 11:22:29 NamingContextListener[/Apache/localhost/intranet]: ResourceRef[className=javax.sql.DataSource,factoryClassLocation=null,factoryClassName=org.apache.naming.factory.ResourceFactory,{type=scope,content=Shareable},{type=auth,content=Container},{type=factory,content=org.apache.commons.dbcp.BasicDataSourceFactory},{type=password,content=user},{type=url,content=jdbc:jtds:sqlserver://ns1:1433/WebDB},{type=driverClassName,content=net.sourceforge.jtds.jdbcx.TdsDataSource},{type=username,content=webuser}] Here is the error from catalina.out: new context ctx lookup gonna try a ds.getConnection java.sql.SQLException: Cannot load JDBC driver class 'null' at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:529) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:312) at foo.DBTest.init(DBTest.java:34) at org.apache.jsp.test_jsp._jspService(test_jsp.java:49) Here is my server.xml: Server port=8005 shutdown=SHUTDOWN debug=0 GlobalNamingResources Environment name=simpleValue type=java.lang.Integer value=30/ /GlobalNamingResources Service name=Tomcat-Apache Connector className=org.apache.catalina.connector.warp.WarpConnector port=8008 minProcessors=5 maxProcessors=75 enableLookups=true appBase=webapps acceptCount=10 debug=5/ !-- Replace localhost with what your Apache ServerName is set to -- Engine className=org.apache.catalina.connector.warp.WarpEngine name=Apache debug=5 Host name=localhost debug=5 appBase=webapps unpackWARs=true autoDeploy=true Context path=/intranet docBase=intranet debug=5 reloadable=true crossContext=true Resource name=jdbc/TestDB auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/TestDB parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter parameter namedriverClassName/name valuenet.sourceforge.jtds.jdbcx.TdsDataSource/value /parameter parameter nameurl/name valuejdbc:jtds:sqlserver://ns1:1433/WebDB/value /parameter parameter nameusername/name valuewebuser/value /parameter parameter namepassword/name valueuser/value /parameter /ResourceParams Logger className=org.apache.catalina.logger.FileLogger prefix=intranet_log. suffix=.txt timestamp=true/ /Context /Host /Engine /Service /Server And here is the webapps/intranet/WEB-INF/web.xml: ?xml version=1.0? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.2//EN http://java.sun.com/j2ee/dtds/web-app_2.2.dtd; web-app resource-ref descriptionDB Connection/description res-ref-namejdbc/TestDB/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref /web-app Has anyone else experienced this I have read a couple of posts that I found off google, and basically what they are saying is non
Re: Cannot load JDBC driver class 'null'
Humm...well what do you know..I now have it working! I was using a WARP Connector using mod_webapp. I just configured a mod_jk connector instead and now it works..maybe this is a WARP bug issue?? http://issues.apache.org/bugzilla/show_bug.cgi?id=6048 I am curious to know if anybody else having this problem can confirm they are using WARP or JK as the connector. I am not sure why the connector would affect JDBC. But since I am not using a connector I don't why I am still having this issue. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Cannot load JDBC driver class 'null'
I had that error too and just reproduced it again to be sure of how I resolved it. Let's say the following is a correct entry in server.xml: Context path=/DBTest docBase=DBTest debug=5 reloadable=true crossContext=true but I make a mistake and use Context path=/dBTest docBase=DBTest debug=5 reloadable=true crossContext=true **Notice the D vs d in the context path** Then I get a Cannot load JDBC driver class 'null' error message With the root context, where I had my problem, it was confusing because I needed path=/root and not path=/. Also, the error message is seemingly unrelated to the actual problem Anyway, whether or not this is the origin of your error I do not know, but only know that I got the same message when my context path was incorrect. Shawn On Sat, 2003-01-11 at 05:21, Daren R. Sefcik wrote: Yes I have..I have been trying for the last week to figure it out. I have found the same thing that BasicDataSource does not load the driverClassName. I have put my jdbcdriver.jar file in the common/lib dir..and I know it's in the classpath of tomcat as I can write a jsp page with a Class.forName and have it work fine.The problem only surfaces when doing jndi Datasource lookups. The driverClassName from the server.xml file is never passed to BasicDataSource. If anyone can spot errors in my configuration please let me know, thanks.. I know that the server.mxl is being read from my logs: 2003-01-10 11:22:29 NamingContextListener[/Apache/localhost/intranet]: Creating JNDI naming context 2003-01-10 11:22:29 NamingContextListener[/Apache/localhost/intranet]: Resource parameters for jdbc/TestDB = ResourceParams[name=jdbc/TestDB, parameters={factory=org.apache.commons.dbcp.BasicDataSourceFactory, password=user, url=jdbc:jtds:sqlserver://ns1:1433/WebDB, driverClassName=net.sourceforge.jtds.jdbcx.TdsDataSource, username=webuser}] 2003-01-10 11:22:29 NamingContextListener[/Apache/localhost/intranet]: Adding resource ref jdbc/TestDB 2003-01-10 11:22:29 NamingContextListener[/Apache/localhost/intranet]: ResourceRef[className=javax.sql.DataSource,factoryClassLocation=null,factoryClassName=org.apache.naming.factory.ResourceFactory,{type=scope,content=Shareable},{type=auth,content=Container},{type=factory,content=org.apache.commons.dbcp.BasicDataSourceFactory},{type=password,content=user},{type=url,content=jdbc:jtds:sqlserver://ns1:1433/WebDB},{type=driverClassName,content=net.sourceforge.jtds.jdbcx.TdsDataSource},{type=username,content=webuser}] Here is the error from catalina.out: new context ctx lookup gonna try a ds.getConnection java.sql.SQLException: Cannot load JDBC driver class 'null' at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:529) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:312) at foo.DBTest.init(DBTest.java:34) at org.apache.jsp.test_jsp._jspService(test_jsp.java:49) Here is my server.xml: Server port=8005 shutdown=SHUTDOWN debug=0 GlobalNamingResources Environment name=simpleValue type=java.lang.Integer value=30/ /GlobalNamingResources Service name=Tomcat-Apache Connector className=org.apache.catalina.connector.warp.WarpConnector port=8008 minProcessors=5 maxProcessors=75 enableLookups=true appBase=webapps acceptCount=10 debug=5/ !-- Replace localhost with what your Apache ServerName is set to -- Engine className=org.apache.catalina.connector.warp.WarpEngine name=Apache debug=5 Host name=localhost debug=5 appBase=webapps unpackWARs=true autoDeploy=true Context path=/intranet docBase=intranet debug=5 reloadable=true crossContext=true Resource name=jdbc/TestDB auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/TestDB parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter parameter namedriverClassName/name valuenet.sourceforge.jtds.jdbcx.TdsDataSource/value /parameter parameter nameurl/name valuejdbc:jtds:sqlserver://ns1:1433/WebDB/value /parameter parameter nameusername/name valuewebuser/value /parameter parameter namepassword/name valueuser/value /parameter /ResourceParams Logger className=org.apache.catalina.logger.FileLogger prefix=intranet_log. suffix=.txt timestamp=true/ /Context /Host /Engine /Service /Server And here is the webapps/intranet/WEB-INF/web.xml: ?xml version=1.0? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.2//EN
Re: Cannot load JDBC driver class 'null'
Nope, I don't believe after check my server.xml that the below is the problem. I had that error too and just reproduced it again to be sure of how I resolved it. Let's say the following is a correct entry in server.xml: Context path=/DBTest docBase=DBTest debug=5 reloadable=true crossContext=true but I make a mistake and use Context path=/dBTest docBase=DBTest debug=5 reloadable=true crossContext=true **Notice the D vs d in the context path** Then I get a Cannot load JDBC driver class 'null' error message With the root context, where I had my problem, it was confusing because I needed path=/root and not path=/. Also, the error message is seemingly unrelated to the actual problem Anyway, whether or not this is the origin of your error I do not know, but only know that I got the same message when my context path was incorrect. Shawn On Sat, 2003-01-11 at 05:21, Daren R. Sefcik wrote: Yes I have..I have been trying for the last week to figure it out. I have found the same thing that BasicDataSource does not load the driverClassName. I have put my jdbcdriver.jar file in the common/lib dir..and I know it's in the classpath of tomcat as I can write a jsp page with a Class.forName and have it work fine.The problem only surfaces when doing jndi Datasource lookups. The driverClassName from the server.xml file is never passed to BasicDataSource. If anyone can spot errors in my configuration please let me know, thanks.. I know that the server.mxl is being read from my logs: 2003-01-10 11:22:29 NamingContextListener[/Apache/localhost/intranet]: Creating JNDI naming context 2003-01-10 11:22:29 NamingContextListener[/Apache/localhost/intranet]: Resource parameters for jdbc/TestDB = ResourceParams[name=jdbc/TestDB, parameters={factory=org.apache.commons.dbcp.BasicDataSourceFactory, password=user, url=jdbc:jtds:sqlserver://ns1:1433/WebDB, driverClassName=net.sourceforge.jtds.jdbcx.TdsDataSource, username=webuser}] 2003-01-10 11:22:29 NamingContextListener[/Apache/localhost/intranet]: Adding resource ref jdbc/TestDB 2003-01-10 11:22:29 NamingContextListener[/Apache/localhost/intranet]: ResourceRef[className=javax.sql.DataSource,factoryClassLocation=null,factoryClassName=org.apache.naming.factory.ResourceFactory,{type=scope,content=Shareable},{type=auth,content=Container},{type=factory,content=org.apache.commons.dbcp.BasicDataSourceFactory},{type=password,content=user},{type=url,content=jdbc:jtds:sqlserver://ns1:1433/WebDB},{type=driverClassName,content=net.sourceforge.jtds.jdbcx.TdsDataSource},{type=username,content=webuser}] Here is the error from catalina.out: new context ctx lookup gonna try a ds.getConnection java.sql.SQLException: Cannot load JDBC driver class 'null' at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:529) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:312) at foo.DBTest.init(DBTest.java:34) at org.apache.jsp.test_jsp._jspService(test_jsp.java:49) Here is my server.xml: Server port=8005 shutdown=SHUTDOWN debug=0 GlobalNamingResources Environment name=simpleValue type=java.lang.Integer value=30/ /GlobalNamingResources Service name=Tomcat-Apache Connector className=org.apache.catalina.connector.warp.WarpConnector port=8008 minProcessors=5 maxProcessors=75 enableLookups=true appBase=webapps acceptCount=10 debug=5/ !-- Replace localhost with what your Apache ServerName is set to -- Engine className=org.apache.catalina.connector.warp.WarpEngine name=Apache debug=5 Host name=localhost debug=5 appBase=webapps unpackWARs=true autoDeploy=true Context path=/intranet docBase=intranet debug=5 reloadable=true crossContext=true Resource name=jdbc/TestDB auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/TestDB parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter parameter namedriverClassName/name valuenet.sourceforge.jtds.jdbcx.TdsDataSource/value /parameter parameter nameurl/name valuejdbc:jtds:sqlserver://ns1:1433/WebDB/value /parameter parameter nameusername/name valuewebuser/value /parameter parameter namepassword/name valueuser/value /parameter /ResourceParams Logger className=org.apache.catalina.logger.FileLogger prefix=intranet_log. suffix=.txt timestamp=true/ /Context /Host /Engine /Service /Server And here is the webapps/intranet/WEB-INF/web.xml: ?xml version=1.0? !DOCTYPE web-app PUBLIC -//Sun
Re: Cannot load JDBC driver class 'null'
Daren That's interesting, I'm using the mod_jk connectot and warp, but still have the null problem. What does your Apache config look like? Paul On Saturday, January 11, 2003, at 08:52 AM, Daren R. Sefcik wrote: Humm...well what do you know..I now have it working! I was using a WARP Connector using mod_webapp. I just configured a mod_jk connector instead and now it works..maybe this is a WARP bug issue?? http://issues.apache.org/bugzilla/show_bug.cgi?id=6048 I am curious to know if anybody else having this problem can confirm they are using WARP or JK as the connector. Daren On Fri, 10 Jan 2003, Daren R. Sefcik wrote: Yes I have..I have been trying for the last week to figure it out. I have found the same thing that BasicDataSource does not load the driverClassName. I have put my jdbcdriver.jar file in the common/lib dir..and I know it's in the classpath of tomcat as I can write a jsp page with a Class.forName and have it work fine.The problem only surfaces when doing jndi Datasource lookups. The driverClassName from the server.xml file is never passed to BasicDataSource. If anyone can spot errors in my configuration please let me know, thanks.. I know that the server.mxl is being read from my logs: 2003-01-10 11:22:29 NamingContextListener[/Apache/localhost/intranet]: Creating JNDI naming context 2003-01-10 11:22:29 NamingContextListener[/Apache/localhost/intranet]: Resource parameters for jdbc/TestDB = ResourceParams[name=jdbc/TestDB, parameters={factory=org.apache.commons.dbcp.BasicDataSourceFactory, password=user, url=jdbc:jtds:sqlserver://ns1:1433/WebDB, driverClassName=net.sourceforge.jtds.jdbcx.TdsDataSource, username=webuser}] 2003-01-10 11:22:29 NamingContextListener[/Apache/localhost/intranet]: Adding resource ref jdbc/TestDB 2003-01-10 11:22:29 NamingContextListener[/Apache/localhost/intranet]: ResourceRef[className=javax.sql.DataSource,factoryClassLocation=null,f actoryClassName=org.apache.naming.factory.ResourceFactory,{type=scope, content=Shareable},{type=auth,content=Container},{type=factory,content =org.apache.commons.dbcp.BasicDataSourceFactory},{type=password,conten t=user},{type=url,content=jdbc:jtds:sqlserver://ns1:1433/ WebDB},{type=driverClassName,content=net.sourceforge.jtds.jdbcx.TdsDat aSource},{type=username,content=webuser}] Here is the error from catalina.out: new context ctx lookup gonna try a ds.getConnection java.sql.SQLException: Cannot load JDBC driver class 'null' at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSour ce.java:529) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource. java:312) at foo.DBTest.init(DBTest.java:34) at org.apache.jsp.test_jsp._jspService(test_jsp.java:49) Here is my server.xml: Server port=8005 shutdown=SHUTDOWN debug=0 GlobalNamingResources Environment name=simpleValue type=java.lang.Integer value=30/ /GlobalNamingResources Service name=Tomcat-Apache Connector className=org.apache.catalina.connector.warp.WarpConnector port=8008 minProcessors=5 maxProcessors=75 enableLookups=true appBase=webapps acceptCount=10 debug=5/ !-- Replace localhost with what your Apache ServerName is set to -- Engine className=org.apache.catalina.connector.warp.WarpEngine name=Apache debug=5 Host name=localhost debug=5 appBase=webapps unpackWARs=true autoDeploy=true Context path=/intranet docBase=intranet debug=5 reloadable=true crossContext=true Resource name=jdbc/TestDB auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/TestDB parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter parameter namedriverClassName/name valuenet.sourceforge.jtds.jdbcx.TdsDataSource/value /parameter parameter nameurl/name valuejdbc:jtds:sqlserver://ns1:1433/WebDB/value /parameter parameter nameusername/name valuewebuser/value /parameter parameter namepassword/name valueuser/value /parameter /ResourceParams Logger className=org.apache.catalina.logger.FileLogger prefix=intranet_log. suffix=.txt timestamp=true/ /Context /Host /Engine /Service /Server And here is the webapps/intranet/WEB-INF/web.xml: ?xml version=1.0? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.2//EN http://java.sun.com/j2ee/dtds/web-app_2.2.dtd; web-app resource-ref descriptionDB Connection/description res-ref-namejdbc/TestDB/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref /web-app
Cannot load JDBC driver class 'null'
Has anyone else experienced this I have read a couple of posts that I found off google, and basically what they are saying is non of the information in the server.xml file is being passed to the Datasource or something of that nature. The suggested fix was to hardcode everything but that kind of defeats the purpose. Does anyone know how to fix this issue w/ out hardcoding?? -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Resource - Cannot load JDBC driver class 'null'
Hello, I created a DataSource(jdbc/SAA) through Tomcat Administration and put into my web.xml: resource-ref descriptionDownload example/description res-ref-namejdbc/SAA/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref But when I try to use it I get the following error: java.lang.Exception: java.sql.SQLException: Cannot load JDBC driver class 'null' Tomcat changed by itself the server.xml with many things like: Context className=org.apache.catalina.core.StandardContext cachingAllowed=true charsetMapperClass=org.apache.catalina.util.CharsetMapper cookies=true crossContext=false debug=0 docBase=D:\java\jakarta-tomcat-4.1.12\webapps\sampleFilters mapperClass=org.apache.catalina.core.StandardContextMapper path=/sampleFilters privileged=false reloadable=false swallowOutput=false useNaming=true wrapperClass=org.apache.catalina.core.StandardWrapper Resource auth=Container description=Download example name=jdbc/SAA scope=Shareable type=javax.sql.DataSource/ /Context I searched other lists and found out that many people had this problem, but I found no soulution. Could somebody help me? Thanks. Ricardo Costa. Don't E-Mail, ZipMail! http://www.zipmail.com/ -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Resource - Cannot load JDBC driver class 'null'
On Wed, 8 Jan 2003 [EMAIL PROTECTED] wrote: Date: Wed, 08 Jan 2003 07:54:31 -0500 From: [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Resource - Cannot load JDBC driver class 'null' Hello, I created a DataSource(jdbc/SAA) through Tomcat Administration and put into my web.xml: resource-ref descriptionDownload example/description res-ref-namejdbc/SAA/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref But when I try to use it I get the following error: java.lang.Exception: java.sql.SQLException: Cannot load JDBC driver class 'null' Tomcat changed by itself the server.xml with many things like: Context className=org.apache.catalina.core.StandardContext cachingAllowed=true charsetMapperClass=org.apache.catalina.util.CharsetMapper cookies=true crossContext=false debug=0 docBase=D:\java\jakarta-tomcat-4.1.12\webapps\sampleFilters mapperClass=org.apache.catalina.core.StandardContextMapper path=/sampleFilters privileged=false reloadable=false swallowOutput=false useNaming=true wrapperClass=org.apache.catalina.core.StandardWrapper Resource auth=Container description=Download example name=jdbc/SAA scope=Shareable type=javax.sql.DataSource/ /Context Note that there are no nested elements inside the Context. That implies that you created the new data source in the global resources area. To make it visible to a webapp, you also need to create a Resource Link inside the Context, by highlighting this context in the tree and selecting the add resource link action. I searched other lists and found out that many people had this problem, but I found no soulution. Could somebody help me? Thanks. Ricardo Costa. Craig -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
A solution: java.sql.SQLException: Cannot load JDBC driver class 'null'
Hi all, I have found a solution to this problem. Its by no means elegant but if you get as desperate as I have got then you may wish to do the same. It appears that none of the information that you specify in your server.xml gets through to the actual dbcp stuff, don't ask me why. So what I did was crack open the source and hardcode all the details into org.apache.commons.dbcp.BasicDataSource. Then I rebuilt, redeployed and everything works perfectly. I know this is not scalable or pretty but it is a solution that *will* work. The only question I have left remaining is that is it a security issue having the DB password wrapped up in that jar? (I can't see one) assuming that the server is never compromised. Thanks everybody for all the help given over the past couple of days, it was very much appreciated. regards, Dave
Re: java.sql.SQLException: Cannot load JDBC driver class 'null'
Doh! Teach me for staying up so late :P Thanks it works. shawn wrote: Try changing this value ResourceParams name=jdbc/TestDB Shouldn't it be jdbc/InfectedDB ? That's my guess. Shawn On Thu, 2003-01-02 at 12:29, Anastasios Angelidis wrote: Hi I downloaded the MySQL Connector/J 2.0.14 JDBC drivers and I copied the mysql-connector-java-2.0.14-bin.jar to the common/lib folder... Here is my server.xml context config... Context path=/infected docBase=infected debug=5 reloadable=true crossContext=true Logger className=org.apache.catalina.logger.FileLogger prefix=localhost_infected_log. suffix=.txt timestamp=true/ Resource name=jdbc/InfectedDB auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/TestDB parameternamefactory/namevalueorg.apache.commons.dbcp.BasicDataSourceFactory/value/parameter parameternamemaxActive/namevalue100/value/parameter parameternamemaxIdle/namevalue30/value/parameter parameternamemaxWait/namevalue1/value/parameter parameternameusername/namevaluexx/value/parameter parameternamepassword/namevaluexx/value/parameter parameternamedriverClassName/namevaluecom.mysql.jdbc.Driver/value/parameter parameternameurl/namevaluejdbc:mysql://localhost:3306/infected/value/parameter /ResourceParams /Context Here is my web.xml... web-app display-nameinfected rhythms/display-name descriptioninfected rhythms web site/description resource-ref descriptionDB Connection/description res-ref-namejdbc/InfectedDB/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref /web-app Then I worte this simple JSP code... try { Context ctx = new InitialContext(); DataSource ds = (DataSource)ctx.lookup(java:comp/env/jdbc/InfectedDB); Connection conn = ds.getConnection(); The rest of the code... } catch(Exception ex) { ex.printStackTrace(); } The exception os caught whne trying to get the connection Connection conn = ds.getConnection(); Any ideas? Thanks The stack trace... java.sql.SQLException: Cannot load JDBC driver class 'null' at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:529) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:312) at org.apache.jsp.artists_jsp._jspService(artists_jsp.java:57) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:204) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:509) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995
java.sql.SQLException: Cannot load JDBC driver class 'null'
Hi I downloaded the MySQL Connector/J 2.0.14 JDBC drivers and I copied the mysql-connector-java-2.0.14-bin.jar to the common/lib folder... Here is my server.xml context config... Context path=/infected docBase=infected debug=5 reloadable=true crossContext=true Logger className=org.apache.catalina.logger.FileLogger prefix=localhost_infected_log. suffix=.txt timestamp=true/ Resource name=jdbc/InfectedDB auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/TestDB parameternamefactory/namevalueorg.apache.commons.dbcp.BasicDataSourceFactory/value/parameter parameternamemaxActive/namevalue100/value/parameter parameternamemaxIdle/namevalue30/value/parameter parameternamemaxWait/namevalue1/value/parameter parameternameusername/namevaluexx/value/parameter parameternamepassword/namevaluexx/value/parameter parameternamedriverClassName/namevaluecom.mysql.jdbc.Driver/value/parameter parameternameurl/namevaluejdbc:mysql://localhost:3306/infected/value/parameter /ResourceParams /Context Here is my web.xml... web-app display-nameinfected rhythms/display-name descriptioninfected rhythms web site/description resource-ref descriptionDB Connection/description res-ref-namejdbc/InfectedDB/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref /web-app Then I worte this simple JSP code... try { Context ctx = new InitialContext(); DataSource ds = (DataSource)ctx.lookup(java:comp/env/jdbc/InfectedDB); Connection conn = ds.getConnection(); The rest of the code... } catch(Exception ex) { ex.printStackTrace(); } The exception os caught whne trying to get the connection Connection conn = ds.getConnection(); Any ideas? Thanks The stack trace... java.sql.SQLException: Cannot load JDBC driver class 'null' at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:529) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:312) at org.apache.jsp.artists_jsp._jspService(artists_jsp.java:57) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:204) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:509) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke
Re: java.sql.SQLException: Cannot load JDBC driver class 'null'
Try changing this value ResourceParams name=jdbc/TestDB Shouldn't it be jdbc/InfectedDB ? That's my guess. Shawn On Thu, 2003-01-02 at 12:29, Anastasios Angelidis wrote: Hi I downloaded the MySQL Connector/J 2.0.14 JDBC drivers and I copied the mysql-connector-java-2.0.14-bin.jar to the common/lib folder... Here is my server.xml context config... Context path=/infected docBase=infected debug=5 reloadable=true crossContext=true Logger className=org.apache.catalina.logger.FileLogger prefix=localhost_infected_log. suffix=.txt timestamp=true/ Resource name=jdbc/InfectedDB auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/TestDB parameternamefactory/namevalueorg.apache.commons.dbcp.BasicDataSourceFactory/value/parameter parameternamemaxActive/namevalue100/value/parameter parameternamemaxIdle/namevalue30/value/parameter parameternamemaxWait/namevalue1/value/parameter parameternameusername/namevaluexx/value/parameter parameternamepassword/namevaluexx/value/parameter parameternamedriverClassName/namevaluecom.mysql.jdbc.Driver/value/parameter parameternameurl/namevaluejdbc:mysql://localhost:3306/infected/value/parameter /ResourceParams /Context Here is my web.xml... web-app display-nameinfected rhythms/display-name descriptioninfected rhythms web site/description resource-ref descriptionDB Connection/description res-ref-namejdbc/InfectedDB/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref /web-app Then I worte this simple JSP code... try { Context ctx = new InitialContext(); DataSource ds = (DataSource)ctx.lookup(java:comp/env/jdbc/InfectedDB); Connection conn = ds.getConnection(); The rest of the code... } catch(Exception ex) { ex.printStackTrace(); } The exception os caught whne trying to get the connection Connection conn = ds.getConnection(); Any ideas? Thanks The stack trace... java.sql.SQLException: Cannot load JDBC driver class 'null' at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:529) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:312) at org.apache.jsp.artists_jsp._jspService(artists_jsp.java:57) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:204) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:509) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480
Re: Cannot load JDBC driver class 'null'
Hello list! Chandolu, Yuva wrote: Hi, I get the error org.apache.jasper.JasperException: Cannot load JDBC driver class 'null'. What is this and how can I proceed from here? I have Tomcat 4.1.12, JDK1.4.1 installed and have DBCP 1.0, Pool 1.0, Collections 2.0, and Oracle's jdbc driver classes12.jar(classes12.zip renamed to .jar) in commons\lib folder. I tried removing javax.sql.* stuff from Oracle jdbc driver it did not work. I have also tried re-creating the classes12.jar from classes12.zip - no luck. Please some one help me. Thanks Yuva I received this exception from time to time before, but I don't understand why is that. That is, one reload gives me null driver class, and another reload is fine. Now it's stable nd working. The only advise I can give you is to recheck your configuration files. Recently I posted my files here, and you can find them it attach. This confiugration works for me. xmljsp.zip Description: Zip compressed data -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Cannot load JDBC driver class 'null'
Hi, I get the error org.apache.jasper.JasperException: Cannot load JDBC driver class 'null'. What is this and how can I proceed from here? I have Tomcat 4.1.12, JDK1.4.1 installed and have DBCP 1.0, Pool 1.0, Collections 2.0, and Oracle's jdbc driver classes12.jar(classes12.zip renamed to .jar) in commons\lib folder. I tried removing javax.sql.* stuff from Oracle jdbc driver it did not work. I have also tried re-creating the classes12.jar from classes12.zip - no luck. Please some one help me. Thanks Yuva
RE: java.sql.SQLException: Cannot load JDBC driver class 'null'
Roberto, How are you instantiating your datasource? You need something like: import javax.naming.Context; import javax.naming.InitialContext; . . . ctx = new InitialContext(); Context envCtx = (Context) ctx.lookup(java:/comp/env/); DataSource ds = (DataSource) envCtx.lookup(/jdbc/art); Hope this helps. -Original Message- From: Roberto Bouza [mailto:[EMAIL PROTECTED]] Sent: Mittwoch, 04. Dezember 2002 23:05 To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: java.sql.SQLException: Cannot load JDBC driver class 'null' Hi. I think I have all the configuration fine, but for some reason when my DBTest try to get the connection from the DB I only get this: - ERRORS start java.sql.SQLException: Cannot load JDBC driver class 'null' at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSourc e.java:529) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.j ava:312) at poseidon.ext.DBTest.init(DBTest.java:27) -- ERRORS end - What's done: 1.) In the $CATALINA_HOME/common/lib I have postgresql.jar (PostgreSQL Driver), commons-collections.jar, commons-pool.jar, commons-dbcp.jar 2.) My server.xml: --- SERVER XML starts Resource name=jdbc/art auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/art parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter parameter namedriverClassName/name valueorg.postgresql.Driver/value /parameter parameter nameurl/name valuejdbc:postgresql://efch-mia-sr-02.efcholdings.com:5432/efch-art/value /parameter parameter nameusername/name value[username]/value /parameter parameter namepassword/name value[password]/value /parameter parameter namemaxActive/name value20/value /parameter parameter namemaxIdle/name value10/value /parameter parameter namemaxWait/name value100/value /parameter /ResourceParams --- SERVER.XML end -- All that code inside a context tag. 3.) My web.xml - STARTS --- resource-ref descriptionpostgreSQL Art's Datasource/description res-ref-namejdbc/art/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref - END --- 5.) I'm using Tomcat 4.1.16 with Apache 2.0, Plus PostgreSQL 7.3 and jdk 1.4.1 Tomcat starts fine, all works fine but when my DBTest is triying to get the connection I get the error mentioned before. I really don't know why tomcat is not seeing the Driver if it is on common/lib...??? Thanks in advance for your help. -- = Roberto Bouza Fraga = === Research Development Engineer Ella Cisneros Fontanals Holdings Ph: (305)-860-0116 / Fax:(305)-860-9401 === e-Mail:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: java.sql.SQLException: Cannot load JDBC driver class 'null'
Normally it's InitialContext initContext=new InitialContext(); DataSource ds = (DataSource) envCtx.lookup(java:/comp/env/jdbc/art); I have the same problem. I tried to move my ressources declaration from the context to the GlobalNamingResources. And it doesn't work ??? - Original Message - From: Roberts, Eric [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Thursday, December 05, 2002 9:45 AM Subject: RE: java.sql.SQLException: Cannot load JDBC driver class 'null' Roberto, How are you instantiating your datasource? You need something like: import javax.naming.Context; import javax.naming.InitialContext; . . . ctx = new InitialContext(); Context envCtx = (Context) ctx.lookup(java:/comp/env/); DataSource ds = (DataSource) envCtx.lookup(/jdbc/art); Hope this helps. -Original Message- From: Roberto Bouza [mailto:[EMAIL PROTECTED]] Sent: Mittwoch, 04. Dezember 2002 23:05 To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: java.sql.SQLException: Cannot load JDBC driver class 'null' Hi. I think I have all the configuration fine, but for some reason when my DBTest try to get the connection from the DB I only get this: - ERRORS start java.sql.SQLException: Cannot load JDBC driver class 'null' at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSourc e.java:529) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.j ava:312) at poseidon.ext.DBTest.init(DBTest.java:27) -- ERRORS end - What's done: 1.) In the $CATALINA_HOME/common/lib I have postgresql.jar (PostgreSQL Driver), commons-collections.jar, commons-pool.jar, commons-dbcp.jar 2.) My server.xml: --- SERVER XML starts Resource name=jdbc/art auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/art parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter parameter namedriverClassName/name valueorg.postgresql.Driver/value /parameter parameter nameurl/name valuejdbc:postgresql://efch-mia-sr-02.efcholdings.com:5432/efch-art/value /parameter parameter nameusername/name value[username]/value /parameter parameter namepassword/name value[password]/value /parameter parameter namemaxActive/name value20/value /parameter parameter namemaxIdle/name value10/value /parameter parameter namemaxWait/name value100/value /parameter /ResourceParams --- SERVER.XML end -- All that code inside a context tag. 3.) My web.xml - STARTS --- resource-ref descriptionpostgreSQL Art's Datasource/description res-ref-namejdbc/art/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref - END --- 5.) I'm using Tomcat 4.1.16 with Apache 2.0, Plus PostgreSQL 7.3 and jdk 1.4.1 Tomcat starts fine, all works fine but when my DBTest is triying to get the connection I get the error mentioned before. I really don't know why tomcat is not seeing the Driver if it is on common/lib...??? Thanks in advance for your help. -- = Roberto Bouza Fraga = === Research Development Engineer Ella Cisneros Fontanals Holdings Ph: (305)-860-0116 / Fax:(305)-860-9401 === e-Mail:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] ** Ce message électronique et tous les fichiers joints ainsi que les informations contenues dans ce message (ci après le message), sont confidentiels et destinés exclusivement à l'usage de la personne à laquelle ils sont adressés. Si vous avez reçu ce message par erreur, merci de le renvoyer à son émetteur et de le détruire. Toute diffusion, publication, totale ou partielle ou divulgation sous quelque forme que ce soit non expressément autorisées de ce message, sont interdites. ** This e-mail, any attachments and the information contained (herein the message) are confidential and intended solely for the use of the addressee(s) if you have received this message in error please send it back to the sender and delete it. Unauthorized publication, use, dissemination or disclosure, either whole or partial, of this message is strictly prohibited. -- To unsubscribe, e-mail: mailto