开发者社区> 问答> 正文

正常的项目突然跑不动了?报错

@JFinal 你好,想跟你请教个问题:

我一正常的项目,今天准备打开改一东西,但突然启动不了,报错如下:

2015-11-23 11:07:38.668:WARN:oejuc.AbstractLifeCycle:FAILED jfinal: java.lang.NoSuchMethodError: com.commin.Config.getPropertyToBoolean(Ljava/lang/String;Z)Ljava/lang/Boolean;
java.lang.NoSuchMethodError: com.commin.Config.getPropertyToBoolean(Ljava/lang/String;Z)Ljava/lang/Boolean;
at com.commin.Config.configConstant(Config.java:39)
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.eclipse.jetty.servlet.FilterHolder.doStart(FilterHolder.java:119)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:724)
at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:265)
at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:706)
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:492)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)
at org.eclipse.jetty.server.Server.doStart(Server.java:277)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at com.jfinal.server.JettyServer.doStart(JettyServer.java:120)
at com.jfinal.server.JettyServer.start(JettyServer.java:64)
at com.jfinal.core.JFinal.main(JFinal.java:181)
2015-11-23 11:07:38.669:WARN:oejuc.AbstractLifeCycle:FAILED o.e.j.w.WebAppContext{/,file:/E:/webapps/zfjd/WebRoot/}: java.lang.NoSuchMethodError: com.commin.Config.getPropertyToBoolean(Ljava/lang/String;Z)Ljava/lang/Boolean;
java.lang.NoSuchMethodError: com.commin.Config.getPropertyToBoolean(Ljava/lang/String;Z)Ljava/lang/Boolean;
at com.commin.Config.configConstant(Config.java:39)
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.eclipse.jetty.servlet.FilterHolder.doStart(FilterHolder.java:119)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:724)
at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:265)
at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:706)
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:492)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)
at org.eclipse.jetty.server.Server.doStart(Server.java:277)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at com.jfinal.server.JettyServer.doStart(JettyServer.java:120)
at com.jfinal.server.JettyServer.start(JettyServer.java:64)
at com.jfinal.core.JFinal.main(JFinal.java:181)
2015-11-23 11:07:38.669:WARN:oejuc.AbstractLifeCycle:FAILED org.eclipse.jetty.server.Server@edb4fa2: java.lang.NoSuchMethodError: com.commin.Config.getPropertyToBoolean(Ljava/lang/String;Z)Ljava/lang/Boolean;
java.lang.NoSuchMethodError: com.commin.Config.getPropertyToBoolean(Ljava/lang/String;Z)Ljava/lang/Boolean;
at com.commin.Config.configConstant(Config.java:39)
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.eclipse.jetty.servlet.FilterHolder.doStart(FilterHolder.java:119)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:724)
at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:265)
at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:706)
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:492)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)
at org.eclipse.jetty.server.Server.doStart(Server.java:277)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at com.jfinal.server.JettyServer.doStart(JettyServer.java:120)
at com.jfinal.server.JettyServer.start(JettyServer.java:64)
at com.jfinal.core.JFinal.main(JFinal.java:181)
Exception in thread "main" java.lang.NoSuchMethodError: com.commin.Config.getPropertyToBoolean(Ljava/lang/String;Z)Ljava/lang/Boolean;
at com.commin.Config.configConstant(Config.java:39)
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.eclipse.jetty.servlet.FilterHolder.doStart(FilterHolder.java:119)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:724)
at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:265)
at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:706)
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:492)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)
at org.eclipse.jetty.server.Server.doStart(Server.java:277)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at com.jfinal.server.JettyServer.doStart(JettyServer.java:120)
at com.jfinal.server.JettyServer.start(JettyServer.java:64)
at com.jfinal.core.JFinal.main(JFinal.java:181)

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

    解决了,不知道怎么回事,自己少了一个包

       jfinal1.8之后的版本JFinalConfig.getPropertyToBoolean方法的第二个参数由boolean改为了包装类型Boolean,在升级jfinal后需要重新编译一下项目。

      因为项目依赖于jar编译而成的class文件,里面有关方法签名、参数类型等信息编译后是固定的,而 primitive类型与包装类型会被认为是不同的方法签名,从而报出<spanstyle="font-family:'MicrosoftYaHei',Verdana,sans-serif,宋体;font-size:14px;line-height:22px;background-color:#FFFFFF;">NoSuchMethodError,这是由jdk决定的。

      最后,staticfinal常量会被编译成内联值,当项目所依赖的第三方staticfinal常量值发生变化时,如果不重新编译项目源码会引起bug。所以总的来说建议在升级第三方jar包时重新编译一下项目,尤其是升级重度使用的jar包时。

    就是,有时候文件明明在,就说找不到类。

    1、重启服务就OK;

    2、删除classes中的所有类文件,然后重新部署就可以。

    2020-06-10 10:50:08
    赞同 展开评论 打赏
问答地址:
问答排行榜
最热
最新

相关电子书

更多
前端自动化测试 立即下载
低代码开发师(初级)实战教程 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载