严重: Servlet.service() for servlet RegisterServlet threw exception
java.lang.ClassNotFoundException: org.apache.commons.collections.FastHashMap
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1358)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
at org.apache.commons.beanutils.PropertyUtilsBean.getPropertyDescriptor(PropertyUtilsBean.java:959)
at org.apache.commons.beanutils.PropertyUtilsBean.isWriteable(PropertyUtilsBean.java:1466)
at org.apache.commons.beanutils.BeanUtilsBean.copyProperties(BeanUtilsBean.java:277)
at org.apache.commons.beanutils.BeanUtils.copyProperties(BeanUtils.java:135)
at servlet.RegisterServlet.doPost(RegisterServlet.java:64)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at filter.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:31)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)
--------------------------------------------------------------------------------------------------------
root cause
java.lang.NoClassDefFoundError: org/apache/commons/collections/FastHashMap
org.apache.commons.beanutils.PropertyUtilsBean.getPropertyDescriptor(PropertyUtilsBean.java:959)
org.apache.commons.beanutils.PropertyUtilsBean.isWriteable(PropertyUtilsBean.java:1466)
org.apache.commons.beanutils.BeanUtilsBean.copyProperties(BeanUtilsBean.java:277)
org.apache.commons.beanutils.BeanUtils.copyProperties(BeanUtils.java:135)
servlet.RegisterServlet.doPost(RegisterServlet.java:64)
javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
filter.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:31)
root cause
java.lang.ClassNotFoundException: org.apache.commons.collections.FastHashMap
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1358)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204)
java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
org.apache.commons.beanutils.PropertyUtilsBean.getPropertyDescriptor(PropertyUtilsBean.java:959)
org.apache.commons.beanutils.PropertyUtilsBean.isWriteable(PropertyUtilsBean.java:1466)
org.apache.commons.beanutils.BeanUtilsBean.copyProperties(BeanUtilsBean.java:277)
org.apache.commons.beanutils.BeanUtils.copyProperties(BeanUtils.java:135)
servlet.RegisterServlet.doPost(RegisterServlet.java:64)
javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
filter.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:31)
--------------------------------------------------------------------------------------------------------
解决方法:往工程加入commons-collections-3.2.jar包,如下图所示:
--转自
该贴由koei123转至本版2015-7-14 11:08:53