Jfianl maven项目 在这里竟然出错了 问题会在哪里呢

package controller;

import com.jfinal.core.Controller;
import com.jfinal.kit.PathKit;

public class Crud extends Controller {

    public void savefile(){
        System.out.println("savefile");
        getRequest().getContextPath();
        System.out.println(getRequest().getContextPath());
        render(PathKit.getWebRootPath() +"/view.html");
        
    }
}
savefile
/YunBiJi
五月 04, 2016 7:42:46 下午 com.jfinal.core.ActionHandler error
严重: /savefile
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
    at com.jfinal.aop.Invocation.invoke(Invocation.java:87)
    at com.jfinal.core.ActionHandler.handle(ActionHandler.java:82)
    at com.jfinal.core.JFinalFilter.doFilter(JFinalFilter.java:72)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:603)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at com.jfinal.aop.Invocation.invoke(Invocation.java:73)
    ... 18 more
Caused by: java.lang.NoClassDefFoundError: freemarker/template/TemplateException
    at com.jfinal.render.RenderFactory$FreeMarkerRenderFactory.getRender(RenderFactory.java:285)
    at com.jfinal.render.RenderFactory.getRender(RenderFactory.java:170)
    at com.jfinal.core.Controller.render(Controller.java:968)
    at controller.Crud.savefile(Crud.java:12)
    ... 23 more
Caused by: java.lang.ClassNotFoundException: freemarker.template.TemplateException
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1702)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1547)
    ... 27 more


Corbie亚东
浏览 6042回答 2
2回答

qq_莫逆23

楼主解决了吗?我也遇到了这个问题

SilenceViking

创建项目的时候,是不是把runtime勾上了?去掉试试
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Java
JQuery