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: 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
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: 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]
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]
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: 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
RE: java.sql.SQLException: Cannot load JDBC driver class 'null'
Lamy, If you put your resource in the Global Naming Resources section of server.xml you need to put a ResourceLink to that resource in your context. Below works for me: ctx = new InitialContext(); Context envCtx = (Context) ctx.lookup(java:/comp/env/); DataSource ds = (DataSource) envCtx.lookup(/name_of_resource_link); -Original Message- From: LAMY Olivier [mailto:[EMAIL PROTECTED]] Sent: Donnerstag, 05. Dezember 2002 10:14 To: Tomcat Users List Subject: 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
RE: java.sql.SQLException: Cannot load JDBC driver class 'null'
Return Receipt Your RE: java.sql.SQLException: Cannot load JDBC driver class document 'null' : was Kristján Bjarni Guðmundsson/BIS/Dev/REK/Hugvit received by: at: 05.12.2002 09:54:24 -- 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'
Well... I forgot to put a part of my .java is like this: -- DBTest.java -- Context ctx = new InitialContext(); if(ctx == null ) throw new Exception(Boom - No Context); Context envContext = (Context)ctx.lookup(java:/comp/env); DataSource ds = (DataSource)envContext.lookup(jdbc/art); // I tested both ways //DataSource ds = (DataSource)ctx.lookup(java:comp/env/jdbc/art); if (ds != null) { Connection conn = ds.getConnection(); . --- END DBTest.java --- The weird thing is I create a simple class DB, to load the PostgreSQL Driver, connect to the database and do some simple queries - The driver is in my $CATALINA_HOME/common/lib - and all works fine I can load the driver without any problem... but, when I used the DBCP - BOOM - java.sql.SQLException: Cannot load JDBC driver class 'null'... Thanks you 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]
RE: java.sql.SQLException: Cannot load JDBC driver class 'null'
Roberto, Subtle difference between my code and yours: ctx = new InitialContext(); Context envCtx = (Context) ctx.lookup(java:/comp/env/); DataSource ds = (DataSource) envCtx.lookup(/jdbc/art); Note the / characters after java:/comp/env and before jdbc/art I was getting the same error with Oracle as you are with PostgreSQL. -Original Message- From: Roberto Bouza [mailto:[EMAIL PROTECTED]] Sent: Donnerstag, 05. Dezember 2002 15:47 To: Tomcat Users List Subject: RE: java.sql.SQLException: Cannot load JDBC driver class 'null' Well... I forgot to put a part of my .java is like this: -- DBTest.java -- Context ctx = new InitialContext(); if(ctx == null ) throw new Exception(Boom - No Context); Context envContext = (Context)ctx.lookup(java:/comp/env); DataSource ds = (DataSource)envContext.lookup(jdbc/art); // I tested both ways //DataSource ds = (DataSource)ctx.lookup(java:comp/env/jdbc/art); if (ds != null) { Connection conn = ds.getConnection(); . --- END DBTest.java --- The weird thing is I create a simple class DB, to load the PostgreSQL Driver, connect to the database and do some simple queries - The driver is in my $CATALINA_HOME/common/lib - and all works fine I can load the driver without any problem... but, when I used the DBCP - BOOM - java.sql.SQLException: Cannot load JDBC driver class 'null'... Thanks you 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'
Eric, I tried that, but I still get the same error... Quoting Roberts, Eric [EMAIL PROTECTED]: Roberto, Subtle difference between my code and yours: ctx = new InitialContext(); Context envCtx = (Context) ctx.lookup(java:/comp/env/); DataSource ds = (DataSource) envCtx.lookup(/jdbc/art); Note the / characters after java:/comp/env and before jdbc/art I was getting the same error with Oracle as you are with PostgreSQL. -Original Message- From: Roberto Bouza [mailto:[EMAIL PROTECTED]] Sent: Donnerstag, 05. Dezember 2002 15:47 To: Tomcat Users List Subject: RE: java.sql.SQLException: Cannot load JDBC driver class 'null' Well... I forgot to put a part of my .java is like this: -- DBTest.java -- Context ctx = new InitialContext(); if(ctx == null ) throw new Exception(Boom - No Context); Context envContext = (Context)ctx.lookup(java:/comp/env); DataSource ds = (DataSource)envContext.lookup(jdbc/art); // I tested both ways //DataSource ds = (DataSource)ctx.lookup(java:comp/env/jdbc/art); if (ds != null) { Connection conn = ds.getConnection(); . --- END DBTest.java --- The weird thing is I create a simple class DB, to load the PostgreSQL Driver, connect to the database and do some simple queries - The driver is in my $CATALINA_HOME/common/lib - and all works fine I can load the driver without any problem... but, when I used the DBCP - BOOM - java.sql.SQLException: Cannot load JDBC driver class 'null'... Thanks you 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] -- = 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]
RE: java.sql.SQLException: Cannot load JDBC driver class 'null'
Eric, I'm sure that the context lookup is fine and works both ways with the / and without the /, why, I tested both ways and I can bind with the JNDI Resource, if the problem were there then I get like a NamingException or NamingResourceNotFound beacuse the binding name were wrong. Am I right? or I'm missing something? //Context envCtx = (Context) ctx.lookup(java:/comp/env); //DataSource ds = (DataSource) envCtx.lookup(/jdbc/art); DataSource ds = (DataSource)ctx.lookup(java:/comp/env/jdbc/art); Thanks. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
java.sql.SQLException: Cannot load JDBC driver class 'null' (Apache-Tomcat)
Hello everybody... A lot of hours later trying to put up the pooling, trying all the configurations possibles... I put Tomcat Standalone (without apache warp connection) and all works fine. Now, when I use Apache-Tomcat with the same pooling connection, same configuration, same all... I get the exception of JDBC driver class 'null', when I try to get the connection... Any ideas Thanks in advance. Quoting Roberto Bouza [EMAIL PROTECTED]: Eric, I'm sure that the context lookup is fine and works both ways with the / and without the /, why, I tested both ways and I can bind with the JNDI Resource, if the problem were there then I get like a NamingException or NamingResourceNotFound beacuse the binding name were wrong. Am I right? or I'm missing something? //Context envCtx = (Context) ctx.lookup(java:/comp/env); //DataSource ds = (DataSource) envCtx.lookup(/jdbc/art); DataSource ds = (DataSource)ctx.lookup(java:/comp/env/jdbc/art); Thanks. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- = 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]
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]
java.sql.SQLException: Cannot load JDBC driver class 'null'
Has any got the DBCP to work with tomcat 4.1.12 and MySQL? If so, what do you have to do to be able to get a connection? Thanks JL _ Chat with friends online, try MSN Messenger: http://messenger.msn.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]