项目启动时 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解压缩编码格式问题什么的,感 ...
随机推荐
- 51nod 1225 余数之和 数论
1225 余数之和 题目连接: http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1225 Description F(n) ...
- Eclipse寻找JVM(JRE)的顺序机制
http://developer.51cto.com/art/200907/135271.htm Eclipse也是一个普通的Java程序,因此必须有一个JRE做为运行环境.本文将简单谈谈Eclips ...
- directio mysql 编绎选项
http://www.myexception.cn/linux-unix/495407.html http://www.iyunv.com/thread-25950-1-1.html
- 《UNIX环境高级编程》笔记--errno是否是线程安全的?
当UNIX函数出错时,常常返回一个负数,而且整形变量errno通常被设置为含有附加信息的一个值,例如,open函数如成功,返回 一个非负文件描述符,如果出错就返回-1,在open出错时,有大约15种不 ...
- Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例 本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显示出来,该例子也会涉及到Android加载大图片时候的处理 ...
- jq设置样式
单个样式: $(this).css("color","red"); 多个样式: $(this).css({color:"red",backg ...
- Basic Messager
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...
- java生成自己定义的表ID
需生成例如以下ID: 56d7ade1-87d1-4f54-8dc8-13611c8c2545 27181ad4-4214-4e12-af3a-911a0103a12f 24cafdfb-eac3-4 ...
- [转]MySQL Explain
Mysql Explain 详解 一.语法 explain < table_name > 例如: explain select * from t3 where id=3952602; 二. ...
- php 验证身份证号码
身份证号码的结构 身份证号码是特征组合码,由17位数字本体码和一位校验码组成. 排列顺序从左至右依此为:六位数字地址码,八位数字出生日期码,三位数字顺序码和一位数字校验码. 地址码(前六位数) 表示编 ...