jndi resource linking
Hello, I am getting the following error when tomcat starts up: Cannot create JDBC driver of class ' ' or connect URL 'null' java.lang.NullPointerException at sun.jdbc.odbc.JdbcOdbcDriver.getProtocol(JdbcOdbcDriver.java:507) at sun.jdbc.odbc.JdbcOdbcDriver.knownURL(JdbcOdbcDriver.java:476) at sun.jdbc.odbc.JdbcOdbcDriver.acceptsURL(JdbcOdbcDriver.java:307) at java.sql.DriverManager.getDriver(DriverManager.java:253) at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource( BasicDataSource.java:1143) at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection( BasicDataSource.java:880) I have global Resource name database entries in my server.xml, and inside of $CATALINA_HOME/conf/[engine]/[host]/context I have resource links to those resources as this segregates what contexts have access to our given set of resources. Below is the syntax from my server.xml GlobalNamingResources Resource name=UserDatabase auth=Container type=org.apache.catalina.UserDatabase description=User database that can be updated and saved factory=org.apache.catalina.users.MemoryUserDatabaseFactory pathname=conf/tomcat-users.xml / Resource name=jdbc/db name auth=Container type=javax.sql.DataSource maxActive=0 maxIdle=50 maxWait=1 driverClassName=com.mysql.jdbc.Driver url=jdbc:mysql://db host/dbname:3306/ /GlobalNamingResources Syntax from my context.xml Context path=/context docBase=webapps/webapp name ResourceLink name=jdbc/dbname global=jdbc/dbname type= javax.sql.DataSource/ /Context I have the mysql driver in lib, I dont believe that is the issue. It feels like the linking process between the context and the global resource isnt happening because the stack trace is complaining of a null pointer. Am I doing this incorrectly? Is my syntax off? Do I need to add additional params somewhere? any help would be much appreciated. thanks -dustin
Re: jndi resource linking
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Dustin, Dustin Fortin wrote: | I am getting the following error when tomcat starts up: Which Tomcat? | I have the mysql driver in lib, I dont believe that is the issue. Which 'lib'? Give us more information and we can probably help. Or, you could save yourself a lot of trouble and search the archives for Cannot create JDBC driver of class ' ' or connect URL 'null'. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.8 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkfgMr8ACgkQ9CaO5/Lv0PDKzwCdFeH+S3CWAKgrUnw9vsfgSR+g 6XkAn2ZzPxqySKU3XyqnPru2SYMBzLzY =FdQS -END PGP SIGNATURE- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: jndi resource linking
I have the mysql driver in lib, I dont believe that is the issue. I kind of do...I was about to ask if you were using or referencing the correct driver. I don't think you'd be getting this error if that was the case. Cannot create JDBC driver of class ' ' or connect URL 'null' java.lang.NullPointerException at sun.jdbc.odbc.JdbcOdbcDriver.getProtocol(JdbcOdbcDriver.java:507) It feels like the linking process between the context and the global resource isnt happening because the stack trace is complaining of a null pointer. Are we sure this reference is the correct driver? It very well may be, but I don't think it should reference that sun driver mentioned there with using JNDI. driverClassName=com.mysql.jdbc.Driver It's been a while since I used mysql and granted I didn't take it down the JNDI road. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: jndi resource linking
Thank you for the response. I am running tomcat 6.0.14 The mysql driver is located in $CATALINA_HOME/lib/mysql-connector-java-5.1.5-bin.jar What archives are you mentioning below? I've googled this error message without finding an answer that fits my situation. thanks -dustin From: Christopher Schultz [mailto:[EMAIL PROTECTED] Sent: Tue 3/18/2008 5:23 PM To: Tomcat Users List Subject: Re: jndi resource linking -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Dustin, Dustin Fortin wrote: | I am getting the following error when tomcat starts up: Which Tomcat? | I have the mysql driver in lib, I dont believe that is the issue. Which 'lib'? Give us more information and we can probably help. Or, you could save yourself a lot of trouble and search the archives for Cannot create JDBC driver of class ' ' or connect URL 'null'. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.8 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkfgMr8ACgkQ9CaO5/Lv0PDKzwCdFeH+S3CWAKgrUnw9vsfgSR+g 6XkAn2ZzPxqySKU3XyqnPru2SYMBzLzY =FdQS -END PGP SIGNATURE- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: jndi resource linking
From: Dustin Fortin [mailto:[EMAIL PROTECTED] Subject: RE: jndi resource linking What archives are you mentioning below? This is my favorite: http://marc.info/?l=tomcat-user Searchable and there's very little GUI crap to get in the way. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: jndi resource linking
From: Dustin Fortin [mailto:[EMAIL PROTECTED] Subject: RE: jndi resource linking In my resource name declarations in my server.xml I'm using: driverClassName=com.mysql.jdbc.Driver which I have already verified is in that jar. The evidence, however, is against you. From the exception trace you provided, it certainly looks like there's a different Resource that's causing the problem. Might be one inside your webapp, or perhaps Tomcat is not running from where you think it is. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]