File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JForum and the fly likes MySQLNonTransientConnectionException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Products » JForum
Bookmark "MySQLNonTransientConnectionException" Watch "MySQLNonTransientConnectionException" New topic
Author

MySQLNonTransientConnectionException

Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
When nobody access my forum for a few hours, then it will throw an exception, following is the error message on the page:


An error has occurred.

For detailed error information, please see the HTML source code, and contact the forum Administrator.

com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Communications link failure

Last packet sent to the server was 0 ms ago.

Query being executed when exception was thrown:

SELECT COUNT(pm.privmsgs_to_userid) AS private_messages, u.* FROM jforum_users u LEFT JOIN jforum_privmsgs pm ON pm.privmsgs_type = 1 AND pm.privmsgs_to_userid = u.user_id WHERE u.user_id = 1 GROUP BY pm.privmsgs_to_userid


how to fix this issue ?

[originally posted on jforum.net by lynx286]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
this is right click , view source code error message :


<!-- BEGIN ERROR STACK TRACE <br /> net.jforum.exceptions.DatabaseException: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Communications link failure <br /> <br /> Last packet sent to the server was 1 ms ago. <br /> <br /> Query being executed when exception was thrown: <br /> <br /> SELECT COUNT(pm.privmsgs_to_userid) AS private_messages, u.* FROM jforum_users u LEFT JOIN jforum_privmsgs pm ON pm.privmsgs_type = 1 AND pm.privmsgs_to_userid = u.user_id WHERE u.user_id = 1 GROUP BY pm.privmsgs_to_userid <br /> at sun.reflect.GeneratedConstructorAccessor114.newInstance(Unknown Source) <br /> at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) <br /> at java.lang.reflect.Constructor.newInstance(Constructor.java:513) <br /> at com.mysql.jdbc.Util.handleNewInstance(Util.java:406) <br /> at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1074) <br /> at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3134) <br /> at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1818) <br /> at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1961) <br /> at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2543) <br /> at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1737) <br /> at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1888) <br /> at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:76) <br /> at net.jforum.dao.generic.GenericUserDAO.selectById(GenericUserDAO.java:136) <br /> at net.jforum.repository.SecurityRepository.load(SecurityRepository.java:94) <br /> at net.jforum.repository.SecurityRepository.load(SecurityRepository.java:112) <br /> at net.jforum.JForum.service(JForum.java:163) <br /> at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) <br /> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) <br /> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) <br /> at net.jforum.util.legacy.clickstream.ClickstreamFilter.doFilter(ClickstreamFilter.java:59) <br /> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) <br /> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) <br /> at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) <br /> at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) <br /> at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) <br /> at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) <br /> at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) <br /> at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) <br /> at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:307) <br /> at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:385) <br /> at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:748) <br /> at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:678) <br /> at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:871) <br /> at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) <br /> at java.lang.Thread.run(Thread.java:619) <br /> Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Communications link failure <br /> <br /> Last packet sent to the server was 1 ms ago. <br /> <br /> Query being executed when exception was thrown: <br /> <br /> SELECT COUNT(pm.privmsgs_to_userid) AS private_messages, u.* FROM jforum_users u LEFT JOIN jforum_privmsgs pm ON pm.privmsgs_type = 1 AND pm.privmsgs_to_userid = u.user_id WHERE u.user_id = 1 GROUP BY pm.privmsgs_to_userid <br /> ... 35 more <br /> <br /> URL is: /forums/list.page?null <br /> END ERROR STACK TRACE-->

<html>
<head>
<title>Error</title>
</head>
<body>

An error has occurred.

For detailed error information, please see the HTML source code, and contact the forum Administrator.

<pre class="pre-error">com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Communications link failure

Last packet sent to the server was 1 ms ago.

Query being executed when exception was thrown:

SELECT COUNT(pm.privmsgs_to_userid) AS private_messages, u.* FROM jforum_users u LEFT JOIN jforum_privmsgs pm ON pm.privmsgs_type = 1 AND pm.privmsgs_to_userid = u.user_id WHERE u.user_id = 1 GROUP BY pm.privmsgs_to_userid
</pre>
</body>
</html>


[originally posted on jforum.net by lynx286]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
You can try configuring JForum to use a Tomcat Datasource to your database instead. The datasource must specify a validation query. On Tomcat 5.5 this would look like this:


[originally posted on jforum.net by ebourg]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
I put in the change that you suggested, but it did not work. Following is the change I made to server.xml

<Resource name="jdbc/jforum_db" auth="Container" <br /> type="javax.sql.DataSource" <br /> maxActive="100" <br /> maxIdle="30" <br /> maxWait="10000" <br /> testOnBorrow="true" <br /> validationQuery="SELECT 1 FROM DUAL" <br /> username="jforum" <br /> password="jforum" <br /> driverClassName="com.mysql.jdbc.Driver" <br /> url="jdbc:mysql://localhost:3306/jforum_db?autoReconnect=true"/>
where jdbc_db is the name of the database instance

I added the following to JFORUM/WEB-INF/web.xml:
<resource-ref>
<res-ref-name>
jdbc/jforum_db
</res-ref-name>
<res-type>
javax.sql.DataSource
</res-type>
<res-auth>
SERVLET
</res-auth>
</resource-ref>

I am still getting the error posted on Broken pipe. Would appreciate any help
Thanks



[originally posted on jforum.net by sdas]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
Could you show us the trace of the exception you get now ? Does it still contain a line with c3p0 ?
[originally posted on jforum.net by ebourg]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
Hi, you are right, the trace still has reference to c3p0. Here is the stack trace I am getting. Any pointer on how to fix it will help. Here is the stack trace:

java.net.SocketException: Broken pipe
at java.net.SocketOutputStream.socketWrite0(Native Method)
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65)
at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123)
at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:2637)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1554)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1665)
at com.mysql.jdbc.Connection.execSQL(Connection.java:3124)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1149)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1262)
at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:76)
at net.jforum.dao.generic.GenericUserDAO.selectById(GenericUserDAO.java:136)
at net.jforum.repository.SecurityRepository.load(SecurityRepository.java:94)
at net.jforum.repository.SecurityRepository.load(SecurityRepository.java:112)
at net.jforum.JForum.service(JForum.java:163)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.cbs.forum.extend.web.common.CategoryFilter.doFilter(CategoryFilter.java:84)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at net.jforum.util.legacy.clickstream.ClickstreamFilter.doFilter(ClickstreamFilter.java:59)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:228)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:216)
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:283)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:767)
at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:697)
at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:889)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:686)
at java.lang.Thread.run(Thread.java:619)
[originally posted on jforum.net by sdas]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
I guess this means your installation is still configured to use the datasource (C3P0) build by JForum instead of the datasource provided by Tomcat (DBCP).

You should have this in your configuration file :


[originally posted on jforum.net by ebourg]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
Hi, any idea which file has the original configuration in Jforum that has the c3p0 connection information. I dont recall we created any separate config file for Jforum - so c3p0 connection info should be in out of the box file in Jforum,

Also is it the same file I replace c3p0 with the lines you provided in your last post?
Thanks
[originally posted on jforum.net by sdas]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
Hi, I changed SystemGlobals.properties and now I am getting the following stack trace:
type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: Servlet.init() for servlet jforum threw exception
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:283)
org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:767)
org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:697)
org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:889)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
java.lang.Thread.run(Thread.java:619)


root cause

net.jforum.exceptions.DatabaseException: Error while trying to start the database: javax.naming.NameNotFoundException: Name jdbc is not bound in this Context
org.apache.naming.NamingContext.lookup(NamingContext.java:770)
org.apache.naming.NamingContext.lookup(NamingContext.java:153)
org.apache.naming.SelectorContext.lookup(SelectorContext.java:137)
javax.naming.InitialContext.lookup(InitialContext.java:392)
net.jforum.DataSourceConnection.init(DataSourceConnection.java:75)
net.jforum.ForumStartup.startDatabase(ForumStartup.java:75)
net.jforum.JForum.init(JForum.java:95)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:283)
org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:767)
org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:697)
org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:889)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
java.lang.Thread.run(Thread.java:619)


root cause

javax.naming.NameNotFoundException: Name jdbc is not bound in this Context
org.apache.naming.NamingContext.lookup(NamingContext.java:770)
org.apache.naming.NamingContext.lookup(NamingContext.java:153)
org.apache.naming.SelectorContext.lookup(SelectorContext.java:137)
javax.naming.InitialContext.lookup(InitialContext.java:392)
net.jforum.DataSourceConnection.init(DataSourceConnection.java:75)
net.jforum.ForumStartup.startDatabase(ForumStartup.java:75)
net.jforum.JForum.init(JForum.java:95)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:283)
org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:767)
org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:697)
org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:889)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
java.lang.Thread.run(Thread.java:619)

I have database.datasource.name in SystemGlobals.properties point to jdbc/jforum_db which is exactly what i have in server.xml. Would appreciate any help on this.
[originally posted on jforum.net by sdas]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
Try this for the name of the datasource :

java:comp/env/jdbc/jforum_db
[originally posted on jforum.net by ebourg]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
Now I get the following error:
javax.servlet.ServletException: Servlet.init() for servlet jforum threw exception
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:283)
org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:767)
org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:697)
org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:889)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
java.lang.Thread.run(Thread.java:619)


root cause

net.jforum.exceptions.DatabaseException: Error while trying to start the database: net.jforum.exceptions.DatabaseException: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'
org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1150)
org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
net.jforum.DataSourceConnection.getConnection(DataSourceConnection.java:84)
net.jforum.ForumStartup.startDatabase(ForumStartup.java:78)
net.jforum.JForum.init(JForum.java:95)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:283)
org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:767)
org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:697)
org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:889)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
java.lang.Thread.run(Thread.java:619)


root cause

net.jforum.exceptions.DatabaseException: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'
org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1150)
org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
net.jforum.DataSourceConnection.getConnection(DataSourceConnection.java:84)
net.jforum.ForumStartup.startDatabase(ForumStartup.java:78)
net.jforum.JForum.init(JForum.java:95)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:283)
org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:767)
org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:697)
org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:889)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
java.lang.Thread.run(Thread.java:619)


root cause

org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'
org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1150)
org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
net.jforum.DataSourceConnection.getConnection(DataSourceConnection.java:84)
net.jforum.ForumStartup.startDatabase(ForumStartup.java:78)
net.jforum.JForum.init(JForum.java:95)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:283)
org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:767)
org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:697)
org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:889)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
java.lang.Thread.run(Thread.java:619)


root cause

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.createDataSource(BasicDataSource.java:1143)
org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
net.jforum.DataSourceConnection.getConnection(DataSourceConnection.java:84)
net.jforum.ForumStartup.startDatabase(ForumStartup.java:78)
net.jforum.JForum.init(JForum.java:95)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:283)
org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:767)
org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:697)
org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:889)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
java.lang.Thread.run(Thread.java:619)


[originally posted on jforum.net by sdas]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
Did you put the mysql JAR in the common/lib directory of Tomcat ?
[originally posted on jforum.net by ebourg]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
Yes, I have both mysql-connector-java-5.0.5.jar and mysql-connector-java-5.0.3-bin.jar in
c:\apache-tomcat-6.0.14\lib (I do not have a common dir since it is version 6)
[originally posted on jforum.net by sdas]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
Emanuel, anything you can suggest on this error:
[originally posted on jforum.net by sdas]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
I don't understand why it doesn't work, you might try to put the datasource declaration in the application context.xml file instead of server.xml.

Get a look at :

http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.html
[originally posted on jforum.net by ebourg]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
Emanuel, I am not using any app server. I am using just J2SE and using Tomcat as the app server. Hence I do not have any application context file. So in that case any other file you suggest changing?
Thanks
[originally posted on jforum.net by sdas]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
Tomcat supports a context.xml file put in the META-INF directory of your war file :

http://tomcat.apache.org/tomcat-6.0-doc/config/context.html

This is where you should declare your datasource.
[originally posted on jforum.net by ebourg]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: MySQLNonTransientConnectionException