项目启动时 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
中文翻译如下:

解决方法:
package com.zang.util; import java.io.IOException; import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import org.logicalcobwebs.proxool.ProxoolFacade; /*
* 此类用来处理 在class类进行修改的时候 保存了之后服务自动重新启动 报:
* 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
*/
public class HouseKeeperServlet extends HttpServlet {
private static final long serialVersionUID = 4829418704873725291L; public void destroy() {
//此处添加处理
ProxoolFacade.shutdown(0);
} public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
doGet(request, response);
} public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException { }
}
在web.xml中加入
<servlet>
<servlet-name>loadServlet</servlet-name>
<servlet-class>com.zang.util.HouseKeeperServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
项目启动时 Exception in thread "HouseKeeper" java.lang.NullPointerException的更多相关文章
- web 环境项目(intellj部署的tomcat) 重启时报 Exception in thread "HouseKeeper" java.lang.NullPointerException (转)
Exception in thread "HouseKeeper" java.lang.NullPointerException at org.logicalcobwebs.pro ...
- GUI学习中错误Exception in thread "main" java.lang.NullPointerException
运行时出现错误:Exception in thread "main" java.lang.NullPointerException 该问题多半是由于用到的某个对象只进行了声明,而没 ...
- java使用类数组 报错Exception in thread "main" java.lang.NullPointerException
源代码如下: Point[] points=new Point[n];//Point是一个类 for(int i=0;i<n;i++) { System.out.print("请输入x ...
- Exception in thread "main" java.lang.NullPointerException
1.在window操作系统上,使用eclipse开发工具从hdfs分布式文件系统上下载文件报空指针异常解决方法: log4j:WARN No appenders could be found for ...
- 给内部类对象数组属性赋值时报错:Exception in thread "main" java.lang.NullPointerException
前言 1255: 打怪升级(Java),写这个题目程序的时候,控制台提示如下错误: Exception in thread "main" java.lang.NullPointer ...
- JAVA错误:Exception in thread "main" java.lang.NullPointerException
JAVA错误:Exception in thread "main" java.lang.NullPointerException例如: Exception in thread &q ...
- xml出现Exception in thread "main" java.lang.NullPointerException
运行代码出现Exception in thread "main" java.lang.NullPointerException 可以看下这个链接:https://ask.csdn. ...
- hive 启动不成功,报错:hive 启动报 Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/hadoop/mapred/MRVersi
1. 现象:在任意位置输入 hive,准备启动 hive 时,报错: Exception in thread "main" java.lang.NoClassDefFoundErr ...
- windows上react-native run-android时Exception in thread "main" java.lang.IllegalArgumentException: MALFORMED报错
报错如图 解决 在C:\Users\{用户名}\.gradle\wrapper\dists路径下,删除所有文件夹,重新run-android ps:网上搜了说是说是java解压缩编码格式问题什么的,感 ...
随机推荐
- bzoj 3172: [Tjoi2013]单词 AC自动机
3172: [Tjoi2013]单词 Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://www.lydsy.com/JudgeOnline/pr ...
- hdu 4114 Disney's FastPass 状压dp
Disney's FastPass Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.ph ...
- hihocoder 162周 1323 : 回文字符串
hihocoder1323 : 回文字符串(162周) 题目链接 思路: dp; ac代码: #include<iostream> #include<cstdio> #incl ...
- iOS 反反注入 修改__RESTRICT,__restrict工具
通过在 Xcode 里的 Other Linker Flags 设置参数,可以防止App被注入dylib(仅限于iOS 10 以下系统) 比如,某艺,XX音乐等 dylib无法注入,也就意味着没办法 ...
- 【转】Internet连接正常但是没有网络,禁用以太网以后再重新启动就可以使用了,原因是什么?
只是粘贴别人的答案,觉得有理,就放在博客里方便以后再学习~ 这个和网络中hdcp服务有关,网卡要在网路中通讯就必须要网络设备一般是路由器或者交换机分配地址,只有给了你电脑门牌号,信件投递能准确无误.你 ...
- 开源Word读写组件DocX介绍与入门
来源:http://i.cnblogs.com/EditPosts.aspx?opt=1 读写Offic格式的文档,大家多少都有用到,可能方法也很多,组件有很多.这里不去讨论其他方法的优劣,只是向大家 ...
- 安装sql2012 正在启动操作系统功能"NetFx3"
安装完windows8 后开始安装sql2012,安装过程中停在“正在启动操作系统功能"NetFx3"”不动了,很是着急,于是上网查了一下资料,原来NetFx3指的是Framewo ...
- Google Chrome 39.0.2171.71 正式发布
Google Chrome,又称Google浏览器,是一个由Google(谷歌)公司开发的网页浏览器.该浏览器是基于其他开源软件所撰写,包括WebKit,目标是提升稳定性.速度和安全性,并创造出简单且 ...
- Go:Hello World!
备注 结束了一周紧张的工作,周末像品茶一样玩味一下Go,本文主要记录学习Go的经历. Go是什么? 官方网站:http://golang.org/. 在Windows下安装Go 官方教程:http:/ ...
- Android 获得view的宽和高
转自:http://blog.csdn.net/yangdeli888/article/details/25405263 在oncreate()中利用view.getWidth()或是view.get ...