Proxool报错Exception in Thread "HouseKeeper" java.lang.NullPointerException

问题:
当tomcat里的项目设置成reload=true时,Proxool报错Exception in Thread "HouseKeeper" java.lang.NullPointerException ;
原因:
This is because Proxool is not being shutdown properly. If the JVM stops then Proxool recognises that and shuts down gracefully, but if you redeploy Proxool into some environments (for example, a servlet container) then Proxool needs to be explicitly told so by calling ProxoolFacade.shutdown(). If you have a servlet container then you could put it in the servlet's destroy() method. Alternatively, use the ServletConfigurator to both configure and shutdown Proxool
解决办法:
在tomcat容器销毁时,将proxool连接池关闭。
在Servlet的destroy()方法中显式地proxool关闭连接池:
ProxoolFacade.shutdown();
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章