tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Short, Dave" <dave.sh...@pfizer.com>
Subject DBCP borrowObject failed
Date Sun, 18 Aug 2002 00:22:48 GMT
I am having a problem getting a connection from JNDI.  I set up my
server.xml and web.xml files per the instructions in the JNDI Resources
HOW-TO and JNDI DataSource Examples on the Tomcat 4.1 Documentation Page.

Configuration:

W2K
Tomcat 4.1.9 (Stand Alone)
Oracle 8.1.7

Here's my Tomcat console output, server.xml and web.xml snippets.

Any help would be much appreciated.

Dave

Console Output
****************************************************************************
*************************************************

[INFO] Registry - -Loading registry information
[INFO] Registry - -Creating new Registry instance
[INFO] Registry - -Creating MBeanServer
[INFO] Http11Protocol - -Initializing Coyote HTTP/1.1 on port 8080
Starting service Tomcat-Standalone
Apache Tomcat/4.1.9
[INFO] Http11Protocol - -Starting Coyote HTTP/1.1 on port 8080
[INFO] ChannelSocket - -JK2: ajp13 listening on tcp port 8009
[INFO] JkMain - -APR not loaded, disabling jni components:
java.io.IOException:
no jkjni in java.library.path
[INFO] JkMain - -Jk running ID=0 time=60/60
config=C:\Tomcat\conf\jk2.properties
DBCP borrowObject failed: null
java.lang.NullPointerException
        at
org.apache.commons.dbcp.DelegatingConnection.setAutoCommit(DelegatingConnect
ion.java:237)
        at
org.apache.commons.dbcp.PoolableConnectionFactory.activateObject(PoolableCon
nectionFactory.java:273)
        at
org.apache.commons.pool.impl.GenericObjectPool.borrowObject(Unknown Source)
        at
org.apache.commons.dbcp.AbandonedObjectPool.borrowObject(AbandonedObjectPool
.java:117)
        at
org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.ja
va:110)
        at
org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:3
12)
        at foo.DBTest.init(Unknown Source)
        at org.apache.jsp.test_jsp._jspService(test_jsp.java:52)
        at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:136)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:2
02)
        at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:289)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:247)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:193)
        at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:260)
        at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(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.ja
va:191)
        at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(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:2350)
        at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180
)
        at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
        at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.
java:170)
        at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641)
        at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:171
)
        at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(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.invok
eNext(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.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
        at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:405)
        at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne
ction(Http11Protocol.java:380)
        at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:508)
        at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
a:533)
        at java.lang.Thread.run(Thread.java:479)


server.xml
****************************************************************************
*************************************************
        <!-- Tomcat PSI Context -->
        <Context path="/PSI" docBase="PSI" debug="0"
                 reloadable="true" crossContext="true">

          <Logger className="org.apache.catalina.logger.FileLogger"
                     prefix="short200_PSI_log." suffix=".txt"
        	  timestamp="true"/>

          <Resource name="jdbc/PSIOracle" auth="Container"
                    type="javax.sql.DataSource"/> 

          <ResourceParams name="jdbc/PSIOracle">

            <parameter>
              <name>factory</name>
              <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
            </parameter>
    
            <parameter>
              <name>username</name>
              <value>cust0</value>
            </parameter>

            <parameter>
              <name>password</name>
              <value>sql</value>
            </parameter>

            <parameter>
              <name>driverClassName</name>
              <value>oracle.jdbc.driver.OracleDriver</value>
            </parameter>

            <parameter>
              <name>url</name>
              <value>jdbc:oracle:thin:CUST0@short200:1521:PSIP</value>
            </parameter>

            <parameter>
              <name>maxActive</name>
              <value>20</value>
            </parameter>

            <parameter>
              <name>maxIdle</name>
              <value>10</value>
            </parameter>

            <parameter>
              <name>maxWait</name>
              <value>-1</value>
            </parameter>

            <parameter>
              <name>validationQuery</name>
              <value>select 1 from dual</value>
            </parameter>

          </ResourceParams>

        </Context>

web.xml
****************************************************************************
*************************************************
<web-app>
  <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/PSIOracle
    </res-ref-name>

    <res-type>
      javax.sql.DataSource
    </res-type>

    <res-auth>
      Container
    </res-auth>

  </resource-ref>

</web-app>

--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message