Post by Konstantin KolinkoPost by Jerry MalcolmI am trying to move my client to Tomcat 8 from 7.
Tomcat version = ?
version 8.0.15
Post by Konstantin KolinkoPost by Jerry MalcolmWe've been on 7 for a
year or two and have not had any major issues. I read through the 7-->8
migration instructions. As far as I can tell, I have renamed all of the
resource config parameters that changed (maxTotal, maxWaitMillis,
removedAbandonedOnBorrow).
There are two pool implementations in Tomcat 7 as well as in Tomcat 8.
Which one are you using? (Your factory = ?)
I looked at my <resource> tags, and I'm not specifying a factory
attribute at all. The doc says: "...with the only difference being that
you have to specify the |factory| attribute and set the value to
|org.apache.tomcat.jdbc.pool.DataSourceFactory" Is this new in TC 8 or
have I just been misconfigured for years? I assume from the doc that I
need to go in and add that to all resource tags, correct?
What has the default been in TC7 and TC8 without a factory being
specified? Could leaving this off actually be the cause of running out
of connections?
|
Post by Konstantin KolinkoPost by Jerry MalcolmBut after running for a couple of hours, I start
getting "Too Many Connections" exceptions when connecting to the db.
Granted, there's a chance I have some connection leaks in the code, and I'll
look into those. But this hasn't been an issue on 7 for the past year or
two. And shouldn't removeAbandoned clean those up? I've got logAbandoned
set to 'true', and nothing is showing up in the logs. Is this exception
referring to running out of available connections in the pool?
Describe "this exception" in more detail.
What component logs that message? (class, method name that accompany
the log message)
Stack trace?
Stack trace at the very bottom of this note
Post by Konstantin KolinkoPost by Jerry MalcolmIs there something else I need to change in the configuration to move to
Tomcat 8 that I've overlooked?
Read official documentation for Apache Commons DBCP pool
http://commons.apache.org/proper/commons-dbcp/configuration.html
Maybe you will notice some discrepancies with your configuration.
I'll keep looking. But I'm very curious that even though I might have
connection leaks, what is preventing Tomcat from abandoning them and
returning them to the pool as I believe I have it configured to do?
I've got logAbandoned set to true. But I'm not seeing a single entry in
the logs about connections being abandoned.
Off topic, but relevant.... it sure would be nice if the xml parser for
<resource> tags and other config items would flag with errors any
parameter misspellings such as using the old obsolete 'removeAbandoned'
instead of the new 'removeAbandonedOnBorrow', etc. or even just typo
misspells.
Post by Konstantin KolinkoBest regards,
Konstantin Kolinko
com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException:
Could not create connection to database server. Attempted reconnect 3
times. Giving up.
at
sun.reflect.GeneratedConstructorAccessor65.newInstance(Unknown Source)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:377)
at com.mysql.jdbc.Util.getInstance(Util.java:360)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:935)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:924)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:870)
at
com.mysql.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:2144)
at
com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2069)
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:790)
at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:44)
at
sun.reflect.GeneratedConstructorAccessor53.newInstance(Unknown Source)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:377)
at
com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:395)
at
com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:325)
at
org.apache.tomcat.dbcp.dbcp2.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
at
org.apache.tomcat.dbcp.dbcp2.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:204)
at
org.apache.tomcat.dbcp.pool2.impl.GenericObjectPool.create(GenericObjectPool.java:860)
at
org.apache.tomcat.dbcp.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:432)
at
org.apache.tomcat.dbcp.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:360)
at
org.apache.tomcat.dbcp.dbcp2.PoolingDataSource.getConnection(PoolingDataSource.java:118)
at
org.apache.tomcat.dbcp.dbcp2.BasicDataSource.getConnection(BasicDataSource.java:1412)
at jwm.servletdb.ServletDBData.getInstance(ServletDBData.java:117)
at jwm.servletdb.ServletDBData.getInstance(ServletDBData.java:101)
at jwm.wgbe.PageRouterFilter.doFilter(PageRouterFilter.java:151)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at
org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610)
at
org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:291)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:537)
at
org.apache.coyote.ajp.AbstractAjpProcessor.process(AbstractAjpProcessor.java:831)
at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:658)
at
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1556)
at
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1513)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown
Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown
Source)
at
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Unknown Source)
Caused by:
com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException:
Data source rejected establishment of connection, message from server:
"Too many connections"
at
sun.reflect.GeneratedConstructorAccessor65.newInstance(Unknown Source)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:377)
at com.mysql.jdbc.Util.getInstance(Util.java:360)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:935)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:924)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1037)
at
com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2234)
at
com.mysql.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:2085)
... 38 more
---------------------------------------------------------------------
To unsubscribe, e-mail: users-***@tomcat.apache.org
For additional commands, e-mail: users-***@tomcat.apache.org