tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Don Ross" <dr...@leds.com>
Subject Problem confinguring MySQL JNDI Datasource RH Linux 7.2
Date Thu, 31 Jul 2003 15:09:22 GMT
Hello,

I have followed instructions provided for configuring JNDI Datasource for MySQL (http://jakarta.apache.org/tomcat/tomcat-4.1-doc/printer/jndi-datasource-examples-howto.html),
and am running into problem on RedHat Linux 7.2.

Here is my configuration:

RedHat Linux 7.2 (kernel-2.4.7-10)
Tomcat 4.1.24 (Clean install)
MySQL 4.0.12
Using mysql-connector-java-3.0.8-stable-bin.jar (driver installed in $CATALINA_HOME/common/lib/)

I copied the example code straight from the URL and made following change to DBTest context
for my system and mysql driver.

<server.xml snippet>
!-- Class name for mm.mysql JDBC driver -->
    			<parameter>
       				<name>driverClassName</name>
       				<value>com.mysql.jdbc.Driver</value>
    			</parameter>

    <!-- The JDBC connection url for connecting to your MySQL dB.
         The autoReconnect=true argument to the url makes sure that the
         mm.mysql JDBC Driver will automatically reconnect if mysqld closed the
         connection.  mysqld by default closes idle connections after 8 hours.
         -->
    			<parameter>
      				<name>url</name>
      				<value>jdbc:mysql://<dns name of system>:3306/javatest?autoReconnect=true</value>
    			</parameter>
  		</ResourceParams>
</server.xml snippet>

I get following error in catalina.out when bringing up test.jsp that uses the datasource.

<catalina.out error>
	DBCP borrowObject failed: java.sql.SQLException: Server connection failure during transaction.

Attempted reconnect 3 times. Giving up.
org.apache.commons.dbcp.DbcpException: java.sql.SQLException: Server connection failure during
transaction. 
Attempted reconnect 3 times. Giving up.
	at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:85)
	at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:184)
	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.java:110)
	at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:312)
	at foo.DBTest.init(DBTest.java:23)
	at org.apache.jsp.test_jsp._jspService(test_jsp.java:49)
	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:210)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
	at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(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.java:191)
	at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(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:2415)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
	at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
	at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
	at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
	at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(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.invokeNext(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:594)
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
	at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
	at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
	at java.lang.Thread.run(Thread.java:536)
Caused by: java.sql.SQLException: Server connection failure during transaction. 
Attempted reconnect 3 times. Giving up.
	at com.mysql.jdbc.Connection.createNewIO(Connection.java:1704)
	at com.mysql.jdbc.Connection.<init>(Connection.java:491)
	at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:346)
	at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:83)
	... 42 more
</catalina.out error>

Does any one have any advice on what may be wrong?

I have successfully configured Tomcat 4.1.24 using the JNDI datasource howto example code
on Windows 2000 using mysql-connector-java-3.0.8-stable-bin.jar, with MySQL 3.23.44.

Thanks for your help,

Don


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


Mime
View raw message