本机运行正常,部署到服务器后出现以下错误!请指教,谢谢

这是日志打印的java.lang.NoSuchMethodError:

11-Sep-2017 14:49:00.304 SEVERE [localhost-startStop-1] org.apache.catalina.core.StandardContext.filterStart Exception starting filter [jfinal]

 java.lang.NoSuchMethodError: com.demo.common.DemoConfig.getPropertyToBoolean(Ljava/lang/String;Z)Ljava/lang/Boolean;

at com.demo.common.DemoConfig.configConstant(DemoConfig.java:60)

at com.jfinal.core.Config.configJFinal(Config.java:46)

at com.jfinal.core.JFinal.init(JFinal.java:67)

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

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:4590)

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

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

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

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

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)


评论区

zhhua89

2017-09-11 15:14

11-Sep-2017 14:49:00.304 SEVERE [localhost-startStop-1] org.apache.catalina.core.StandardContext.startInternal One or more Filters failed to start. Full details will be found in the appropriate container log file
11-Sep-2017 14:49:00.304 SEVERE [localhost-startStop-1] org.apache.catalina.core.StandardContext.startInternal Context [] startup failed due to previous errors
11-Sep-2017 14:49:00.317 WARNING [localhost-startStop-1] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [ROOT] appears to have started a thread named [Timer-0] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
java.util.TimerThread.mainLoop(Timer.java:534)
java.util.TimerThread.run(Timer.java:505)

happyboy

2017-09-11 16:40

服务器上你的tomcat以及jdk跟你本地的版本一致吗?

zhhua89

2017-09-11 21:04

@happyboy 你好,我的版本信息如下:
本机操作系统 win10 64位
java veriosn: 1.8.0_60
tomcat version:8.5.16

阿里云
OS : centOS 7.3.1611 64位
java veriosn: 1.8.0_144
tomcat version:8.5.20

ruan

2017-09-12 11:17

配置文件的编码格式检查一下。

zhhua89

2017-09-13 22:00

@happyboy 问题解决了!原来是版本问题!!
我是用MyEclipse2014开发的,发现myEclipse2014开发工具上的JDK最高的支持版本只能到JDK1.7。
然后我将JDK换成1.7,tomcat8也换成tomcat7,就可以了!
之前没有发现是版本问题,因为我的本机系统(Win10)部署的就是JDK1.8 及 TOMCAT8,运行jfinal项目并没有任何问题!!所以我在阿里云部署的也是相同的版本,导致我花了很多时间查找问题!!但是为什么我的本机1.8却可以?

happyboy

2017-09-14 17:13