如何解决以下报错的问题(Exception in thread "HouseKeeper"),谢谢

fireflyleon 2008-07-08 04:48:54
信息: Reloading this Context has started
Exception in thread "HouseKeeper" java.lang.NullPointerException
at org.logicalcobwebs.proxool.HouseKeeperController.getHouseKeeperToRun(HouseKeeperController.java:52)
at org.logicalcobwebs.proxool.HouseKeeperThread.run(HouseKeeperThread.java:33)
...全文
8516 15 打赏 收藏 转发到动态 举报
写回复
用AI写文章
15 条回复
切换为时间正序
请发表友善的回复…
发表回复
dopleo 2012-09-05
  • 打赏
  • 举报
回复
哥啊,你这是因为高版本的spring用的不是close方法了,是destory方法
liuyyuns 2011-08-01
  • 打赏
  • 举报
回复
[Quote=引用 13 楼 liuyyuns 的回复:]
我的也报这个错
Caused by: org.hibernate.exception.GenericJDBCException: Cannot open connectionException in thread "HouseKeeper" java.lang.NullPointerException
[/Quote]
我的问题解决了,原因是我的数据库没有启动监听,启动服务的时候就报错了。
现在把监听起来之后再启动服务就好了。
liuyyuns 2011-08-01
  • 打赏
  • 举报
回复
我的也报这个错
Caused by: org.hibernate.exception.GenericJDBCException: Cannot open connectionException in thread "HouseKeeper" java.lang.NullPointerException
ning5566 2011-06-13
  • 打赏
  • 举报
回复
没有解决 我也是这个错误
map612 2011-06-01
  • 打赏
  • 举报
回复
6楼确实正解,下面是解决方法。ps:摘自他处
Exception in thread "HouseKeeper" java.lang.NullPointerException2011-04-26 08:52虽然这个错误不影响项目,但是项目中的 class 类一改动 就无法自动启动起来了。因为这个错误导致的。很是麻烦!

解决方法:(次方法也是来源于网络中,我只是再次分享。或者把零散的整合在一起说了)

首先建立一个servlet类:

package cn.ydc.framework.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();
}

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 中加入:

<!-- for resolving HouseKeeper bug-->
<servlet>
<servlet-name>loadServlet</servlet-name>
<servlet-class>cn.ydc.framework.util.HouseKeeperServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>


eton_liu 2011-01-25
  • 打赏
  • 举报
回复
[Quote=引用 6 楼 jizhfang 的回复:]
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 serv……
[/Quote]


正解!只是英文不好,研究了很久,哈哈哈
fishlovly 2009-07-15
  • 打赏
  • 举报
回复
6楼正解~~~~~~
mylovedeye 2009-03-25
  • 打赏
  • 举报
回复
我用的是tomcat5与proxool-0.8.jar
后来我改用proxool-0.9.jar就不会报这个错了,可能是版本的不兼容吧~
jizhfang 2008-09-01
  • 打赏
  • 举报
回复
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
wu209000 2008-09-01
  • 打赏
  • 举报
回复
看看你的HouseKeeper是不是没有new就使用的
chu_566 2008-07-14
  • 打赏
  • 举报
回复
不会搞哟!郁闷
reality 2008-07-08
  • 打赏
  • 举报
回复
java.lang.NullPointerException
你的HouseKeeper线程的程序出错了,看看哪里在null的时候被强制使用了
vstian 2008-07-08
  • 打赏
  • 举报
回复
java.lang.NullPointerException

空指针异常

67,513

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧