当前位置: 代码迷 >> J2ME >> 错误如下:严重: Exception starting filter struts2Filter
  详细解决方案

错误如下:严重: Exception starting filter struts2Filter

热度:8245   发布时间:2013-02-25 21:34:19.0
高手请进,整合SSH框架struts2Filter报错,
错误如下:严重: Exception starting filter struts2Filter
Unable to load bean: type:com.opensymphony.xwork2.util.ValueStackFactory class:com.opensymphony.xwork2.ognl.OgnlValueStackFactory - bean - jar:file:/D:/apache-tomcat-6.0.32/webapps/ssh/WEB-INF/lib/struts2-core-2.2.1.jar!/struts-default.xml:71:140
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:428)
at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:69)
at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter.init(StrutsPrepareFilter.java:50)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:506)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: Unable to load bean: type:com.opensymphony.xwork2.util.ValueStackFactory class:com.opensymphony.xwork2.ognl.OgnlValueStackFactory - bean - jar:file:/D:/apache-tomcat-6.0.32/webapps/ssh/WEB-INF/lib/struts2-core-2.2.1.jar!/struts-default.xml:71:140
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:208)
at org.apache.struts2.config.StrutsXmlConfigurationProvider.register(StrutsXmlConfigurationProvider.java:101)
at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reload(DefaultConfiguration.java:131)
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:52)
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:415)
... 29 more
Caused by: java.lang.IncompatibleClassChangeError: Implementing class
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at com.opensymphony.xwork2.util.ClassLoaderUtil.loadClass(ClassLoaderUtil.java:139)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:180)
... 34 more
2011-9-18 6:41:01 org.apache.catalina.core.StandardContext start
严重: Error filterStart

web.xml:
  <filter>
  <filter-name>struts2Filter</filter-name>
  <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter</filter-class>
 </filter>
 <filter-mapping>
  <filter-name>struts2Filter</filter-name>
  <url-pattern>/*</url-pattern
 </filter-mapping> 

struts.xml
<?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.convention.result.path" value="/WEB-INF/jsp/" />
</struts>

请各位指点!!!

------解决方案--------------------------------------------------------
如果你要分开配置struts2的filter,必须得配这两个。如下:
XML code
<filter>        <filter-name>struts2PrepareFilter</filter-name>        <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter</filter-class>    </filter>    <filter>        <filter-name>struts2</filter-name>        <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsExecuteFilter</filter-class>    </filter>
------解决方案--------------------------------------------------------
  相关解决方案