开发者社区> 问答> 正文

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

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

展开
收起
爱吃鱼的程序员 2020-06-07 22:24:51 868 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

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

    谢谢升级了maven里面的jetty插件,可以使用了
    2020-06-07 22:25:07
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
Apache Tomcat 的云原生演进 立即下载
低代码开发师(初级)实战教程 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载

相关镜像