RE: [ERROR] Cannot create JDBC driver of class '' for connect URL 'null'
The solution to this one seems to be that removing webapps/axis2.war allows it to see the context.xml file. Neil Youngman - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: [ERROR] Cannot create JDBC driver of class '' for connect URL 'null'
From: Neil Youngman [mailto:neil.young...@wirefast.com] Subject: RE: [ERROR] Cannot create JDBC driver of class '' for connect URL 'null' The solution to this one seems to be that removing webapps/axis2.war allows it to see the context.xml file. I'm confused; isn't the Context element located in META-INF/context.xml inside webapps/axis2.war? Wouldn't removing the .war file make the whole webapp non-existant? - 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 unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: [ERROR] Cannot create JDBC driver of class '' for connect URL 'null'
Caldarale, Charles R wrote: From: Neil Youngman [mailto:neil.young...@wirefast.com] Subject: RE: [ERROR] Cannot create JDBC driver of class '' for connect URL 'null' The solution to this one seems to be that removing webapps/axis2.war allows it to see the context.xml file. I'm confused; isn't the Context element located in META-INF/context.xml inside webapps/axis2.war? Wouldn't removing the .war file make the whole webapp non-existant? No, the axis2.war is the standard Axis2 WAR distribution, as downloaded from the relevant website. I've loaded my classes/config into the directories under webapp, I haven't built a custom axis2.war. AIUI the axis2.war file was extracted onto the disk when I ran it up for the first time and now I've removed the .war file the axis2 stuff is left behind in the extracted directory structure, so it doesn't actually need the axis2.war file to run. Neil Youngman - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: [ERROR] Cannot create JDBC driver of class '' for connect URL 'null'
From: Neil Youngman [mailto:neil.young...@wirefast.com] Subject: RE: [ERROR] Cannot create JDBC driver of class '' for connect URL 'null' No, the axis2.war is the standard Axis2 WAR distribution, as downloaded from the relevant website. I've loaded my classes/config into the directories under webapp, I haven't built a custom axis2.war. O.k., that explains it. The expanded .war is there for Tomcat's convenience, not yours. You should not be modifying anything in the expanded directory - it may be overwritten, deleted, or ignored by Tomcat at its whim, as you have discovered. Even after expansion, the .war file is the master copy. - 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 unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: [ERROR] Cannot create JDBC driver of class '' for connect URL 'null'
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Neil, On 7/24/2009 3:39 PM, Neil Youngman wrote: I don't think there's a permissions issue. $ ls -l ~/wirefast/dev/tomcat6/servlet-example/webapps/axis2/META-INF/context.xml -rw-r--r-- 1 neil neil 343 2009-07-22 14:44 /home/neil/wirefast/dev/tomcat6/servlet-example/webapps/axis2/META-INF/context.xml Assuming Tomcat is running as 'neil', you're probably okay. If it's running as someone else, you need to check that the euid has read and execute access to all intermediate directories. If there was I would expect strace to show an open() returning -1 and I don't see that. Also double checking the permissions, it looks to me to be world readable. Maybe not: if the stat() call returns enough information that the code decides it can't read the file, no open() will ever occur. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkpt06YACgkQ9CaO5/Lv0PA8pwCffvojntuJBOvbtgLY09+nSLlD OSMAoKu32OcczznFHbDnSRnY+XOc6Ca7 =+vq7 -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: [ERROR] Cannot create JDBC driver of class '' for connect URL 'null'
I'm still banging my head against this particular brick wall. I've cut the servlet down to a minimal example and tried to get as much debug out as possible, but I've not got much in the way of clues. I've reached a point where tracing the tomcat session with strace was the only thing I could think of that I hadn't tried. This is the outcome $ grep META-INF/context.xml /tmp/catalina.trace.* /tmp/catalina.trace.3726:stat64(/home/neil/wirefast/dev/tomcat6/servlet-example/webapps/axis2/META-INF/context.xml, {st_mode=S_IFREG|0644, st_size=343, ...}) = 0 That is interesting, because it appears to check the existence of the axis2/META-INF/context.xml file, but, as far as can be seen from the strace output, it never opens it. That would be consistent with the fact that I couldn't see it being opened or processed in any of the debug output. It's not obvious to me what part of the source would handle this. Where should I look for documentation of the process of handling individual contexts? Neil Youngman - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: [ERROR] Cannot create JDBC driver of class '' for connect URL 'null'
From: Neil Youngman [mailto:neil.young...@wirefast.com] Subject: RE: [ERROR] Cannot create JDBC driver of class '' for connect URL 'null' That is interesting, because it appears to check the existence of the axis2/META-INF/context.xml file, but, as far as can be seen from the strace output, it never opens it. This is indicative that there may be another Context element around that's overriding the one in META-INF. Check for the existence of conf/Catalina/[host]/axis2.xml; if it's there, that will preclude reading the one from META-INF. Also, since it's been ten days since your original posting, can you please show us the server.xml for Tomcat and the context.xml for this webapp as they now stand? - 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 unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: [ERROR] Cannot create JDBC driver of class '' for connect URL 'null'
Caldarale, Charles R wrote: From: Neil Youngman [mailto:neil.young...@wirefast.com] Subject: RE: [ERROR] Cannot create JDBC driver of class '' for connect URL 'null' That is interesting, because it appears to check the existence of the axis2/META-INF/context.xml file, but, as far as can be seen from the strace output, it never opens it. This is indicative that there may be another Context element around that's overriding the one in META-INF. Check for the existence of conf/Catalina/[host]/axis2.xml; if it's there, that will preclude reading the one from META-INF. It doesn't look like that's it /tmp/catalina.trace.3726:stat64(/home/neil/wirefast/dev/tomcat6/servlet-example/conf/example/localhost/axis2.xml, 0xffce99c4) = -1 ENOENT (No such file or directory) $ find ~/wirefast/dev/tomcat6/servlet-example -iname \*.xml | xargs grep 'Resource' /home/neil/wirefast/dev/tomcat6/servlet-example/webapps/axis2/META-INF/context.xml: Resource name=jdbc/TestDatabase auth=Container $ Also, since it's been ten days since your original posting, can you please show us the server.xml for Tomcat and the context.xml for this webapp as they now stand? This is servlet-example/conf/server.xml ?xml version='1.0' encoding='utf-8'? Server port=6262 Service name=example Connector debug=6261 port=6260 / Engine name=example defaultHost=localhost Host name=localhost appBase=webapps unpackWARs=true autoDeploy=true xmlValidation=false xmlNamespaceAware=false / /Engine /Service /Server and this is servlet-example/webapps/axis2/META-INF/context.xml Context Resource name=jdbc/TestDatabase auth=Container type=javax.sql.DataSource driverClassName=oracle.jdbc.OracleDr\ iver url=jdbc:oracle:thin:@192.168.2.143:1521:w2 username=wire2 password=wire2 maxActive=20 maxIdle=10 maxWait=-1/ /Context Neil Youngman - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: [ERROR] Cannot create JDBC driver of class '' for connect URL 'null'
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Neil, On 7/24/2009 10:21 AM, Neil Youngman wrote: type=javax.sql.DataSource driverClassName=oracle.jdbc.OracleDr\ iver Is that really the content from your XML file with the backslash and everything? 'cause XML doesn't do backslashes like that. If stat is being called, but the file is never opened, could there be a permissions issue, here? I always hate it when people ask about file permissions on the list because they are usually grasping at straws and haven't really read the post. In this case, it seems like a possibility given your strace output. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkpqC38ACgkQ9CaO5/Lv0PB68QCeLQum/0J7jrmq6tRXoO68QE58 CNYAnRoF0FGHY0myG8ieEGuy4fIufBGK =vO5e -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: [ERROR] Cannot create JDBC driver of class '' for connect URL 'null'
Christopher Schultz wrote: Neil, On 7/24/2009 10:21 AM, Neil Youngman wrote: type=javax.sql.DataSource driverClassName=oracle.jdbc.OracleDr\ iver Is that really the content from your XML file with the backslash and everything? 'cause XML doesn't do backslashes like that. Oops, I missed that. No the original doesn't have a backslash and line break there. I think that's an artefact from a listing in an xterm. If stat is being called, but the file is never opened, could there be a permissions issue, here? I always hate it when people ask about file permissions on the list because they are usually grasping at straws and haven't really read the post. In this case, it seems like a possibility given your strace output. I don't think there's a permissions issue. If there was I would expect strace to show an open() returning -1 and I don't see that. Also double checking the permissions, it looks to me to be world readable. $ ls -l ~/wirefast/dev/tomcat6/servlet-example/webapps/axis2/META-INF/context.xml -rw-r--r-- 1 neil neil 343 2009-07-22 14:44 /home/neil/wirefast/dev/tomcat6/servlet-example/webapps/axis2/META-INF/context.xml Thanks for the input. Neil - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
[ERROR] Cannot create JDBC driver of class '' for connect URL 'null'
I'm having trouble getting Oracle access from Axis2 to work under Tomcat 6. I've spent a lot of time Googling and prodding and poking the application and I haven't found a solution that works for me. Oddly the configuration I'm using seems to work for another application. Let's start with the configuration in axis2/META-INF/context.xml, which is: ?xml version='1.0' encoding='utf-8'? Context Resource name=jdbc/AppDatabase auth=Container type=javax.sql.DataSource factory=org.apache.commons.dbcp.BasicDataSourceFactory maxWait=-1 maxActive=20 maxIdle=10 url=jdbc:oracle:thin:@frogfoot:1521:w2 driverClassName=oracle.jdbc.OracleDriver username= password= accessToUnderlyingConnectionAllowed=true / /Context this seems to work for another app, without a resource-ref, but this app gets the javax.naming.NameNotFoundException: Name jdbc is not bound in this Context. To resolve this I add the following resource-ref in axis2/WEB-INF/web.xml: resource-ref descriptionDB Connection/description res-ref-namejdbc/AppDatabase/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref I now get org.apache.axis2.AxisFault: Cannot create JDBC driver of class '' for connect URL 'null'. The full stack trace is: [ERROR] Cannot create JDBC driver of class '' for connect URL 'null' java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.axis2.rpc.receivers.RPCUtil.invokeServiceClass(RPCUtil.java:194) at org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.java:102) at org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusinessLogic(AbstractInOutMessageReceiver.java:40) at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:100) at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:176) at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:275) at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:133) at javax.servlet.http.HttpServlet.service(HttpServlet.java:710) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValvejava:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValvejava:175) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) at java.lang.Thread.run(Thread.java:619) Caused by: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1150) at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSourcejava:880) at com.wirefast.wsam.service.WMSSubmissionService.getConnection(WMSSubmissionService.java:208) at com.wirefast.wsam.service.WMSSubmissionService.submitMessage(WMSSubmissionService.java:570) ... 25 more Caused by: 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) ... 28 more Obviously something isn't right, but I can't figure out where the problem lies. Maybe the fact
Re: [ERROR] Cannot create JDBC driver of class '' for connect URL 'null'
On 14/7/09 09:42, Neil Youngman wrote: I'm having trouble getting Oracle access from Axis2 to work under Tomcat 6. I've spent a lot of time Googling and prodding and poking the application and I haven't found a solution that works for me. Oddly the configuration I'm using seems to work for another application. Perhaps you should try the Tomcat configuration method then: http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.html p Let's start with the configuration in axis2/META-INF/context.xml, which is: ?xml version='1.0' encoding='utf-8'? Context Resource name=jdbc/AppDatabase auth=Container type=javax.sql.DataSource factory=org.apache.commons.dbcp.BasicDataSourceFactory maxWait=-1 maxActive=20 maxIdle=10 url=jdbc:oracle:thin:@frogfoot:1521:w2 driverClassName=oracle.jdbc.OracleDriver username= password= accessToUnderlyingConnectionAllowed=true / /Context this seems to work for another app, without a resource-ref, but this app gets the javax.naming.NameNotFoundException: Name jdbc is not bound in this Context. To resolve this I add the following resource-ref in axis2/WEB-INF/web.xml: resource-ref descriptionDB Connection/description res-ref-namejdbc/AppDatabase/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref I now get org.apache.axis2.AxisFault: Cannot create JDBC driver of class '' for connect URL 'null'. The full stack trace is: [ERROR] Cannot create JDBC driver of class '' for connect URL 'null' java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.axis2.rpc.receivers.RPCUtil.invokeServiceClass(RPCUtil.java:194) at org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.java:102) at org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusinessLogic(AbstractInOutMessageReceiver.java:40) at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:100) at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:176) at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:275) at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:133) at javax.servlet.http.HttpServlet.service(HttpServlet.java:710) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValvejava:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValvejava:175) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) at java.lang.Thread.run(Thread.java:619) Caused by: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1150) at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSourcejava:880) at com.wirefast.wsam.service.WMSSubmissionService.getConnection(WMSSubmissionService.java:208) at com.wirefast.wsam.service.WMSSubmissionService.submitMessage(WMSSubmissionService.java:570) ... 25 more Caused by: 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) ... 28 more Obviously something isn't right, but I can't figure out where the problem lies. Maybe the fact that it is invoking sun.jdbc.odbc.JdbcOdbcDriver instead of oracle.jdbc.OracleDriver is a clue? Or am I missing something else? Neil Youngman Neil Youngman Developer Wirefast Limited Wirefast provides secure corporate messaging services. See our messaging solutions at _http://www.wirefast.com/_ Please consider the environment. Does this email or attachment need to be printed
RE: [ERROR] Cannot create JDBC driver of class '' for connect URL 'null'
Perhaps you should try the Tomcat configuration method then: http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.html Oddly enough, my configuration matches the Oracle example in that document, as far as I can see, possibly because I've read that document half a dozen times while searching for a solution. If you can see where my configuration differs from that in the document (obviously excluding local names), feel free to provide a helpful answer. Neil Youngman Neil Youngman Developer Wirefast Limited Wirefast provides secure corporate messaging services. See our messaging solutions at http://www.wirefast.com/ Please consider the environment. Does this email or attachment need to be printed? This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this email. Please notify the sender immediately by email if you have received this email by mistake and delete this email from your system. Email transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of email transmission. Wirefast Limited is registered in England Wales Company number: 03865860 Registered Office: 7/10 Chandos Street, Cavendish Square, London, W1G 9DQ
Re: [ERROR] Cannot create JDBC driver of class '' for connect URL 'null'
2009/7/14 Neil Youngman neil.young...@wirefast.com: I'm having trouble getting Oracle access from Axis2 to work under Tomcat 6. I've spent a lot of time Googling and prodding and poking the application and I haven't found a solution that works for me. Oddly the configuration I'm using seems to work for another application. Let's start with the configuration in axis2/META-INF/context.xml, which is: (...) Look at $CATALINA_BASE/conf/Catalina/localhost/your web app name.xml That is a copy of your context.xml file that Tomcat creates when the app is deployed. This copy takes precedence over its original. Maybe your Resource isn't defined there. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: [ERROR] Cannot create JDBC driver of class '' for connect URL 'null'
Konstantin Kolinko wrote: Look at $CATALINA_BASE/conf/Catalina/localhost/your web app name.xml That is a copy of your context.xml file that Tomcat creates when the app is deployed. This copy takes precedence over its original. Maybe your Resource isn't defined there. I can't see any sign that tomcat is creating such a file. There is no $CATALINA_BASE/conf/Catalina directory. Using CATALINA_BASE: /home/tomcat6/wsam $ ls -l /home/tomcat6/wsam/conf/ total 28 -rw-r--r--1 tomcat6 tomcat6 426 Jul 10 13:45 server.xml -rw-r--r--1 tomcat6 tomcat6 436 Jul 10 13:43 server.xml~ -rw-r--r--1 tomcat6 tomcat6 15305 Jul 8 14:26 transform.xsl drwxrwxr-x3 tomcat6 tomcat6 4096 Jan 28 14:09 WSAM $ Directory WSAM just contains an empty localhost subdirectory. Neil Youngman Neil Youngman Developer Wirefast Limited Wirefast provides secure corporate messaging services. See our messaging solutions at http://www.wirefast.com/ Please consider the environment. Does this email or attachment need to be printed? This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this email. Please notify the sender immediately by email if you have received this email by mistake and delete this email from your system. Email transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of email transmission. Wirefast Limited is registered in England Wales Company number: 03865860 Registered Office: 7/10 Chandos Street, Cavendish Square, London, W1G 9DQ
RE: [ERROR] Cannot create JDBC driver of class '' for connect URL 'null'
From: Neil Youngman [mailto:neil.young...@wirefast.com] Subject: RE: [ERROR] Cannot create JDBC driver of class '' for connect URL 'null' Using CATALINA_BASE: /home/tomcat6/wsam $ ls -l /home/tomcat6/wsam/conf/ total 28 -rw-r--r-- 1 tomcat6 tomcat6 426 Jul 10 13:45 server.xml -rw-r--r-- 1 tomcat6 tomcat6 436 Jul 10 13:43 server.xml~ -rw-r--r-- 1 tomcat6 tomcat6 15305 Jul 8 14:26 transform.xsl drwxrwxr-x 3 tomcat6 tomcat6 4096 Jan 28 14:09 WSAM $ It's unlikely that's the real Tomcat conf directory - there's not enough stuff in there to get Tomcat started. You either have a very broken installation, or the Tomcat you're actually using is installed somewhere else. I'd suggest starting over with a clean installation and work up from there. - 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 unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: [ERROR] Cannot create JDBC driver of class '' for connect URL 'null'
Caldarale, Charles R wrote: From: Neil Youngman [mailto:neil.young...@wirefast.com] Subject: RE: [ERROR] Cannot create JDBC driver of class '' for connect URL 'null' Using CATALINA_BASE: /home/tomcat6/wsam $ ls -l /home/tomcat6/wsam/conf/ total 28 -rw-r--r--1 tomcat6 tomcat6 426 Jul 10 13:45 server.xml -rw-r--r--1 tomcat6 tomcat6 436 Jul 10 13:43 server.xml~ -rw-r--r--1 tomcat6 tomcat6 15305 Jul 8 14:26 transform.xsl drwxrwxr-x3 tomcat6 tomcat6 4096 Jan 28 14:09 WSAM $ It's unlikely that's the real Tomcat conf directory - there's not enough stuff in there to get Tomcat started. You either have a very broken installation, or the Tomcat you're actually using is installed somewhere else. That's $CATALINA_BASE/conf, not $CATALINA_HOME/conf Neil Youngman Neil Youngman Developer Wirefast Limited Wirefast provides secure corporate messaging services. See our messaging solutions at http://www.wirefast.com/ Please consider the environment. Does this email or attachment need to be printed? This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this email. Please notify the sender immediately by email if you have received this email by mistake and delete this email from your system. Email transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of email transmission. Wirefast Limited is registered in England Wales Company number: 03865860 Registered Office: 7/10 Chandos Street, Cavendish Square, London, W1G 9DQ
RE: [ERROR] Cannot create JDBC driver of class '' for connect URL 'null'
From: Neil Youngman [mailto:neil.young...@wirefast.com] Subject: RE: [ERROR] Cannot create JDBC driver of class '' for connect URL 'null' That's $CATALINA_BASE/conf, not $CATALINA_HOME/conf Regardless, the lack of an [engine] subdirectory is an indication that you may not be running Tomcat from where you think you are. 1) What's in $CATALINA_HOME/conf? 2) What do the startup scripts display for the $CATALINA_xxx variables when you bring up Tomcat? The fact that the JDBC-ODBC bridge shows up in the stack trace says that your published Resource config is not the one being used. - 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 unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: [ERROR] Cannot create JDBC driver of class '' for connect URL 'null'
Caldarale, Charles R wrote: From: Neil Youngman [mailto:neil.young...@wirefast.com] That's $CATALINA_BASE/conf, not $CATALINA_HOME/conf Regardless, the lack of an [engine] subdirectory is an indication that you may not be running Tomcat from where you think you are. 1) What's in $CATALINA_HOME/conf? $ ls -l /usr/local/apache-tomcat-6.0.16/conf total 92 -rw---1 root root 8568 Jan 28 2008 catalina.policy -rw---1 root root 3665 Jan 28 2008 catalina.properties -rw---1 root root 1396 Jan 28 2008 context.xml -rw---1 root root 3664 Jan 28 2008 logging.properties -rw---1 root root 6462 Jan 28 2008 server.xml -rw---1 root root 1107 Jan 28 2008 tomcat-users.xml -rw---1 root root51226 Jan 28 2008 web.xml $ 2) What do the startup scripts display for the $CATALINA_xxx variables when you bring up Tomcat? Using CATALINA_BASE: /home/tomcat6/wsam Using CATALINA_HOME: /usr/local/apache-tomcat-6.0.16 Using CATALINA_TMPDIR: /home/tomcat6/wsam/temp Using JRE_HOME: /usr/java/jdk1.6.0_06 That looks correct to me, but as you say: The fact that the JDBC-ODBC bridge shows up in the stack trace says that your published Resource config is not the one being used. The resource config is in /home/tomcat6/wsam/webapps/axis2/META-INF/context.xml Again that seems right to me, but obviously I am missing something. Neil Youngman - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: [ERROR] Cannot create JDBC driver of class '' for connect URL 'null'
On Tuesday 14 July 2009 14:31:06 Caldarale, Charles R wrote: From: Neil Youngman [mailto:neil.young...@wirefast.com] Subject: RE: [ERROR] Cannot create JDBC driver of class '' for connect URL 'null' That's $CATALINA_BASE/conf, not $CATALINA_HOME/conf Regardless, the lack of an [engine] subdirectory is an indication that you may not be running Tomcat from where you think you are. Maybe 'WSAM' is the engine name. Maybe the OP should post his complete server.xml. Rainer - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: [ERROR] Cannot create JDBC driver of class '' for connect URL 'null'
Rainer Frey wrote: Maybe 'WSAM' is the engine name. Maybe the OP should post his complete server.xml. Rainer is of course right. I should have realised that WSAM is the engine name from server.xml The server.xml is quite simple. $ cat /home/tomcat6/wsam/conf/server.xml ?xml version='1.0' encoding='utf-8'? Server port=4582 Service name=WSAM Connector debug=1 port=4580 / Engine name=WSAM defaultHost=localhost Host name=localhost appBase=webapps unpackWARs=true autoDeploy=true xmlValidation=false xmlNamespaceAware=false / /Engine /Service /Server Neil Youngman - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: [ERROR] Cannot create JDBC driver of class '' for connect URL 'null'
On Tuesday 14 July 2009 10:42:19 Neil Youngman wrote: I'm having trouble getting Oracle access from Axis2 to work under Tomcat 6. I've spent a lot of time Googling and prodding and poking the application and I haven't found a solution that works for me. Oddly the configuration I'm using seems to work for another application. Let's start with the configuration in axis2/META-INF/context.xml, which is: ?xml version='1.0' encoding='utf-8'? Context Resource name=jdbc/AppDatabase auth=Container type=javax.sql.DataSource factory=org.apache.commons.dbcp.BasicDataSourceFactory You are explicitly specifying the original DBCP factory class org.apache.commons.dbcp.BasicDataSourceFactory here. Is this for specific reason, and is the jar file available (I believe it needs to be in tomcat's lib dir, though I'm not sure if the resource is application specific)? What happens if you leave out the factory attribute? Caused by: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSourc e.java:1150) at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSourceja va:880) at Obviously the packaged and renamed tomcat DBCP factory is used. Maybe a tomcat fallback if the specified factory is not found? Also might there be a fallback for the JDBC driver if the driver is not found? Rainer - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: [ERROR] Cannot create JDBC driver of class '' for connect URL 'null'
From: Neil Youngman [mailto:neil.young...@wirefast.com] Subject: RE: [ERROR] Cannot create JDBC driver of class '' for connect URL 'null' I should have realised that WSAM is the engine name from server.xml So what's under the WSAM directory? - 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 unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: [ERROR] Cannot create JDBC driver of class '' for connect URL 'null'
Rainer Frey (Inxmail GmbH) wrote: On Tuesday 14 July 2009 10:42:19 Neil Youngman wrote: I'm having trouble getting Oracle access from Axis2 to work under Tomcat 6. I've spent a lot of time Googling and prodding and poking the application and I haven't found a solution that works for me. Oddly the configuration I'm using seems to work for another application. Let's start with the configuration in axis2/META-INF/context.xml, which is: ?xml version='1.0' encoding='utf-8'? Context Resource name=jdbc/AppDatabase auth=Container type=javax.sql.DataSource factory=org.apache.commons.dbcp.BasicDataSourceFactory You are explicitly specifying the original DBCP factory class org.apache.commons.dbcp.BasicDataSourceFactory here. Is this for specific reason, and is the jar file available (I believe it needs to be in tomcat's lib dir, though I'm not sure if the resource is application specific)? What happens if you leave out the factory attribute? That was copied from a working application that I mentioned previously. Commons-dbcp-1.1.jar is in the /home/tomcat6/wsam/webapps/axis2/WEB-INF/lib directory. If I remove the factory attribute it fails in exactly the same way. Caused by: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSourc e.java:1150) at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSourceja va:880) at Obviously the packaged and renamed tomcat DBCP factory is used. Maybe a tomcat fallback if the specified factory is not found? Also might there be a fallback for the JDBC driver if the driver is not found? That seems likely. The app I currently have works under tomcat5 and I haven't written any apps from scratch under tomcat6. Maybe if I try to create a minimal app from scratch, I'll get a little more insight into what is actually needed. Neil Youngman - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: [ERROR] Cannot create JDBC driver of class '' for connect URL 'null'
Caldarale, Charles R wrote: From: Neil Youngman [mailto:neil.young...@wirefast.com] Subject: RE: [ERROR] Cannot create JDBC driver of class '' for connect URL 'null' I should have realised that WSAM is the engine name from server.xml So what's under the WSAM directory? There was a localhost subdirectory, which was completely empty. As an experiment I removed the WSAM directory and several restarts have not recreated it. Neil Youngman - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: [ERROR] Cannot create JDBC driver of class '' for connect URL 'null'
From: Neil Youngman [mailto:neil.young...@wirefast.com] Subject: RE: [ERROR] Cannot create JDBC driver of class '' for connect URL 'null' As an experiment I removed the WSAM directory and several restarts have not recreated it. Tomcat won't create the [engine]/[host] directory until it needs to, such as when copying a Context element from a META-INF/context.xml file. Since that directory is not being created, either you're not running Tomcat from where you think you are, or the Context element in your webapp's META-INF/context.xml file is not being recognized. Might want to double-check spelling of everything, since the XML files are case-sensitive. Could also try a fresh install of 6.0.20 and see if that works. - 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 unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: [ERROR] Cannot create JDBC driver of class '' for connect URL 'null'
On Tuesday 14 July 2009 15:56:07 Caldarale, Charles R wrote: From: Neil Youngman [mailto:neil.young...@wirefast.com] Subject: RE: [ERROR] Cannot create JDBC driver of class '' for connect URL 'null' As an experiment I removed the WSAM directory and several restarts have not recreated it. Tomcat won't create the [engine]/[host] directory until it needs to, such as when copying a Context element from a META-INF/context.xml file. Has Tomcat 6 done that since initial release? I vaguely remember reading s.th. related in 6.0.20 change log. To the OP: what exact version are you using? Rainer - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: [ERROR] Cannot create JDBC driver of class '' for connect URL 'null'
I wonder if somehow the factory classes are confused. My tomcat6/lib contains tomcat-dbcp.jar and I don't have commons-dbcp-1.1.jar in my webapp at all. I also don't have a factory attribute in my resource definition since the right one is picked up by default. (I think this changed in tomcat6) my 2 cents mas Neil Youngman wrote: Rainer Frey (Inxmail GmbH) wrote: On Tuesday 14 July 2009 10:42:19 Neil Youngman wrote: I'm having trouble getting Oracle access from Axis2 to work under Tomcat 6. I've spent a lot of time Googling and prodding and poking the application and I haven't found a solution that works for me. Oddly the configuration I'm using seems to work for another application. Let's start with the configuration in axis2/META-INF/context.xml, which is: ?xml version='1.0' encoding='utf-8'? Context Resource name=jdbc/AppDatabase auth=Container type=javax.sql.DataSource factory=org.apache.commons.dbcp.BasicDataSourceFactory You are explicitly specifying the original DBCP factory class org.apache.commons.dbcp.BasicDataSourceFactory here. Is this for specific reason, and is the jar file available (I believe it needs to be in tomcat's lib dir, though I'm not sure if the resource is application specific)? What happens if you leave out the factory attribute? That was copied from a working application that I mentioned previously. Commons-dbcp-1.1.jar is in the /home/tomcat6/wsam/webapps/axis2/WEB-INF/lib directory. If I remove the factory attribute it fails in exactly the same way. Caused by: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSourc e.java:1150) at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSourceja va:880) at Obviously the packaged and renamed tomcat DBCP factory is used. Maybe a tomcat fallback if the specified factory is not found? Also might there be a fallback for the JDBC driver if the driver is not found? That seems likely. The app I currently have works under tomcat5 and I haven't written any apps from scratch under tomcat6. Maybe if I try to create a minimal app from scratch, I'll get a little more insight into what is actually needed. Neil Youngman - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org -- Mark Shifman MD. Ph.D. Yale Center for Medical Informatics Phone (203)737-5219 mark.shif...@yale.edu - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: [ERROR] Cannot create JDBC driver of class '' for connect URL 'null'
From: Rainer Frey [mailto:rainer.f...@inxmail.de] Subject: Re: [ERROR] Cannot create JDBC driver of class '' for connect URL 'null' Tomcat won't create the [engine]/[host] directory until it needs to, such as when copying a Context element from a META-INF/context.xml file. Has Tomcat 6 done that since initial release? No, the [appName].xml file used to be created just when expanding a .war (and possibly some other conditions). To the OP: what exact version are you using? He's already shown us: 6.0.16. - 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 unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: [ERROR] Cannot create JDBC driver of class '' for connect URL 'null'
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Chuck, On 7/14/2009 8:31 AM, Caldarale, Charles R wrote: The fact that the JDBC-ODBC bridge shows up in the stack trace says that your published Resource config is not the one being used. Actually, I think it's the driver registration that's failing. Since the DriverManager is being asked to get an appropriate driver for a particular URL, all available drivers will be queried, including the JdbcOdbcDriver. It's presence in the stack trace is misleading, but not particularly troubling. What /is/ interesting is that this is the /first time ever/ I've seen a complete stack trace including all the Caused by elements from someone getting this error. I'll quote it because I think it's important: Caused by: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1150) at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSourcejava:880) at com.wirefast.wsam.service.WMSSubmissionService.getConnection(WMSSubmissionService.java:208) at com.wirefast.wsam.service.WMSSubmissionService.submitMessage(WMSSubmissionService.java:570) ... 25 more Caused by: 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) ... 28 more The root cause is a NullPointerException within the JdbcOdbcDriver.acceptsURL call: basically, this driver is not properly checking its arguments for null (it's probably doing something like if(url.startsWith(jdbc:odbc:)) which means it'll blow up if the URL is null. The URL may or may not be null, in spite of this error message. I wonder if the message itself is inaccurate. I haven't traced through the code, but it would be nice to know what's going on. This error has come up over and over on this list and the solution usually ends up being that you just have to throw out your configuration and start over again, and everything seems to work out just fine. It would be nice to know what the real problem is. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkpcoc8ACgkQ9CaO5/Lv0PALJACgj45GZ7AYEjHMTb8RLIK4lqAN nsQAoMBLjWnRKHdyEvMOjhJYitSaP/wp =r5kk -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: [ERROR] Cannot create JDBC driver of class '' for connect URL 'null'
In the past, it's typically been caused by some misspell of the JNDI name between the Resource / element and the resource-ref.../resource-ref in the WEB-INF/web.xml. I'd have to go back to the original post to tell if that's the case here or not. Either that or the resource was declared as a global resource without the requisite ResourceLink / in the context. Either way, it's typically a disconnect between the Resource .../ and it's use in the jsp/servlet code. Having said all that, I'm certain there are a few cases that blow what I just wrote out of the water. :-) --David Christopher Schultz wrote: Chuck, On 7/14/2009 8:31 AM, Caldarale, Charles R wrote: The fact that the JDBC-ODBC bridge shows up in the stack trace says that your published Resource config is not the one being used. Actually, I think it's the driver registration that's failing. Since the DriverManager is being asked to get an appropriate driver for a particular URL, all available drivers will be queried, including the JdbcOdbcDriver. It's presence in the stack trace is misleading, but not particularly troubling. What /is/ interesting is that this is the /first time ever/ I've seen a complete stack trace including all the Caused by elements from someone getting this error. I'll quote it because I think it's important: Caused by: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1150) at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSourcejava:880) at com.wirefast.wsam.service.WMSSubmissionService.getConnection(WMSSubmissionService.java:208) at com.wirefast.wsam.service.WMSSubmissionService.submitMessage(WMSSubmissionService.java:570) ... 25 more Caused by: 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) ... 28 more The root cause is a NullPointerException within the JdbcOdbcDriver.acceptsURL call: basically, this driver is not properly checking its arguments for null (it's probably doing something like if(url.startsWith(jdbc:odbc:)) which means it'll blow up if the URL is null. The URL may or may not be null, in spite of this error message. I wonder if the message itself is inaccurate. I haven't traced through the code, but it would be nice to know what's going on. This error has come up over and over on this list and the solution usually ends up being that you just have to throw out your configuration and start over again, and everything seems to work out just fine. It would be nice to know what the real problem is. -chris - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: [ERROR] Cannot create JDBC driver of class '' for connect URL 'null'
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 David, On 7/14/2009 11:29 AM, David Smith wrote: In the past, it's typically been caused by some misspell of the JNDI name between the Resource / element and the resource-ref.../resource-ref in the WEB-INF/web.xml. I've never had to use a resourcr-ref element in web.xml for a Resourcre defined in META-INF/context.xml. I've even created incorrect resource-ref elements in web.xml and not had a problem. I /do/ have them in there, though, just in case :) I'd have to go back to the original post to tell if that's the case here or not. Tsk, tsk. It was only a few hours ago: META-INF/context.xml: Resource name=jdbc/AppDatabase web.xml: resource-ref descriptionDB Connection/description res-ref-namejdbc/AppDatabase/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref Looks good to me. Either that or the resource was declared as a global resource without the requisite ResourceLink / in the context. Nope, it was done in the recommended way (from the Tomcat docs, and checked multiple times according to the OP). Either way, it's typically a disconnect between the Resource .../ and it's use in the jsp/servlet code. He didn't post his code. It would be good to see what is on line 208 in com.wirefast.wsam.service.WMSSubmissionService.getConnection. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkpcqD0ACgkQ9CaO5/Lv0PBSBACaA3d45tyyA7K62NtHS4NWZ7FA 9KcAn0xqAVHruti85qkheBztd25N/n0d =N63Z -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: [ERROR] Cannot create JDBC driver of class '' for connect URL 'null'
Christopher Schultz wrote: Either way, it's typically a disconnect between the Resource .../ and it's use in the jsp/servlet code. He didn't post his code. It would be good to see what is on line 208 in com.wirefast.wsam.service.WMSSubmissionService.getConnection. Oops. I meant to include that. private static final String CONTEXT_NAME = java:/comp/env; private static final String DB_NAME = jdbc/InterceptDatabase; ... private static Connection getConnection () throws Exception, SQLException { if( DATA_SOURCE == null ) { // Get the data source (from context.xml) try { Class.forName(oracle.jdbc.OracleDriver); Context initContext = new InitialContext(); Context envContext = (Context) initContext.lookup(CONTEXT_NAME); DATA_SOURCE = (DataSource)envContext.lookup(DB_NAME); } catch (Exception ex) { System.err.println( ex ); ex.printStackTrace(); throw ex; } } return DATA_SOURCE.getConnection(); // line 208 } Neil Youngman - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: [ERROR] Cannot create JDBC driver of class '' for connect URL 'null'
From: Neil Youngman [mailto:neil.young...@wirefast.com] Subject: RE: [ERROR] Cannot create JDBC driver of class '' for connect URL 'null' private static final String DB_NAME = jdbc/InterceptDatabase; But your Context has: Resource name=jdbc/AppDatabase - 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 unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: [ERROR] Cannot create JDBC driver of class '' for connect URL 'null'
Caldarale, Charles R wrote: From: Neil Youngman [mailto:neil.young...@wirefast.com] Subject: RE: [ERROR] Cannot create JDBC driver of class '' for connect URL 'null' private static final String DB_NAME = jdbc/InterceptDatabase; But your Context has: Resource name=jdbc/AppDatabase Oops. It's late in the day and I'm getting careless. That's from a different application. I'll try to copy from the correct editor window this time. private static final String CONTEXT_NAME = java:/comp/env; private static final String DB_NAME = jdbc/AppDatabase; ... private static Connection getConnection () throws Exception, SQLException { if( DATA_SOURCE == null ) { // Get the data source (from context.xml) try { Class.forName(oracle.jdbc.OracleDriver); Context initContext = new InitialContext(); Context envContext = (Context) initContext.lookup(CONTEXT_NAME); DATA_SOURCE = (DataSource)envContext.lookup(DB_NAME); } catch (Exception ex) { System.err.println( ex ); ex.printStackTrace(); throw ex; } } return DATA_SOURCE.getConnection(); // line 208 } Neil Youngman - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: [ERROR] Cannot create JDBC driver of class '' for connect URL 'null'
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Neil, Just a few comments on your connection acquisition code: On 7/14/2009 12:45 PM, Neil Youngman wrote: private static final String CONTEXT_NAME = java:/comp/env; private static final String DB_NAME = jdbc/AppDatabase; If you have the same class in two applications (except for these two constants), why not use the same class plus a configuration file? private static Connection getConnection () throws Exception, SQLException { if( DATA_SOURCE == null ) Hmm... a DataSource object is not guaranteed to be threadsafe. I would not bother to cache the DataSource object in your class: at least not in a static field. The performance hit you experience from performing repeated JNDI lookups is negligible, and your code has the benefit of always getting the current DataSource from the directory. // Get the data source (from context.xml) try { Class.forName(oracle.jdbc.OracleDriver); This line of code is not necessary at all, for several reasons: 1. The connection pool will already make sure this class is loaded 2. Standard JDBC practice is to call Class.forName(driver).newInstance() to make sure that the driver is, in fact, registered with the DriverManager. 3. A driver used with a DataSource does not bother to register itself with the DriverManager (see javadoc for javax.sql.DataSource). This is all you need: Context initContext = new InitialContext(); Context envContext = (Context) initContext.lookup(CONTEXT_NAME); DATA_SOURCE = (DataSource)envContext.lookup(DB_NAME); That's it. catch (Exception ex) { System.err.println( ex ); ex.printStackTrace(); throw ex; } This exception handler doesn't add much: the caller has the opportunity to catch this exception, so why log it at this level? If I were you, I'd try these steps to resolve your problem: 1. Remove the 'factory' attribute from your Resource declaration 2. Remove commons-dbcp-*.jar from WEB-INF/lib This has a fair chance of working. Any particular reason you want to use a webapp-provided connection pool factory? - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkpc0SgACgkQ9CaO5/Lv0PD2WACghKVp2vvrk2F9m78R2lwcFGNp JMcAn0g1W2O2C6h9dcRihYdClENiXIv1 =u5uA -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: [ERROR] Cannot create JDBC driver of class '' for connect URL 'null'
Christopher Schultz wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Neil, Just a few comments on your connection acquisition code: On 7/14/2009 12:45 PM, Neil Youngman wrote: private static final String CONTEXT_NAME = java:/comp/env; private static final String DB_NAME = jdbc/AppDatabase; If you have the same class in two applications (except for these two constants), why not use the same class plus a configuration file? It's not the same class, but they share the code that connects to the database. It might be advantageous to factor it out, but they are currently small self contained apps. private static Connection getConnection () throws Exception, SQLException { if( DATA_SOURCE == null ) Hmm... a DataSource object is not guaranteed to be threadsafe. I would not bother to cache the DataSource object in your class: at least not in a static field. OK, I'm happy to drop that. The performance hit you experience from performing repeated JNDI lookups is negligible, and your code has the benefit of always getting the current DataSource from the directory. // Get the data source (from context.xml) try { Class.forName(oracle.jdbc.OracleDriver); This line of code is not necessary at all, for several reasons: 1. The connection pool will already make sure this class is loaded 2. Standard JDBC practice is to call Class.forName(driver).newInstance() to make sure that the driver is, in fact, registered with the DriverManager. 3. A driver used with a DataSource does not bother to register itself with the DriverManager (see javadoc for javax.sql.DataSource). This is all you need: Context initContext = new InitialContext(); Context envContext = (Context) initContext.lookup(CONTEXT_NAME); DATA_SOURCE = (DataSource)envContext.lookup(DB_NAME); That's it. catch (Exception ex) { System.err.println( ex ); ex.printStackTrace(); throw ex; } This exception handler doesn't add much: the caller has the opportunity to catch this exception, so why log it at this level? I prefer not to rely on the caller logging exceptions. I want to be sure that I get a full stack trace and I can't always rely on the caller to provide it. If I were you, I'd try these steps to resolve your problem: 1. Remove the 'factory' attribute from your Resource declaration 2. Remove commons-dbcp-*.jar from WEB-INF/lib I've already done both of these. This has a fair chance of working. Any particular reason you want to use a webapp-provided connection pool factory? I think that was a hangover from tomcat 5. I've removed that, to no obvious effect. Thanks for the pointers. I've still got a long way to go before I'm an expert and all the feedback helps. Neil Youngman - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org