tomcat7-maven-plugin启动Jfinal项目报错

qwzh110 发布于 2017/12/02 10:28
阅读 285
收藏 0

tomcat7-maven-plugin启动Jfinal项目报错,具体报错内容如下:

严重: Exception starting filter DruidWebStatFilter
java.lang.ClassCastException: com.alibaba.druid.support.http.WebStatFilter cannot be cast to javax.servlet.Filter
	at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:260)
	at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:107)
	at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4775)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5452)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

十二月 02, 2017 10:24:24 上午 org.apache.catalina.core.StandardContext filterStart
严重: Exception starting filter CORS
java.lang.ClassCastException: com.thetransactioncompany.cors.CORSFilter cannot be cast to javax.servlet.Filter
	at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:260)
	at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:107)
	at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4775)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5452)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

十二月 02, 2017 10:24:24 上午 org.apache.catalina.core.StandardContext filterStart
严重: Exception starting filter shiro
java.lang.ClassCastException: org.apache.shiro.web.servlet.ShiroFilter cannot be cast to javax.servlet.Filter
	at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:260)
	at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:107)
	at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4775)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5452)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

十二月 02, 2017 10:24:24 上午 org.apache.catalina.core.StandardContext filterStart
严重: Exception starting filter jfinal
java.lang.ClassCastException: com.jfinal.core.JFinalFilter cannot be cast to javax.servlet.Filter
	at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:260)
	at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:107)
	at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4775)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5452)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

十二月 02, 2017 10:24:24 上午 org.apache.catalina.core.StandardContext startInternal
严重: Error filterStart
十二月 02, 2017 10:24:24 上午 org.apache.catalina.core.StandardContext startInternal
严重: Context [/bkcell_web] startup failed due to previous errors
十二月 02, 2017 10:24:24 上午 org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
严重: The web application [/bkcell_web] registered the JDBC driver [com.alibaba.druid.proxy.DruidDriver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
十二月 02, 2017 10:24:24 上午 org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
严重: The web application [/bkcell_web] registered the JDBC driver [com.alibaba.druid.mock.MockDriver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
十二月 02, 2017 10:24:24 上午 org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
严重: The web application [/bkcell_web] registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
十二月 02, 2017 10:24:24 上午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/bkcell_web] appears to have started a thread named [Abandoned connection cleanup thread] but has failed to stop it. This is very likely to create a memory leak.
十二月 02, 2017 10:24:24 上午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["http-bio-8080"]

tomcat7-plugin的配置如下

<plugin>
                <groupId>org.apache.tomcat.maven</groupId>
                <artifactId>tomcat7-maven-plugin</artifactId>
                <version>2.2</version>
            </plugin>

servlet-api的maven也写了scope了

        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <version>2.5</version>
            <scope>provided</scope>
        </dependency>

使用的开发工具是idea,启动还会报错,请问这是什么原因呢?

 

项目开发要用到websocket,不能再jetty里面运行。之前开发用jetty做服务器,发布用tomcat

加载中
0
JFinal
JFinal

全是类型转换错误,如果类型确实没错,关注一下是不是类加载器不同引发的。 此外 jetty 也支持 websocket,不用 jfinal 整合的方式启动就好

qwzh110
qwzh110
谢谢 升级了maven里面的jetty插件,可以使用了
返回顶部
顶部