單元測試時鏈接池拋出的異常:java
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 web
解決辦法:單元測試
鏈接池jar包的問題,以前用的proxool-0.8.3.jar。換成proxool-0.9.1.jar和proxool-cglib.jar就好了測試