Shutting down 'imagePool' pool immediately [Shutdown Hook] 异常处理

单元测试时连接池抛出的异常:

18:08:54,703  INFO imagePool:474 - Shutting down 'imagePool' pool immediately [Shutdown Hook] 
18:08:54,750 ERROR ShutdownHook:62 - Problem calling "get cause" on IllegalStateException. 
java.lang.reflect.InvocationTargetException 
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 
at java.lang.reflect.Method.invoke(Unknown Source) 
at org.logicalcobwebs.proxool.ShutdownHook.remove(ShutdownHook.java:40) 
at org.logicalcobwebs.proxool.ProxoolFacade.shutdown(ProxoolFacade.java:238) 
at org.logicalcobwebs.proxool.ProxoolFacade.shutdown(ProxoolFacade.java:220) 
at org.logicalcobwebs.proxool.ShutdownHook.run(ShutdownHook.java:99) 
at java.lang.Thread.run(Unknown Source) 
Caused by: java.lang.IllegalStateException: Shutdown in progress 
at java.lang.Shutdown.remove(Unknown Source) 
at java.lang.Runtime.removeShutdownHook(Unknown Source) 
... 9 more 

 

解决办法:

连接池jar包的问题,之前用的proxool-0.8.3.jar。换成proxool-0.9.1.jar和proxool-cglib.jar就行了

你可能感兴趣的:(单元测试,jar,hook)