0

WAR アプリケーションをデプロイしようとすると、このエラーが発生します。

org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of cla
ss '' for connect URL 'null'
        at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createConnectionFactory(B
asicDataSource.java:1452)
        at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDat
aSource.java:1371)
        at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSo
urce.java:1044)
        at kimet.ConexionSQL.getConexion(ConexionSQL.java:20)
        at kimet.Global.cargarHashtablesAux(Global.java:2360)
        at kimet.Inicio.init(Inicio.java:33)
        at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.
java:1206)
        at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:10
26)
        at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContex
t.java:4421)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4
734)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase
.java:799)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:77
9)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)

        at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:943)

        at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:778
)
        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:504
)
        at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1317)
        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java
:324)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Lifecycl
eSupport.java:142)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1065)

        at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)

        at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463
)
        at org.apache.catalina.core.StandardService.start(StandardService.java:5
25)
        at org.apache.catalina.core.StandardServer.start(StandardServer.java:754
)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
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.createConnectionFactory(B
asicDataSource.java:1437)
        ... 31 more
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of cla
ss '' for connect URL 'null'
        at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createConnectionFactory(B
asicDataSource.java:1452)
        at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDat
aSource.java:1371)
        at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSo
urce.java:1044)
        at kimet.ConexionSQL.getConexion(ConexionSQL.java:20)
        at kimet.Global.cargarHashtablesAux(Global.java:2360)
        at kimet.Inicio.init(Inicio.java:33)
        at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.
java:1206)
        at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:10
26)
        at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContex
t.java:4421)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4
734)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase
.java:799)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:77
9)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)

        at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:943)

        at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:778
)
        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:504
)
        at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1317)
        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java
:324)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Lifecycl
eSupport.java:142)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1065)

        at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)

        at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463
)
        at org.apache.catalina.core.StandardService.start(StandardService.java:5
25)
        at org.apache.catalina.core.StandardServer.start(StandardServer.java:754
)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
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.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

変更したファイルを示します。

最初に、Tomcat の context.xml ファイルで:

<Context reloadable="true" privileged="true">
    <!-- Default set of monitored resources -->
    <WatchedResource>WEB-INF/web.xml</WatchedResource>
</Context>

web.xml ファイルで:

<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>

最後に、「conf\Catalina\localhost」ディレクトリに独自の xml ファイル「aKS.xml」を作成しました。

<?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>

なぜ機能しないのか、誰かが何か考えを持っていますか? どんな提案でも大歓迎です!前もって感謝します!

4

1 に答える 1