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

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

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)

2012-8-29 10:30:28 org.apache.catalina.core.StandardContext start

严重: Error filterStart

2012-8-29 10:30:28 org.apache.catalina.core.StandardContext start

严重: Context [/auditapp] startup failed due to previous errors

2012-8-29 10:30:28 org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc

严重: The web application [/auditapp] registered the JDBC driver [com.microsoft.sqlserver.jdbc.SQLServerDriver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.

------Solutions------

目测是因为楼主的spring encodingFilter 配置有问题。

<filter>
<filter-name>encodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>encodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

------Solutions------

应该是jar包冲突了 检查下程序下的lib包的jar和tomcat自己目录下是否有重复的jar包,删除掉一个低版本的就可以了

时间: 2024-11-07 14:49:58

tomcat启动时候报错java.lang.ClassCastException的相关文章

Tomcat 启动项目报错 java.lang.OutOfMemoryError: Java heap space

近日使用myeclipse 部署web项目,启动tomcat时报错: SEVERE: Error waiting for multi-thread deployment of directories to completehostConfig.deployWar=Deploying web application archive {0} java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: Java heap s

tomcat7 启动项目报错 java.lang.NoSuchMethodError: javax.servlet.ServletContext.getSessionCookieConfig()

JDK版本:jdk1.8.0_77 Tomcat 版本:apache-tomcat-7.0.47 异常重现步骤: 1.完成项目部署 2.启动Tomcat 异常头部信息:java.lang.NoSuchMethodError: javax.servlet.ServletContext.getSessionCookieConfig() 解决方案: 把apache-tomcat-7.0.47/lib/servlet-api.jar 拷贝到$JAVA_HOME/jre/lib/ext目录下去 参考博文:

[报错]java.lang.ClassCastException

Caused by: java.lang.ClassCastException: org.apache.xml.dtm.ref.DTMManagerDefault cannot be cast to org.apache.xml.dtm.DTMManager Error while adding the mapper 'interface com.a.b.c' to configuration. 原因:org.apache.xalan_2.7.1.v201005080400.jar, xalan

tomcat项目启动报错java.lang.ClassCastException: org.apache.xerces.parsers.XML11Configuration……

周一上班启动项目,报错如图: 看到网上说的原因,有jar包冲突造成的,我这里的是: 情况:console打印信息有多次连接数据库,但该项目只需要连接一个库.再仔细看,发现有其他项目的信息,打开tomcat,发现webapps下果然有其他项目. 分析:早上来的时候,直接关闭了很多项目,但这些项目还在tomcat下部署,并没有删除,所以造成启动时产生一系列的bug. 解决:在tomcat的webapps下删除其他项目.重新部署正在使用的项目,重启,OK. 所以,有多个项目的时候,操作的时候要注意一些

自定义 UsernamePasswordToken 报错 java.lang.ClassCastException: org.apache.shiro.authc.UsernamePasswordToken cannot be cast to

UsernamePasswordToken 转型时 出现了异常 代码如下 没有地方使用我们的自己扩展的CustomerUsernamePasswordToken类,只是转型而已,并没有去实例化它,这才是引起问题的根源,问题发现了要如何解决它呢?我们在配置的使用并并未制定表单过滤器,此时默认使用的是FormAuthenticationFilter,而Token默认使用的也是UsernamePasswordToken,由此看来,我们扩展的CustomerUsernamePasswordToken就成

DRP问题集结(一)-Tomcat无法启动,报错java.lang.NoClassDefFoundError: org/apache/juli/logging/LogFactory

问题一:  Tomcat无法启动,报错java.lang.NoClassDefFoundError: org/apache/juli/logging/LogFactory 问题二:[Error]JavaWeb: 严重: Failed to initialize end point associated with ProtocolHandler ["http-bio-8080"] 问题三:The APR based Apache Tomcat Native library which a

maven web 项目中启动报错java.lang.ClassNotFoundException: org.springframework.web.util.Log4jConfigListener

本篇文章主要介绍了"maven web 项目中启动报错java.lang.ClassNotFoundException: org.springframework.web.util.Log4jConfigListener ",主要涉及到maven web 项目中启动报错java.lang.ClassNotFoundException: org.springframework.web.util.Log4jConfigListener 方面的内容,对于maven web 项目中启动报错jav

&lt;&lt;&lt; tomcat启动是报错StandardServer.await: create[8005]

启动tomcat的时候出现异常 ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 严重: StandardServer.await: create[8005]: java.net.BindException: Address already in use: JVM_Bind         at java.net.PlainSocketImpl.socketBind(Native Method) at java.net.PlainSocketImpl.bind(Plai

tomcat启动时候报错Can&#39;t convert argument: null

一.启动报错: 为了避免导入的项目重名,我先修改了前一个项目的名称. 重新启动该项目至tomcat,报错:java.lang.IllegalArgumentException: Cant convert argum...... 一.启动报错:为了避免导入的项目重名,我先修改了前一个项目的名称.重新启动该项目至tomcat,报错:java.lang.IllegalArgumentException: Can't convert argument: null二.发现问题:因为MyEclipse在修改