根据官方文档的eclipse下开发一步一步走过来却报错了...


在DemoConfig.java类中,报如下错误

The type DemoConfig must implement the inherited abstract method JFinalConfig.configEngine(Engine)

Engine cannot be resolved to a type














运行Tomcat后报如下错误


严重: Exception starting filter [jfinal]

java.lang.Error: Unresolved compilation problem: 

The type DemoConfig must implement the inherited abstract method JFinalConfig.configEngine(Engine)


at demo.DemoConfig.configEngine(DemoConfig.java:3)

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

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

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

at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:277)

at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:258)

at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:104)

at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4475)

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

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

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

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

at java.util.concurrent.FutureTask.run(Unknown Source)

at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)

at java.util.concurrent.AbstractExecutorService.submit(Unknown Source)

at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:943)

at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:839)

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

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

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

at java.util.concurrent.FutureTask.run(Unknown Source)

at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)

at java.util.concurrent.AbstractExecutorService.submit(Unknown Source)

at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:943)

at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:258)

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

at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)

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

at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:770)

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

at org.apache.catalina.startup.Catalina.start(Catalina.java:682)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:350)

at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:492)


评论区

JFinal

2018-07-23 16:59

异常已经很清楚了:
The type DemoConfig must implement the inherited abstract method JFinalConfig.configEngine(Engine)

u_ui

2018-08-20 15:43

import com.jfinal.template.Engine;

public class DemoConfig extends JFinalConfig{

@Override
public void configConstant(Constants me) {
// TODO Auto-generated method stub

}

@Override
public void configRoute(Routes me) {
// TODO Auto-generated method stub

}

@Override
public void configEngine(Engine me) {
// TODO Auto-generated method stub

}

@Override
public void configPlugin(Plugins me) {
// TODO Auto-generated method stub

}

@Override
public void configInterceptor(Interceptors me) {
// TODO Auto-generated method stub

}

@Override
public void configHandler(Handlers me) {
// TODO Auto-generated method stub

}

}

热门反馈

扫码入社