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

发布于 2021-12-03 15:01:54 字数 6778 浏览 900 评论 2

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

沦落红尘 2021-12-09 05:40:13

谢谢 升级了maven里面的jetty插件,可以使用了

画骨成沙 2021-12-09 00:20:13

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文