tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Short, Dave" <dave.sh...@pfizer.com>
Subject RE: DBCP borrowObject failed
Date Mon, 19 Aug 2002 14:29:35 GMT
Simon,

Thanks for the reply.  I changed the URL to the following and it now works.

<value>jdbc:oracle:thin:@localhost:1521:test</value>

Dave

-----Original Message-----
From: Simon T [mailto:tomcat@sydneybluegum.com]
Sent: August 18, 2002 5:01 AM
To: Tomcat Users List
Subject: Re: DBCP borrowObject failed


Your server xml is missing usersname and password, mybe you left this 
out in the email.
web.xml is fine, but it need to be the one under PSI/WEB-INF

I am running oracle fine wtih JDK1.3.1 as a window service, have not got 
going with JDK1.4.0 yet.
My url has no username in front of it.
    <value>jdbc:oracle:thin:@localhost:1521:test</value>

Yours has

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

is CUSTO correct? Maybe you could leave it out.

Did you use the correct tomcat.exe, the LE one is for JDK1.4.


This is from my server.xml
<Resource name="jdbc/myoracle" auth="Container"
              type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/myoracle">
  <parameter>
    <name>factory</name>
    <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
  </parameter>
  <parameter>
    <name>driverClassName</name>
    <value>oracle.jdbc.driver.OracleDriver</value>
  </parameter>
  <parameter>
    <name>url</name>
    <value>jdbc:oracle:thin:@localhost:1521:test</value>
  </parameter>
  <parameter>
    <name>username</name>
    <value>test</value>
  </parameter>
  <parameter>
    <name>password</name>
    <value>xxxx</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>
</ResourceParams>

Simon

Short, Dave wrote:

>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:
>
>[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(DelegatingConnec
t
>ion.java:237)
>        at
>org.apache.commons.dbcp.PoolableConnectionFactory.activateObject(PoolableCo
n
>nectionFactory.java:273)
>        at
>org.apache.commons.pool.impl.GenericObjectPool.borrowObject(Unknown Source)
>        at
>org.apache.commons.dbcp.AbandonedObjectPool.borrowObject(AbandonedObjectPoo
l
>.java:117)
>        at
>org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.j
a
>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(Applicatio
n
>FilterChain.java:247)
>        at
>org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterC
h
>ain.java:193)
>        at
>org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.j
a
>va:260)
>        at
>org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invo
k
>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.j
a
>va:191)
>        at
>org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invo
k
>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:18
0
>)
>        at
>org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invo
k
>eNext(StandardPipeline.java:643)
>        at
>org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve
.
>java:170)
>        at
>org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invo
k
>eNext(StandardPipeline.java:641)
>        at
>org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:17
1
>)
>        at
>org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invo
k
>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.jav
a
>:174)
>        at
>org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invo
k
>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.processConn
e
>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.ja
v
>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>
>
>
>  
>




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

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