严重: Servlet /mp threw load() exception
javax.servlet.UnavailableException
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:368)
at javax.servlet.GenericServlet.init(GenericServlet.java:212)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1161)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:981)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4042)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4348)
at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1105)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1203)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:293)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)
at java.lang.Thread.run(Unknown Source)
10 个解决方案
#1
很有可能是classpATHpath问题,我说的是项目的classPath 。包的那个。 或者少包。
#2
能说的具体些吗?项目中引入了Hibernate3.2和structs1.2。是不是包有冲突呢?
#4
能说的具体些吗?项目中引入了Hibernate3.2和structs1.2。是不是包有冲突呢?
#5
可能情况很多:
用resin3.*以上版本跑struts1.2的程序时,启动会出现javax.servlet.UnavailableException at org.apache.struts.action.ActionServlet.init(ActionServlet.java:368)异常
问题出在struts1.2中的commons-digester.jar包,将struts1.1中的commons-digester.jar包替换struts1.2中的包就可以解决这问题了。
用resin3.*以上版本跑struts1.2的程序时,启动会出现javax.servlet.UnavailableException at org.apache.struts.action.ActionServlet.init(ActionServlet.java:368)异常
问题出在struts1.2中的commons-digester.jar包,将struts1.1中的commons-digester.jar包替换struts1.2中的包就可以解决这问题了。
#6
在Myeclipse下同样的另外的项目没有问题
#7
你的struts和web配置文件正确么?ActionServlet设置为load-on-startup了么?
#8
不是跟引入Hibernate和structs的顺序有关吧?
#9
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.4" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<!-- 字符过滤器 -->
<filter>
<filter-name>SetCharacterEncoding</filter-name>
<filter-class>com.tmp.filter.ChangeCharsetFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
</filter>
<!-- hibernate过滤器 -->
<filter>
<filter-name>hibernate</filter-name>
<filter-class>com.tmp.filter.HibernateFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>SetCharacterEncoding</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>hibernate</filter-name>
<url-pattern>*.do</url-pattern>
</filter-mapping>
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>3</param-value>
</init-param>
<init-param>
<param-name>detail</param-name>
<param-value>3</param-value>
</init-param>
<load-on-startup>0</load-on-startup>
</servlet>
<servlet>
<description>This is the description of my J2EE component</description>
<display-name>This is the display name of my J2EE component</display-name>
<servlet-name>dyList</servlet-name>
<servlet-class>com.tmp.Servlet.dyList</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>dyList</servlet-name>
<url-pattern>/dyList</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>login/login.jsp</welcome-file>
</welcome-file-list>
</web-app>
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.4" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<!-- 字符过滤器 -->
<filter>
<filter-name>SetCharacterEncoding</filter-name>
<filter-class>com.tmp.filter.ChangeCharsetFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
</filter>
<!-- hibernate过滤器 -->
<filter>
<filter-name>hibernate</filter-name>
<filter-class>com.tmp.filter.HibernateFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>SetCharacterEncoding</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>hibernate</filter-name>
<url-pattern>*.do</url-pattern>
</filter-mapping>
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>3</param-value>
</init-param>
<init-param>
<param-name>detail</param-name>
<param-value>3</param-value>
</init-param>
<load-on-startup>0</load-on-startup>
</servlet>
<servlet>
<description>This is the description of my J2EE component</description>
<display-name>This is the display name of my J2EE component</display-name>
<servlet-name>dyList</servlet-name>
<servlet-class>com.tmp.Servlet.dyList</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>dyList</servlet-name>
<url-pattern>/dyList</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>login/login.jsp</welcome-file>
</welcome-file-list>
</web-app>
#10
高手显身啊!
#1
很有可能是classpATHpath问题,我说的是项目的classPath 。包的那个。 或者少包。
#2
能说的具体些吗?项目中引入了Hibernate3.2和structs1.2。是不是包有冲突呢?
#3
#4
能说的具体些吗?项目中引入了Hibernate3.2和structs1.2。是不是包有冲突呢?
#5
可能情况很多:
用resin3.*以上版本跑struts1.2的程序时,启动会出现javax.servlet.UnavailableException at org.apache.struts.action.ActionServlet.init(ActionServlet.java:368)异常
问题出在struts1.2中的commons-digester.jar包,将struts1.1中的commons-digester.jar包替换struts1.2中的包就可以解决这问题了。
用resin3.*以上版本跑struts1.2的程序时,启动会出现javax.servlet.UnavailableException at org.apache.struts.action.ActionServlet.init(ActionServlet.java:368)异常
问题出在struts1.2中的commons-digester.jar包,将struts1.1中的commons-digester.jar包替换struts1.2中的包就可以解决这问题了。
#6
在Myeclipse下同样的另外的项目没有问题
#7
你的struts和web配置文件正确么?ActionServlet设置为load-on-startup了么?
#8
不是跟引入Hibernate和structs的顺序有关吧?
#9
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.4" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<!-- 字符过滤器 -->
<filter>
<filter-name>SetCharacterEncoding</filter-name>
<filter-class>com.tmp.filter.ChangeCharsetFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
</filter>
<!-- hibernate过滤器 -->
<filter>
<filter-name>hibernate</filter-name>
<filter-class>com.tmp.filter.HibernateFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>SetCharacterEncoding</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>hibernate</filter-name>
<url-pattern>*.do</url-pattern>
</filter-mapping>
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>3</param-value>
</init-param>
<init-param>
<param-name>detail</param-name>
<param-value>3</param-value>
</init-param>
<load-on-startup>0</load-on-startup>
</servlet>
<servlet>
<description>This is the description of my J2EE component</description>
<display-name>This is the display name of my J2EE component</display-name>
<servlet-name>dyList</servlet-name>
<servlet-class>com.tmp.Servlet.dyList</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>dyList</servlet-name>
<url-pattern>/dyList</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>login/login.jsp</welcome-file>
</welcome-file-list>
</web-app>
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.4" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<!-- 字符过滤器 -->
<filter>
<filter-name>SetCharacterEncoding</filter-name>
<filter-class>com.tmp.filter.ChangeCharsetFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
</filter>
<!-- hibernate过滤器 -->
<filter>
<filter-name>hibernate</filter-name>
<filter-class>com.tmp.filter.HibernateFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>SetCharacterEncoding</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>hibernate</filter-name>
<url-pattern>*.do</url-pattern>
</filter-mapping>
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>3</param-value>
</init-param>
<init-param>
<param-name>detail</param-name>
<param-value>3</param-value>
</init-param>
<load-on-startup>0</load-on-startup>
</servlet>
<servlet>
<description>This is the description of my J2EE component</description>
<display-name>This is the display name of my J2EE component</display-name>
<servlet-name>dyList</servlet-name>
<servlet-class>com.tmp.Servlet.dyList</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>dyList</servlet-name>
<url-pattern>/dyList</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>login/login.jsp</welcome-file>
</welcome-file-list>
</web-app>
#10
高手显身啊!