启动抛错,发现不了问题,求解决

Vity 发布于 2014/01/14 14:28
阅读 4K+
收藏 0

@JFinal 你好,想跟你请教个问题:启动异常,抛如下信息:

Starting JFinal 1.5
Starting scanner at interval of 5 seconds.
Starting web server on port: 801
2014-01-14 14:28:24,099  WARN org.eclipse.jetty.util.component.AbstractLifeCycle:(AbstractLifeCycle.java:204) 
 - FAILED jfinal: java.lang.RuntimeException: Can not create instance of class: com.mvity.eip.core.config.CoreConfig. Please check the config in web.xml
java.lang.RuntimeException: Can not create instance of class: com.mvity.eip.core.config.CoreConfig. Please check the config in web.xml
at com.jfinal.core.JFinalFilter.createJFinalConfig(JFinalFilter.java:100)
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:165)
at com.mvity.eip.core.config.CoreConfig.main(CoreConfig.java:116)
2014-01-14 14:28:24,112  WARN org.eclipse.jetty.webapp.WebAppContext:(WebAppContext.java:501) 
 - Failed startup of context o.e.j.w.WebAppContext{/,file:/E:/lixn/workspace-eclipse/eip/WebContent/}
java.lang.RuntimeException: Can not create instance of class: com.mvity.eip.core.config.CoreConfig. Please check the config in web.xml
at com.jfinal.core.JFinalFilter.createJFinalConfig(JFinalFilter.java:100)
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:165)
at com.mvity.eip.core.config.CoreConfig.main(CoreConfig.java:116)
Starting Complete. Welcome To The JFinal World :)



CoreConfig.java 如下


public class CoreConfig extends JFinalConfig {


@Override
public void configConstant(Constants me) {


this.loadPropertyFile("constants.properties");


me.setDevMode(Boolean.valueOf(this.getProperty("app.devMode")));
me.setViewType(ViewType.JSP);


}


@Override
public void configRoute(Routes me) {
// 添加 运营管理平台路由配置
me.add(new BompRoutes());


// 添加 网站路由配置
me.add(new WebRoutes());


// 添加 企业基础管理平台路由配置
me.add(new EbmpRoutes());
}


@Override
public void configPlugin(Plugins me) {
this.loadPropertyFile("plugin.properties");


DruidPlugin druidPlugin = new DruidPlugin(this.getProperty("db.jdbcUrl"), this.getProperty("db.username"), this.getProperty("db.password"));


druidPlugin.addFilter(new StatFilter());


WallFilter wallFilter = new WallFilter();
wallFilter.setDbType("mysql");


druidPlugin.addFilter(wallFilter);


me.add(druidPlugin);


ActiveRecordPlugin arp = new ActiveRecordPlugin(druidPlugin);


me.add(arp);


/* BOMP Model */
// arp.addMapping("bomp_admin", Admin.class);
// arp.addMapping("bomp_component", Component.class);
// arp.addMapping("bomp_notice", Notice.class);
// arp.addMapping("bomp_permission", Permission.class);
// arp.addMapping("bomp_tenant", Tenant.class);
// arp.addMapping("bomp_dictionary_type", DictionaryType.class);
// arp.addMapping("bomp_dictionary_value", DictionaryValue.class);
// arp.addMapping("bomp_config", Config.class);
// arp.addMapping("bomp_area", Area.class);
// arp.addMapping("bomp_resources", Resources.class);


/* EBMP Model */
}


@Override
public void configInterceptor(Interceptors me) {


}


@Override
public void configHandler(Handlers me) {
DruidStatViewHandler dvh = new DruidStatViewHandler("/druid");
me.add(dvh);


}


/**
* 建议使用 JFinal 手册推荐的方式启动项目 运行此 main
* 方法可以启动项目,此main方法可以放置在任意的Class类定义中,不一定要放于此
*/
public static void main(String[] args) {
JFinal.start("WebContent", 801, "/", 5);
}
}


web.xml 如下

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
<display-name>eip</display-name>


<filter>
<filter-name>jfinal</filter-name>
<filter-class>com.jfinal.core.JFinalFilter</filter-class>
<init-param>
<param-name>configClass</param-name>
<param-value>com.mvity.eip.core.config.CoreConfig</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>jfinal</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>


<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
</web-app>

加载中
1
Vity
Vity

引用来自“RobertCool”的答案

com.mvity.eip.core.config.CoreConfig
检查类的全名是否写错?
代码看起来没错,应该是Web.xml中配置错误。
建项目的时候忘记修改 classes 输出路径了
0
RobertCool
RobertCool
com.mvity.eip.core.config.CoreConfig
检查类的全名是否写错?
代码看起来没错,应该是Web.xml中配置错误。
返回顶部
顶部