java.lang.RuntimeException: Can not create instance of class: demo.DemoConfig. Please check the config in web.xml at com.jfinal.core.JFinalFilter.createJFinalConfig(JFinalFilter.java:104) at com.jfinal.core.JFinalFilter.init(JFinalFilter.java:47) 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.start(JFinal.java:159) at demo.DemoConfig.main(DemoConfig.java:33)
如果确实都对,再检查一下 default output folder 以及 class path 下是否编译出来了 DemoConfig.class 文件