在加载DriverManager过程中 “偶尔” 会出现如下无法示例化情况,整个程序就在这里一直等待着。
"main" prio=6 tid=0x0000000002ab8000 nid=0x1b7c in Object.wait() [0x0000000002fad000]
java.lang.Thread.State: RUNNABLE
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at java.lang.Class.newInstance(Class.java:379)
at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:373)
at java.util.ServiceLoader$1.next(ServiceLoader.java:445)
at java.sql.DriverManager$2.run(DriverManager.java:510)
at java.sql.DriverManager$2.run(DriverManager.java:490)
at java.security.AccessController.doPrivileged(Native Method)
at java.sql.DriverManager.loadInitialDrivers(DriverManager.java:490)
at java.sql.DriverManager.(DriverManager.java:100)
at com.alibaba.druid.pool.DruidAbstractDataSource.setLoginTimeout(DruidAbstractDataSource.java:1115)
mysql驱动5.1.36,JDK 1.7.79 , Druid 1.0.18,
1条答案
按热度按时间6uxekuva1#
遇到了相同问题,mysql驱动5.1.45,jdk1.8.0_102,druid1.1.5