Tomcat启动时报错 struts2错误

Gmonday 2013-11-26 09:10:34

十一月 26, 2013 9:04:41 上午 org.apache.catalina.core.StandardContext filterStart
SEVERE: Exception starting filter struts2
java.lang.NullPointerException
at com.opensymphony.xwork2.spring.SpringObjectFactory.getClassInstance(SpringObjectFactory.java:203)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.verifyResultType(XmlConfigurationProvider.java:511)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addResultTypes(XmlConfigurationProvider.java:482)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage(XmlConfigurationProvider.java:438)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadPackages(XmlConfigurationProvider.java:265)
at org.apache.struts2.config.StrutsXmlConfigurationProvider.loadPackages(StrutsXmlConfigurationProvider.java:111)
at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:189)
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:55)
at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:360)
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:403)
at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:69)
at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:48)
at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:278)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:259)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:383)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:104)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4650)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5306)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1114)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1673)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
十一月 26, 2013 9:04:41 上午 org.apache.catalina.core.StandardContext startInternal
SEVERE: Error filterStart
十一月 26, 2013 9:04:41 上午 org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/CExamSysSSH] startup failed due to previous errors
十一月 26, 2013 9:04:41 上午 org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
SEVERE: The web application [/CExamSysSSH] created a ThreadLocal with key of type [com.opensymphony.xwork2.inject.ContainerImpl$10] (value [com.opensymphony.xwork2.inject.ContainerImpl$10@c0c534]) and a value of type [java.lang.Object[]] (value [[Ljava.lang.Object;@1d30257]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
十一月 26, 2013 9:04:41 上午 org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
SEVERE: The web application [/CExamSysSSH] created a ThreadLocal with key of type [com.opensymphony.xwork2.inject.ContainerImpl$10] (value [com.opensymphony.xwork2.inject.ContainerImpl$10@3eae13]) and a value of type [java.lang.Object[]] (value [[Ljava.lang.Object;@1168da1]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
十一月 26, 2013 9:04:41 上午 org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
SEVERE: The web application [/CExamSysSSH] created a ThreadLocal with key of type [com.sun.faces.util.Util$1] (value [com.sun.faces.util.Util$1@1ac5c27]) and a value of type [java.util.HashMap] (value [{com.sun.faces.patternCache={ = }}]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
十一月 26, 2013 9:04:41 上午 org.apache.catalina.startup.HostConfig deployDirectory
...全文
192 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
ekekyn 2013-11-26
  • 打赏
  • 举报
回复
引用 7 楼 Gmonday 的回复:
[quote=引用 6 楼 fudongrifdr 的回复:] 你的项目里是不是有struts2-spring-plugin这个jar包?
根本没有啊 我上传了jar包的截图 在上面[/quote] +1
末日哥 2013-11-26
  • 打赏
  • 举报
回复
应该是多引入的jar的原因,删除一些不必要的包,想你antlr.jar就导入了2次
Gmonday 2013-11-26
  • 打赏
  • 举报
回复
引用 6 楼 fudongrifdr 的回复:
你的项目里是不是有struts2-spring-plugin这个jar包?
根本没有啊 我上传了jar包的截图 在上面
末日哥 2013-11-26
  • 打赏
  • 举报
回复
你的项目里是不是有struts2-spring-plugin这个jar包?
Gmonday 2013-11-26
  • 打赏
  • 举报
回复
引用 1 楼 fudongrifdr 的回复:
检查一下你的配置哪儿有问题

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" 
	xmlns="http://java.sun.com/xml/ns/javaee" 
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
	xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
	http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
  <display-name></display-name>	
  <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
  </welcome-file-list>
  <filter>
  	<filter-name>struts2</filter-name>
  	<filter-class>
  		org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
  	</filter-class>
  </filter>
  <filter-mapping>
  	<filter-name>struts2</filter-name>
  	<url-pattern>/*</url-pattern>
  </filter-mapping></web-app>


<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.1//EN" "http://struts.apache.org/dtds/struts-2.1.dtd">
<struts>
	<constant name="struts.i18n.encoding" value="gb2312"></constant>
	<package name="struts2" extends="struts-default">
		<action name="login" class="com.mon.action.LoginAction">
			<result name="studentSuccess" type="chain">getRandomSubject</result>
 			<result name="teacherSuccess" type="redirect">/teacher/index.html</result>
 			<result name="INPUT">/index.jsp</result>
		</action>
		<action name="getRandomSubject" class="com.mon.action.GetRandomSubjectAction">
			<result name="SUCCESS">/student/main.jsp</result>
		</action>
	</package>
</struts>    

Defonds 2013-11-26
  • 打赏
  • 举报
回复
web.xml 里加入
<listener>
	<listener-class>
		org.springframework.web.context.ContextLoaderListener
	</listener-class>
</listener>
试试
Gmonday 2013-11-26
  • 打赏
  • 举报
回复
引用 2 楼 u012480848 的回复:
SpringObjectFactory

与spring整合出错了

根本没有用到spring

爪哇三郎 2013-11-26
  • 打赏
  • 举报
回复
SpringObjectFactory
与spring整合出错了
末日哥 2013-11-26
  • 打赏
  • 举报
回复
检查一下你的配置哪儿有问题

81,092

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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