struts2运行时出错 求大神指导

PeiwoDaoYiHouZuo 2013-03-05 10:10:49
我只是创建了一个最简单的struts2项目,启动tomcat服务器时报错,如下:
严重: Dispatcher initialization failed
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at com.opensymphony.xwork2.inject.ContainerImpl$MethodInjector.inject(ContainerImpl.java:301)

严重: Exception starting filter struts2
java.lang.reflect.InvocationTargetException - Class: com.opensymphony.xwork2.inject.ContainerImpl$MethodInjector
File: ContainerImpl.java
Method: inject
Line: 301 - com/opensymphony/xwork2/inject/ContainerImpl.java:301:-1
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:483)

严重: Error filterStart
2013-3-5 10:04:10 org.apache.catalina.core.StandardContext start
严重: Context [/testStruts2.0_2] startup failed due to previous errors
2013-3-5 10:04:10 org.apache.coyote.http11.Http11Protocol start
...全文
119 17 打赏 收藏 转发到动态 举报
写回复
用AI写文章
17 条回复
切换为时间正序
请发表友善的回复…
发表回复
求知路漫漫 2013-03-05
  • 打赏
  • 举报
回复
改成FilterDispatcher之后前面的错误是没了,但是报这种错了 严重: Exception starting filter struts2 Unable to load bean: type:com.opensymphony.xwork2.ObjectFactory class:org.apache.struts2.spring.StrutsSpringObjectFactory - bean - jar:file:/E:/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/testStruts2.0_2/WEB-INF/lib/[color=#FF0000]struts2-spring-plugin-2.0.11.2.jar!/struts-plugin.xml:30:132[/color] at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:208) at org.apache.struts2.config.StrutsXmlConfigurationProvider.register(StrutsXmlConfigurationProvider.java:101)
lvzg_005 2013-03-05
  • 打赏
  • 举报
回复
http://struts.apache.org/download.cgi#struts238 下载一个全的struts包。尽量带jar包的。要不就要使用maven管理这些jar依赖了 或者在googlecode上下例子 http://code.google.com/p/struts2-examples/downloads/list 简单的,负载的,ant格式的,maven格式的都有,先下个简单的看看吧
求知路漫漫 2013-03-05
  • 打赏
  • 举报
回复
那改成StrutsPrepareAndExecuteFilter这个呢
PeiwoDaoYiHouZuo 2013-03-05
  • 打赏
  • 举报
回复
好了,问题解决了,是多了个JAR包,那个struts-spring-plugin。。
lvzg_005 2013-03-05
  • 打赏
  • 举报
回复
javassist-xxx.ga.jar 你的还少很多jar包呢
PeiwoDaoYiHouZuo 2013-03-05
  • 打赏
  • 举报
回复
引用 10 楼 qiang0322 的回复:
struts2的web.xml改成 <filter> <filter-name>struts2</filter-name> <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class> </filter> 试试 或 org.apache.……
改成FilterDispatcher之后前面的错误是没了,但是报这种错了 严重: Exception starting filter struts2 Unable to load bean: type:com.opensymphony.xwork2.ObjectFactory class:org.apache.struts2.spring.StrutsSpringObjectFactory - bean - jar:file:/E:/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/testStruts2.0_2/WEB-INF/lib/struts2-spring-plugin-2.0.11.2.jar!/struts-plugin.xml:30:132 at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:208) at org.apache.struts2.config.StrutsXmlConfigurationProvider.register(StrutsXmlConfigurationProvider.java:101)
PeiwoDaoYiHouZuo 2013-03-05
  • 打赏
  • 举报
回复
引用 9 楼 lvzg_005 的回复:
jar截图发来看下

求知路漫漫 2013-03-05
  • 打赏
  • 举报
回复
struts2的web.xml改成 <filter> <filter-name>struts2</filter-name> <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class> </filter> 试试 或 org.apache.struts2.dispatcher.FilterDispatcher
lvzg_005 2013-03-05
  • 打赏
  • 举报
回复
jar截图发来看下
PeiwoDaoYiHouZuo 2013-03-05
  • 打赏
  • 举报
回复
引用 6 楼 wangqiangapple 的回复:
尝试 注释下 web.xml 里边过滤器的配置 再clean下 project 重新deploy 。 run 试试!
注释之后还是报一样的错,难道我这配置根本就没用上?
PeiwoDaoYiHouZuo 2013-03-05
  • 打赏
  • 举报
回复
引用 1 楼 lvzg_005 的回复:
严重缺少jar

我凌乱了 xuhx@allhigh.com.cn
嘿-先生 2013-03-05
  • 打赏
  • 举报
回复
尝试 注释下 web.xml 里边过滤器的配置 再clean下 project 重新deploy 。 run 试试!
PeiwoDaoYiHouZuo 2013-03-05
  • 打赏
  • 举报
回复
引用 1 楼 lvzg_005 的回复:
严重缺少jar
打错了 多打了个点 xuhx.allhigh.com.cn
PeiwoDaoYiHouZuo 2013-03-05
  • 打赏
  • 举报
回复
引用 2 楼 qiang0322 的回复:
看一个下你的web.xml配置
<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5"> <display-name>testStruts2.0_2</display-name> <filter> <filter-name>struts2</filter-name> <filter-class>org.apache.struts2.dispatcher.Dispatcher</filter-class> </filter> <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> </web-app>
PeiwoDaoYiHouZuo 2013-03-05
  • 打赏
  • 举报
回复
引用 1 楼 lvzg_005 的回复:
严重缺少jar
我邮箱 xuhx@.allhigh.com.cn 把需要额度jar包发给我一下好么,如果是这原因,100分都给你了 谢谢
求知路漫漫 2013-03-05
  • 打赏
  • 举报
回复
看一个下你的web.xml配置
lvzg_005 2013-03-05
  • 打赏
  • 举报
回复
严重缺少jar

67,513

社区成员

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

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