问题描述
web.xml如下<?xmlversion="1.0"encoding="UTF-8"?><web-appxmlns="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/j2eehttp://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"><filter><filter-name>SetCharacterEncoding</filter-name><filter-class>org.com.info.SetCharacterEncodingFilter</filter-class><init-param><param-name>encoding</param-name><param-value>GB2312</param-value></init-param></filter><filter-mapping><filter-name>SetCharacterEncoding</filter-name><url-pattern>/*</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-mapping><servlet-name>action</servlet-name><url-pattern>*.do</url-pattern></servlet-mapping><listener><listener-class>org.springframework.web.context.ContextLoaderListener</listener-class></listener><context-param><param-name>contextConfigLocation</param-name><param-value>WEB-INF/applicationContext.xml</param-value></context-param><filter><filter-name>OpenSessionInViewFilter</filter-name><filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class></filter><filter-mapping><filter-name>OpenSessionInViewFilter</filter-name><url-pattern>/*</url-pattern></filter-mapping></web-app>启动报错17:54:00,744ERROR[Engine]StandardContext[/SSH]ExceptionstartingfilterOpenSessionInViewFilterjava.lang.NoSuchFieldError:MANUALatorg.springframework.orm.hibernate3.support.OpenSessionInViewFilter.<init>(OpenSessionInViewFilter.java:102)atsun.reflect.NativeConstructorAccessorImpl.newInstance0(NativeMethod)atsun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)atsun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)atjava.lang.reflect.Constructor.newInstance(Constructor.java:494)atjava.lang.Class.newInstance0(Class.java:350)atjava.lang.Class.newInstance(Class.java:303)
解决方案
解决方案二:
把这句话<filter><filter-name>OpenSessionInViewFilter</filter-name><filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class></filter><filter-mapping><filter-name>OpenSessionInViewFilter</filter-name><url-pattern>/*</url-pattern></filter-mapping>
拿到<filter><filter-name>SetCharacterEncoding</filter-name><filter-class>org.com.info.SetCharacterEncodingFilter</filter-class><init-param><param-name>encoding</param-name><param-value>GB2312</param-value></init-param></filter><filter-mapping><filter-name>SetCharacterEncoding</filter-name><url-pattern>/*</url-pattern></filter-mapping>
后边试试
解决方案三:
谢谢,还是不行
解决方案四:
没有合适的字段NoSuchFieldError