mysql连接不上导致jdbc blocked的问题

今天线上使用开发环境配置导致mysql 链接不上的错误:

"dboss-worker-thread-6" prio=10 tid=0x00002aaac0310000 nid=0x28e3 waiting for monitor entry [0x000000004440a000]
   java.lang.Thread.State: BLOCKED (on object monitor)
	at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1361)
	- waiting to lock <0x00000007980d41c8> (a org.apache.commons.dbcp.BasicDataSource)
	at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
	at com.duitang.common.data.RouterDataSource.getConnection(RouterDataSource.java:103)
	at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:111)
	at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:77)
	at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:573)
	at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:637)
	at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:666)
	at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:674)
	at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:714)
	at org.springframework.jdbc.core.JdbcTemplate.queryForList(JdbcTemplate.java:797)
	at com.duitang.biz.blog.impl.BlogQueryServiceImpl.queryBlogCoreById(BlogQueryServiceImpl.java:599)
	at com.duitang.biz.blog.impl.BlogQueryServiceImpl.queryBlogTiny(BlogQueryServiceImpl.java:741)
	at com.duitang.views.CommentService.queryCommentsByBlogs(CommentService.java:146)
	at com.duitang.biz.blog.impl.CommentQueryServiceImpl.queryComent(CommentQueryServiceImpl.java:44)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at com.duitang.dboss.service.ServiceInvoker.doaccept2(ServiceInvoker.java:127)
	at com.duitang.dboss.service.ServiceInvoker.accept(ServiceInvoker.java:46)
	at com.duitang.dboss.remote.nio.DbossServerHandler.messageReceived(DbossServerHandler.java:40)
	at org.jboss.netty.channel.SimpleChannelHandler.handleUpstream(SimpleChannelHandler.java:98)
	at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:560)
	at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:796)
	at org.jboss.netty.handler.execution.ChannelEventRunnable.run(ChannelEventRunnable.java:69)
	at org.jboss.netty.handler.execution.OrderedMemoryAwareThreadPoolExecutor$ChildExecutor.run(OrderedMemoryAwareThreadPoolExecutor.java:307)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:662)

"dboss-worker-thread-4" prio=10 tid=0x0000000048437000 nid=0x28e1 waiting for monitor entry [0x0000000044208000]
   java.lang.Thread.State: BLOCKED (on object monitor)
	at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1361)
	- waiting to lock <0x00000007980d41c8> (a org.apache.commons.dbcp.BasicDataSource)
	at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
	at com.duitang.common.data.RouterDataSource.getConnection(RouterDataSource.java:103)
	at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:111)
	at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:77)
	at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:573)
	at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:637)
	at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:666)
	at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:674)
	at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:714)
	at org.springframework.jdbc.core.JdbcTemplate.queryForList(JdbcTemplate.java:797)
	at com.duitang.biz.blog.impl.BlogQueryServiceImpl.queryBlogCoreById(BlogQueryServiceImpl.java:599)
	at com.duitang.biz.blog.impl.BlogQueryServiceImpl.queryBlogTiny(BlogQueryServiceImpl.java:741)
	at com.duitang.views.CommentService.queryCommentsByBlogs(CommentService.java:146)
	at com.duitang.biz.blog.impl.CommentQueryServiceImpl.queryComent(CommentQueryServiceImpl.java:44)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at com.duitang.dboss.service.ServiceInvoker.doaccept2(ServiceInvoker.java:127)
	at com.duitang.dboss.service.ServiceInvoker.accept(ServiceInvoker.java:46)
	at com.duitang.dboss.remote.nio.DbossServerHandler.messageReceived(DbossServerHandler.java:40)
	at org.jboss.netty.channel.SimpleChannelHandler.handleUpstream(SimpleChannelHandler.java:98)
	at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:560)
	at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:796)
	at org.jboss.netty.handler.execution.ChannelEventRunnable.run(ChannelEventRunnable.java:69)
	at org.jboss.netty.handler.execution.OrderedMemoryAwareThreadPoolExecutor$ChildExecutor.run(OrderedMemoryAwareThreadPoolExecutor.java:307)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:662)

"pool-5-thread-2" prio=10 tid=0x0000000048435000 nid=0x28e0 waiting on condition [0x0000000044108000]
   java.lang.Thread.State: TIMED_WAITING (parking)
	at sun.misc.Unsafe.park(Native Method)
	- parking to wait for  <0x00000007980b03c8> (a java.util.concurrent.SynchronousQueue$TransferStack)
	at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:196)
	at java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:424)
	at java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:323)
	at java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:874)
	at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:945)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
	at java.lang.Thread.run(Thread.java:662)

"dboss-worker-thread-2" prio=10 tid=0x00002aaac027d800 nid=0x28db runnable [0x0000000043f04000]
   java.lang.Thread.State: RUNNABLE
	at java.net.PlainSocketImpl.socketConnect(Native Method)
	at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
	- locked <0x00000007793cf188> (a java.net.SocksSocketImpl)
	at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
	at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
	at java.net.Socket.connect(Socket.java:529)
	at java.net.Socket.connect(Socket.java:478)
	at java.net.Socket.<init>(Socket.java:375)
	at java.net.Socket.<init>(Socket.java:218)
	at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:257)
	at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:300)
	at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2393)
	at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2430)
	at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2215)
	- locked <0x0000000779239e30> (a com.mysql.jdbc.JDBC4Connection)
	at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:813)
	at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
	at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
	at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:399)
	at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:334)
	at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
	at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:582)
	at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1556)
	at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1545)
	at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1388)
	- locked <0x00000007980d41c8> (a org.apache.commons.dbcp.BasicDataSource)
	at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
	at com.duitang.common.data.RouterDataSource.getConnection(RouterDataSource.java:103)
	at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:111)
	at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:77)
	at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:573)
	at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:637)
	at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:666)
	at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:674)
	at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:714)
	at org.springframework.jdbc.core.JdbcTemplate.queryForList(JdbcTemplate.java:797)
	at com.duitang.biz.blog.impl.BlogQueryServiceImpl.queryBlogCoreById(BlogQueryServiceImpl.java:599)
	at com.duitang.biz.blog.impl.BlogQueryServiceImpl.queryBlogById(BlogQueryServiceImpl.java:363)
	at com.duitang.biz.blog.impl.BlogQueryServiceImpl.queryBlogDetail(BlogQueryServiceImpl.java:724)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at com.duitang.dboss.service.ServiceInvoker.doaccept2(ServiceInvoker.java:127)
	at com.duitang.dboss.service.ServiceInvoker.accept(ServiceInvoker.java:46)
	at com.duitang.dboss.remote.nio.DbossServerHandler.messageReceived(DbossServerHandler.java:40)
	at org.jboss.netty.channel.SimpleChannelHandler.handleUpstream(SimpleChannelHandler.java:98)
	at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:560)
	at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:796)
	at org.jboss.netty.handler.execution.ChannelEventRunnable.run(ChannelEventRunnable.java:69)
	at org.jboss.netty.handler.execution.OrderedMemoryAwareThreadPoolExecutor$ChildExecutor.run(OrderedMemoryAwareThreadPoolExecutor.java:307)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:662)

 被lock在 L113:    - locked <0x00000007980d41c8> (a org.apache.commons.dbcp.BasicDataSource) 

你可能感兴趣的:(mysql)