在proxool-0.8.3.jar版本的时候,总是出现如下问题。
1360 [Shutdown Hook] INFO proxool.proxoolPool - Shutting down 'proxoolPool' pool immediately [Shutdown Hook]
1360 [Shutdown Hook] ERROR proxool.ShutdownHook - Problem calling "get cause" on IllegalStateException.
java.lang.reflect.InvocationTargetException
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 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(Thread.java:619)
Caused by: java.lang.IllegalStateException: Shutdown in progress
at java.lang.ApplicationShutdownHooks.remove(ApplicationShutdownHooks.java:55)
at java.lang.Runtime.removeShutdownHook(Runtime.java:220)
... 9 more
让人很烦。
在调用完后,用ProxoolFacade.shutdown(0);语句关闭,可以解决、上面错误就会消失,但如果紧结着继续调用线程池(同一个函数中),就会报其他错误,没有注册之类的错误。
查了一下,有如下解决办法,
1、是改用日志jar包,网络上有这种实践者。
2、个人比较推崇,用新版本的jar包(如proxool-0.9.0RC2.jar),这种问题迎刃而解,这个是Proxool Bug问题。