JFinal在UndertowServer下开发部署到tomcat该怎么搞

打包成war然后部署在tomcat的时候报错

错误信息如下

严重: Exception starting filter [jfinal]

java.lang.RuntimeException: Can not create instance of class: com.demo.common.DemoConfig

at com.jfinal.core.JFinalFilter.createJFinalConfig(JFinalFilter.java:116)

at com.jfinal.core.JFinalFilter.init(JFinalFilter.java:59)

at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:285)

at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:266)

at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:108)

at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4657)

at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5304)

at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)

at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1423)

at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1413)

at java.util.concurrent.FutureTask.run(Unknown Source)

at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

Caused by: java.lang.ClassNotFoundException: com.demo.common.DemoConfig

at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1344)

at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1172)

at java.lang.Class.forName0(Native Method)

at java.lang.Class.forName(Unknown Source)

at com.jfinal.core.JFinalFilter.createJFinalConfig(JFinalFilter.java:114)

... 13 more


一月 25, 2019 3:18:57 下午 org.apache.catalina.core.StandardContext startInternal

严重: One or more Filters failed to start. Full details will be found in the appropriate container log file

一月 25, 2019 3:18:57 下午 org.apache.catalina.core.StandardContext startInternal

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


评论区

JFinal

2019-01-25 15:32

web.xml 中要配置好,然后去掉 undertow 依赖,pom.xml 中的打包类型由 jar 改为 war 。再导出 war 包即可

白云君

2019-01-25 15:48

@JFinal 好吧 谢谢大佬 然后启动方式也要改回jfinal.start么?

JFinal

2019-01-25 16:14

王子鹏

2019-02-13 18:05

@JFinal undertow 依赖不去掉不会有影响吧 我试了一下不去掉也可以正常使用 我想保留下 切换回undertow 方便点

JFinal

2019-02-13 18:29

@王子鹏 起码要去掉 undertow 带过来的 servlet 的 jar 包,否则与 tomcat 部署时有重复,版本不同就会冲突

王子鹏

2019-02-14 10:40

@JFinal 了解 谢谢!

eaglebetter

2019-07-19 17:41

ideal 本地跑tomcat运行不起来,报错Error:(3, 34) java: 程序包com.jfinal.server.undertow不存在

热门反馈

扫码入社