xml - cannot create jdbc driver of class '' for connect url 'null' postgresql -
i'm getting error when try deploy war application.
org.apache.tomcat.dbcp.dbcp.sqlnestedexception: cannot create jdbc driver of cla ss '' connect url 'null' @ org.apache.tomcat.dbcp.dbcp.basicdatasource.createconnectionfactory(b asicdatasource.java:1452) @ org.apache.tomcat.dbcp.dbcp.basicdatasource.createdatasource(basicdat asource.java:1371) @ org.apache.tomcat.dbcp.dbcp.basicdatasource.getconnection(basicdataso urce.java:1044) @ kimet.conexionsql.getconexion(conexionsql.java:20) @ kimet.global.cargarhashtablesaux(global.java:2360) @ kimet.inicio.init(inicio.java:33) @ org.apache.catalina.core.standardwrapper.loadservlet(standardwrapper. java:1206) @ org.apache.catalina.core.standardwrapper.load(standardwrapper.java:10 26) @ org.apache.catalina.core.standardcontext.loadonstartup(standardcontex t.java:4421) @ org.apache.catalina.core.standardcontext.start(standardcontext.java:4 734) @ org.apache.catalina.core.containerbase.addchildinternal(containerbase .java:799) @ org.apache.catalina.core.containerbase.addchild(containerbase.java:77 9) @ org.apache.catalina.core.standardhost.addchild(standardhost.java:601) @ org.apache.catalina.startup.hostconfig.deploywar(hostconfig.java:943) @ org.apache.catalina.startup.hostconfig.deploywars(hostconfig.java:778 ) @ org.apache.catalina.startup.hostconfig.deployapps(hostconfig.java:504 ) @ org.apache.catalina.startup.hostconfig.start(hostconfig.java:1317) @ org.apache.catalina.startup.hostconfig.lifecycleevent(hostconfig.java :324) @ org.apache.catalina.util.lifecyclesupport.firelifecycleevent(lifecycl esupport.java:142) @ org.apache.catalina.core.containerbase.start(containerbase.java:1065) @ org.apache.catalina.core.standardhost.start(standardhost.java:840) @ org.apache.catalina.core.containerbase.start(containerbase.java:1057) @ org.apache.catalina.core.standardengine.start(standardengine.java:463 ) @ org.apache.catalina.core.standardservice.start(standardservice.java:5 25) @ org.apache.catalina.core.standardserver.start(standardserver.java:754 ) @ org.apache.catalina.startup.catalina.start(catalina.java:595) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl. java:39) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodacces sorimpl.java:25) @ java.lang.reflect.method.invoke(method.java:597) @ org.apache.catalina.startup.bootstrap.start(bootstrap.java:289) @ org.apache.catalina.startup.bootstrap.main(bootstrap.java:414) caused by: java.lang.nullpointerexception @ sun.jdbc.odbc.jdbcodbcdriver.getprotocol(jdbcodbcdriver.java:507) @ sun.jdbc.odbc.jdbcodbcdriver.knownurl(jdbcodbcdriver.java:476) @ sun.jdbc.odbc.jdbcodbcdriver.acceptsurl(jdbcodbcdriver.java:307) @ java.sql.drivermanager.getdriver(drivermanager.java:253) @ org.apache.tomcat.dbcp.dbcp.basicdatasource.createconnectionfactory(b asicdatasource.java:1437) ... 31 more org.apache.tomcat.dbcp.dbcp.sqlnestedexception: cannot create jdbc driver of cla ss '' connect url 'null' @ org.apache.tomcat.dbcp.dbcp.basicdatasource.createconnectionfactory(b asicdatasource.java:1452) @ org.apache.tomcat.dbcp.dbcp.basicdatasource.createdatasource(basicdat asource.java:1371) @ org.apache.tomcat.dbcp.dbcp.basicdatasource.getconnection(basicdataso urce.java:1044) @ kimet.conexionsql.getconexion(conexionsql.java:20) @ kimet.global.cargarhashtablesaux(global.java:2360) @ kimet.inicio.init(inicio.java:33) @ org.apache.catalina.core.standardwrapper.loadservlet(standardwrapper. java:1206) @ org.apache.catalina.core.standardwrapper.load(standardwrapper.java:10 26) @ org.apache.catalina.core.standardcontext.loadonstartup(standardcontex t.java:4421) @ org.apache.catalina.core.standardcontext.start(standardcontext.java:4 734) @ org.apache.catalina.core.containerbase.addchildinternal(containerbase .java:799) @ org.apache.catalina.core.containerbase.addchild(containerbase.java:77 9) @ org.apache.catalina.core.standardhost.addchild(standardhost.java:601) @ org.apache.catalina.startup.hostconfig.deploywar(hostconfig.java:943) @ org.apache.catalina.startup.hostconfig.deploywars(hostconfig.java:778 ) @ org.apache.catalina.startup.hostconfig.deployapps(hostconfig.java:504 ) @ org.apache.catalina.startup.hostconfig.start(hostconfig.java:1317) @ org.apache.catalina.startup.hostconfig.lifecycleevent(hostconfig.java :324) @ org.apache.catalina.util.lifecyclesupport.firelifecycleevent(lifecycl esupport.java:142) @ org.apache.catalina.core.containerbase.start(containerbase.java:1065) @ org.apache.catalina.core.standardhost.start(standardhost.java:840) @ org.apache.catalina.core.containerbase.start(containerbase.java:1057) @ org.apache.catalina.core.standardengine.start(standardengine.java:463 ) @ org.apache.catalina.core.standardservice.start(standardservice.java:5 25) @ org.apache.catalina.core.standardserver.start(standardserver.java:754 ) @ org.apache.catalina.startup.catalina.start(catalina.java:595) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl. java:39) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodacces sorimpl.java:25) @ java.lang.reflect.method.invoke(method.java:597) @ org.apache.catalina.startup.bootstrap.start(bootstrap.java:289) @ org.apache.catalina.startup.bootstrap.main(bootstrap.java:414) caused by: java.lang.nullpointerexception @ sun.jdbc.odbc.jdbcodbcdriver.getprotocol(jdbcodbcdriver.java:507) @ sun.jdbc.odbc.jdbcodbcdriver.knownurl(jdbcodbcdriver.java:476) @ sun.jdbc.odbc.jdbcodbcdriver.acceptsurl(jdbcodbcdriver.java:307) @ java.sql.drivermanager.getdriver(drivermanager.java:253) @ org.apache.tomcat.dbcp.dbcp.basicdatasource.createconnectionfactory(b asicdatasource.java:1437) ... 31 more --- inicializado kimetsport --- thu apr 25 11:16:13 cest 2013 25-abr-2013 11:16:13 org.apache.catalina.startup.hostconfig deploydirectory info: despliegue del directorio docs de la aplicaci¾n web 25-abr-2013 11:16:13 org.apache.catalina.startup.hostconfig deploydirectory info: despliegue del directorio examples de la aplicaci¾n web 25-abr-2013 11:16:14 org.apache.catalina.startup.hostconfig deploydirectory info: despliegue del directorio root de la aplicaci¾n web 25-abr-2013 11:16:14 org.apache.coyote.http11.http11aprprotocol start info: arrancando coyote http/1.1 en puerto http-8080 25-abr-2013 11:16:14 org.apache.coyote.ajp.ajpaprprotocol start info: arrancando coyote ajp/1.3 en ajp-8009 25-abr-2013 11:16:14 org.apache.catalina.startup.catalina start info: server startup in 4540 ms
i show files i've modified:
at beginning, in tomcat's context.xml file:
<context reloadable="true" privileged="true"> <!-- default set of monitored resources --> <watchedresource>web-inf/web.xml</watchedresource> </context>
in web.xml file:
<resource-ref> <!-- <description>db kimet</description> --> <res-ref-name>modulo/kimet</res-ref-name> <res-type>javax.sql.datasource</res-type> <res-auth>container</res-auth> <!-- <res-sharing-scope>shareable</res-sharing-scope> --> </resource-ref>
finally, i've created own xml file "aks.xml" in directory "conf\catalina\localhost"
<?xml version='1.0' encoding='utf-8'?> <context crosscontext="true" displayname="kimet sport" docbase="c:/workarea/kimetsportweb/webcontent" path="/aks" reloadable="true"> <resource name="modulo/kimet" auth="container" type="javax.sql.datasource" factory="org.apache.commons.dbcp.basicdatasourcefactory" defaultautocommit="false" removeabandoned="false" removeabandonedtimeout="30" maxactive="50" maxidle="20" maxwait="10000" username="usukimet" password="usukimet" driverclassname="org.postgresql.driver" url="jdbc:postgresql://192.168.1.169:5432/kimet_desarrollo"/> </context>
anybody has idea why not working? suggestion welcomed! in advance!
what aks.xml
file of yours?
if want specify datasource war in tomcat outside of application, have configure in context.xml
, example:
<resource name="jdbc/testdb" auth="container" type="javax.sql.datasource" maxactive="100" maxidle="30" maxwait="10000" username="javauser" password="javadude" driverclassname="com.mysql.jdbc.driver" url="jdbc:mysql://localhost:3306/javatest"/>
(taken tomcat's jndi datasource how-to.)