加入me.setViewType(ViewType.JSP);出错

jar已经引入

blob.png

错误如下:

 /

java.lang.RuntimeException: java.lang.reflect.InvocationTargetException

at com.jfinal.aop.Invocation.invoke(Invocation.java:87)

at com.jfinal.core.ActionHandler.handle(ActionHandler.java:83)

at com.jfinal.core.JFinalFilter.doFilter(JFinalFilter.java:73)

at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1307)

at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:453)

at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)

at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:560)

at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)

at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1072)

at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:382)

at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)

at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1006)

at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)

at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)

at org.eclipse.jetty.server.Server.handle(Server.java:365)

at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:485)

at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:926)

at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:988)

at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:635)

at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)

at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)

at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:628)

at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)

at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)

at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)

at java.lang.Thread.run(Unknown Source)

Caused by: java.lang.reflect.InvocationTargetException

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 com.jfinal.aop.Invocation.invoke(Invocation.java:73)

... 25 more

Caused by: java.lang.NoClassDefFoundError: com/jfinal/plugin/activerecord/ModelRecordElResolver

at com.jfinal.render.JspRender.<clinit>(JspRender.java:41)

at com.jfinal.render.RenderFactory$JspRenderFactory.getRender(RenderFactory.java:205)

at com.jfinal.render.RenderFactory.getRender(RenderFactory.java:67)

at com.jfinal.core.Controller.render(Controller.java:1004)

at controller.HelloController.index(HelloController.java:8)

... 30 more

Caused by: java.lang.ClassNotFoundException: com.jfinal.plugin.activerecord.ModelRecordElResolver

at com.jfinal.server.JFinalClassLoader.loadClass(JFinalClassLoader.java:56)

... 35 more


找不到的这些类,在jar包中都是有的,删掉me.setViewType(ViewType.JSP);后不报错,返回html页面也可以正常。返回jsp报错

评论区

lyh061619

2018-01-25 11:32

你把El表达式的jar包引入。http://mvnrepository.com/artifact/javax.el

MEZHU

2018-01-25 15:21

@lyh061619 导入ei后,再导入jetty需要的jsp支持包,再将整个jdk导入后,成功运行。感谢

lyh061619

2018-01-25 16:03

@MEZHU 哈哈,解决了就好了。

热门分享

扫码入社