项目启动时 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解压缩编码格式问题什么的,感 ...
随机推荐
- Linux知识(2)----中文输入法安装
Ubantu14.04在English的环境下,没有中文输入法,自带的ibus不完整.现在基于ibus框架,有几个比较好用的输入法,如sunpingyin和google pinying,还有五笔的输入 ...
- HDU 4681 String(2013多校8 1006题 DP)
String Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)Total Subm ...
- [转]对Why Scrum will never work的评论
近来,Maurits的一篇博文“Why Scrum will never work” 一石激起千层浪.著名技术分享网站酷壳(http://coolshell.cn/articles/5044.html ...
- 前端必备工具-Sublime Text 2
一个好的编辑器,能够大大地提高工作效率,editplus.notepad++都是不错的工具,体积小,启动速度快,想比之下Dreamweaver就太臃肿了,今天初使用Sublime Text 这个软件, ...
- jdbcTemplate异常:like模糊查询报错(Parameter index out of range (1 > number of parameters)
http://cuisuqiang.iteye.com/blog/1480525 模糊查询like要这样写 注意Object参数和like语法 public static void main( ...
- chromium的安装程序
转自:http://www.xue163.com/182/6/1822338.html#pinglun 这篇文章主要简单讲解chromium的安装程序mini_installer 在编译mini_in ...
- SharePoint 入门书籍推荐
最近,总有人说刚入门SharePoint,没有好的资料或者电子书,资料推荐大家多看看博客园和CSDN的博客.对于看博客,我一般是两个思路,要么找一个人的从头到尾看一遍,觉得有意义的,就把地址加收藏:或 ...
- HTML:链接标签的使用
介绍: 链接分为两种: 第一种:链接到本网页其他位置 例如:从网页顶部链接到底部 <a href="#somewhere">link</a> <p i ...
- FatSecret Platform API
在现阶段饮食类的APP发展的非常迅猛,尤其在校园中,学生只需要凭借一个手机就能买到自己想要的食物,真正做到了足不出户.可是如果我们想独立完成一个app就需要有相应的数据支持,这里给大家介绍一个国外的开 ...
- html5.js 让所有IE支持HTML5
摘自: http://hi.baidu.com/skway/item/33f38a9487356b4ff14215cf?qq-pf-to=pcqq.c2c html5.js 让所有IE支持HTML5 ...