在初次学习使用JFinal框架建立web项目时遇到问题

十一月 02, 2017 1:11:24 下午 com.jfinal.core.ActionHandler error

严重: /blog

java.lang.NoClassDefFoundError: javax/servlet/jsp/jstl/core/LoopTag

at java.lang.ClassLoader.defineClass1(Native Method)

at java.lang.ClassLoader.defineClass(ClassLoader.java:800)

at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)

at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)

at java.net.URLClassLoader.access$100(URLClassLoader.java:71)

at java.net.URLClassLoader$1.run(URLClassLoader.java:361)

at java.net.URLClassLoader$1.run(URLClassLoader.java:355)

at java.security.AccessController.doPrivileged(Native Method)

at java.net.URLClassLoader.findClass(URLClassLoader.java:354)

at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:421)

at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:383)

at org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1421)

at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1675)

at org.apache.jasper.compiler.Parser.parse(Parser.java:185)

at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:244)

at org.apache.jasper.compiler.ParserController.parse(ParserController.java:145)

at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:212)

at org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)

at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:625)

at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)

at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:492)

at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:378)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)

at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:669)

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

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

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

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.Dispatcher.forward(Dispatcher.java:276)

at org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:103)

at com.jfinal.render.JspRender.render(JspRender.java:67)

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

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

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(Thread.java:745)

Caused by: java.lang.ClassNotFoundException: javax.servlet.jsp.jstl.core.LoopTag

at java.net.URLClassLoader$1.run(URLClassLoader.java:366)

at java.net.URLClassLoader$1.run(URLClassLoader.java:355)

at java.security.AccessController.doPrivileged(Native Method)

at java.net.URLClassLoader.findClass(URLClassLoader.java:354)

at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:421)

at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:383)

... 61 more

我在index.jsp中使用JSTL核心库时出现这样的报错,但是我已经导入了taglibs-standard-compat-1.2.5.jar和jstl-impl-1.2.jar并添加到了buildPath.

我在传统Java Web 项目中也是这样用的,并没有任何异常.

希望各位大神帮忙解决一下这个问题.

评论区

JFinal

2017-11-02 15:26

在首页右侧下载那个叫 jfinal-3.2-all.zip 的文件,里面有一个 JSTL_for_JSP 的目录,用上里面的两个 jar包,问题立即解决

NoClassDefFoundError 与 ClassNotFound 不同,前者通常是 jar 包版本不对,但 class 确实找到了

tm_wmh

2017-11-04 18:47

@JFinal 谢谢您,这个问题的确是我引用的库出了问题,重新换了jar包后已经可以了!

热门分享

扫码入社