警告: FAILED org.eclipse.jetty.server.Server@13deb50e: java.lang.RuntimeException: Can not create instance of class: com.mult._config._Rurality_DreamConfig. Please check the config in web.xml
java.lang.RuntimeException: Can not create instance of class: com.mult._config._Rurality_DreamConfig. Please check the config in web.xml
at com.jfinal.core.JFinalFilter.createJFinalConfig(JFinalFilter.java:109)
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.JettyServerForIDEA.doStart(JettyServerForIDEA.java:133)
at com.jfinal.server.JettyServerForIDEA.start(JettyServerForIDEA.java:72)
at com.jfinal.core.JFinal.start(JFinal.java:174)
at com.mult._config._Rurality_DreamConfig.main(_Rurality_DreamConfig.java:146)
今天将项目从eclipse导入到idea时 项目启动报了如上的错误,debug启动 下面代码发现 configClass是有获取到class文件路径的 但是运行到下一步时 temp依然是null 最后导致项目启动失败 不知道这种情况到底是什么原因造成的,希望能得到前辈们的指点
try {
temp = Class.forName(configClass).newInstance();
} catch (Exception var4) {
throw new RuntimeException("Can not create instance of class: " + configClass, var4);
}
if (temp instanceof JFinalConfig) {
this.jfinalConfig = (JFinalConfig)temp;
} else {
throw new RuntimeException("Can not create instance of class: " + configClass + ". Please check the config in web.xml");
}
如果按上面的提示无法解决,需要配置一下 Default output folder,配置方法看 jfinal 文档的截图:
http://www.jfinal.com/doc