我只是创建了一个最简单的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 startstrutstomcatfilterexceptionjava
严重: 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 startstrutstomcatfilterexceptionjava
解决方案 »
- jpa实现一对多的时候在同一张表中 怎么弄的?
- 将图片路径存入数据库------求助
- hibernater处理复杂sql
- commons-fileupload 上传文件失败,搞不清什么状况
- java 基本知识
- Struts+Spring的dispatchaction问题
- 初始使用WEBLOGIC在TOMCAT下可以运行的WAR在WEBLOGIC下报错,帮我看下到底是说明错
- 很简单的xml部署问题,我菜
- 如何插入/更新oracle的long型字段。
- java新手,请问java中有没有类似于msdn之类的帮助文档!!
- struts2+ajaxSubmit上传文件在IE9中不兼容
- 地理信息系统开发要用什么技术
把需要额度jar包发给我一下好么,如果是这原因,100分都给你了
谢谢
<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>
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
试试
或
org.apache.struts2.dispatcher.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)
你的还少很多jar包呢
下载一个全的struts包。尽量带jar包的。要不就要使用maven管理这些jar依赖了或者在googlecode上下例子
http://code.google.com/p/struts2-examples/downloads/list
简单的,负载的,ant格式的,maven格式的都有,先下个简单的看看吧
严重: 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)