国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開APP
userphoto
未登錄

開通VIP,暢享免費電子書等14項超值服

開通VIP
Proxool連接池在reload web容器時出現(xiàn)HouseKeeper的空指針異常 -...

使用Proxool連接池, 當在重啟Tomcat容器時,出現(xiàn)

 

   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

 

 

解決方法如下:

 

    1. 在Servlet的destroy()方法中顯式地proxool關(guān)閉連接池:ProxoolFacade.shutdown();

 

Java代碼
  1. public class ProxoolServlet extends HttpServlet {    
  2.     public void init() throws ServletException {    
  3.     }    
  4.   
  5.     public void destroy() {    
  6.         ProxoolFacade.shutdown();    
  7.     }    
  8.   
  9.     public void doPost(HttpServletRequest request, HttpServletResponse response) throws    
  10.         ServletException, IOException {    
  11.         doGet(request,response);    
  12.     }    
  13.     public void doGet(HttpServletRequest request, HttpServletResponse response) throws    
  14.         ServletException, IOException {    
  15.            
  16.     }    
  17.   
  18. }   

 

   2. 將該Servlet配置到web.xml中:

 

Java代碼
  1. <servlet>    
  2.   <servlet-name>proxoolServlet </servlet-name>    
  3.   <servlet-class>xxx.ProxoolServlet</servlet-class>    
  4.   <load-on-startup>1</load-on-startup>    
  5. </servlet>   

 

    3. OK

本站僅提供存儲服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點擊舉報。
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
什么是servlet 收藏
Java Servlet實現(xiàn)的三種方式
Tomcat源碼分析之 doGet方法(一)
Servlet基本用法(一)基本配置
Servlet入門
Servlet 生命周期
更多類似文章 >>
生活服務(wù)
分享 收藏 導長圖 關(guān)注 下載文章
綁定賬號成功
后續(xù)可登錄賬號暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點擊這里聯(lián)系客服!

聯(lián)系客服