当前位置: 代码迷 >> Java Web开发 >> tomcat启动时分报错java.lang.ClassCastException
  详细解决方案

tomcat启动时分报错java.lang.ClassCastException

热度:8602   发布时间:2013-02-25 21:10:29.0
tomcat启动时候报错java.lang.ClassCastException
tomcat启动时候报错如下,各位指点指点


2012-8-29 10:30:28 org.apache.catalina.core.StandardContext filterStart
严重: Exception starting filter encodingFilter
java.lang.ClassCastException: org.springframework.web.filter.CharacterEncodingFilter cannot be cast to javax.servlet.Filter
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:275)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:422)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:115)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4038)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4692)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:637)
at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:563)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:498)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1061)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
at org.apache.catalina.core.StandardService.start(StandardService.java:525)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:701)
at org.apache.catalina.startup.Catalina.start(Catalina.java:585)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
10:30:28,307 DEBUG StandardServletEnvironment:104 - Adding [systemEnvironment] PropertySource with lowest search precedence
10:30:28,307 DEBUG StandardServletEnvironment:120 - Initialized StandardServletEnvironment with PropertySources [servletConfigInitParams,servletContextInitParams,jndiProperties,systemProperties,systemEnvironment]
10:30:28,338 DEBUG StandardServletEnvironment:114 - Initializing new StandardServletEnvironment
10:30:28,338 DEBUG StandardServletEnvironment:104 - Adding [servletConfigInitParams] PropertySource with lowest search precedence
10:30:28,338 DEBUG StandardServletEnvironment:104 - Adding [servletContextInitParams] PropertySource with lowest search precedence
10:30:28,354 DEBUG StandardServletEnvironment:104 - Adding [jndiProperties] PropertySource with lowest search precedence
10:30:28,354 DEBUG StandardServletEnvironment:104 - Adding [systemProperties] PropertySource with lowest search precedence
10:30:28,354 DEBUG StandardServletEnvironment:104 - Adding [systemEnvironment] PropertySource with lowest search precedence
10:30:28,354 DEBUG StandardServletEnvironment:120 - Initialized StandardServletEnvironment with PropertySources [servletConfigInitParams,servletContextInitParams,jndiProperties,systemProperties,systemEnvironment]
2012-8-29 10:30:28 org.apache.catalina.core.StandardContext filterStart
严重: Exception starting filter hibernateOpenSessionInViewFilter
java.lang.ClassCastException: org.springframework.orm.hibernate4.support.OpenSessionInViewFilter cannot be cast to javax.servlet.Filter
  相关解决方案