[HTTP:101216]Servlet: “JMS Servlet” failed to preload on startup in Web application问题

  • Post author:
  • Post category:其他


解决方法一:

1. 修改<load-on-startup>的值为负数。

<load-on-startup>的意思是:如果其值为负整数或干脆没有在web.xml中提供该元素,则表示该servlet可以在任意时刻载入;如果为0或正整数,表示必须在项目部署之初即进行载入和初始化。(另外还有定义载入优先级别的用途。)

If the value is a negative integer, or the element is not present, the container is free to load the servlet whenever it chooses.  If the value is a positive integer or 0, the container must load and initialize the servlet as the application is deployed.

方法二:

1. web.xml或struts-config.xml文件的version原因。

格式应该与所使用的jar package版本一致。比如:

<!DOCTYPE web-app PUBLIC “-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN” “http://java.sun.com/dtd/web-app_2_3.dtd”> 这里的2_3不能不一致成2_4;

<!DOCTYPE struts-config PUBLIC

“-//Apache Software Foundation//DTD Struts Configuration 1.1//EN” “http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd”> 1_1不能是1_2;

2. 还有一种是jar package没有放对位置,打包后应该全部在wen-inf/lib下面有

3. 我再一次仔细看了出错信息error stack,并找来了ActionServlet类的源码(下载struts-all包),根据错误信息中提供的行数,不一会发现是系统中在载入hibernate.cfg.xml时出现问题,于是干脆重新覆盖。接着build,deploy,OK,问题解决。