eclipse 使用 JSTL 在更改时导致 deferredExpression 错误
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7837576/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Using JSTL causes deferredExpression error on change
提问by Lumpy
I recently removed all scriptlets on my project as advised by this post. But now, if I try and make a change to one of my views, I get a deferredExpression error. To get rid of the error, I simply have to terminate, then restart the project.
我最近按照这篇文章的建议删除了我项目中的所有 scriptlet 。但是现在,如果我尝试更改我的一个视图,则会收到 deferredExpression 错误。为了摆脱错误,我只需要终止,然后重新启动项目。
What is going on here? Is eclipse not able to compile jstl on the fly? Is there something I can change so I don't have to redeploy every time I make a change?
这里发生了什么?eclipse 不能即时编译 jstl 吗?有什么我可以改变的,这样我就不必每次做出改变时都重新部署吗?
Stack Trace
堆栈跟踪
java.lang.NoSuchFieldError: deferredExpression
at org.apache.taglibs.standard.tag.common.core.ForEachSupport.release(ForEachSupport.java:212)
at org.apache.jasper.runtime.TagHandlerPool.release(TagHandlerPool.java:166)
at org.apache.jsp.l.profile_jsp._jspDestroy(profile_jsp.java:114)
at org.apache.jasper.runtime.HttpJspBase.destroy(HttpJspBase.java:88)
at org.apache.jasper.servlet.JspServletWrapper.destroy(JspServletWrapper.java:428)
at org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:139)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
at com.google.appengine.tools.development.PrivilegedJspServlet.access1(PrivilegedJspServlet.java:23)
at com.google.appengine.tools.development.PrivilegedJspServlet.run(PrivilegedJspServlet.java:59)
at java.security.AccessController.doPrivileged(Native Method)
at com.google.appengine.tools.development.PrivilegedJspServlet.service(PrivilegedJspServlet.java:57)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
at com.google.appengine.tools.appstats.AppstatsFilter.doFilter(AppstatsFilter.java:141)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at com.appspot.MySite.Controller.FacebookLogin.doFilter(FacebookLogin.java:140)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at com.google.appengine.tools.development.HeaderVerificationFilter.doFilter(HeaderVerificationFilter.java:35)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at com.google.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFilter.java:58)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at com.google.appengine.tools.development.StaticFileFilter.doFilter(StaticFileFilter.java:122)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at com.google.appengine.tools.development.BackendServersFilter.doFilter(BackendServersFilter.java:97)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
at com.google.apphosting.utils.jetty.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:70)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at com.google.appengine.tools.development.JettyContainerService$ApiProxyHandler.handle(JettyContainerService.java:351)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:326)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:923)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:547)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
回答by BalusC
java.lang.NoSuchFieldError: deferredExpression
at apache.taglibs.standard.tag.common.core.ForEachSupport.release(ForEachSupport.java:212)
java.lang.NoSuchFieldError: deferredExpression
at apache.taglibs.standard.tag.common.core.ForEachSupport.release(ForEachSupport.java:212)
Your classpath is polluted with different JSTL implementation versions. This particular exception means that you've both the jstl-1.2.jarfile of JSTL 1.2 and the standard.jarfile of JSTL 1.1 or 1.0 in the classpath. This field is introduced in JSTL 1.2 and the ForEachSupportclass is present in the both JAR files. Apparently at some point the one of standard.jaris been loaded and used while still having the JSTL 1.2 API in JVM memory.
您的类路径被不同的 JSTL 实现版本污染。这个特殊的例外意味着您在类路径中既有jstl-1.2.jarJSTL 1.2 的standard.jar文件,也有 JSTL 1.1 或 1.0的文件。该字段是在 JSTL 1.2 中引入的,并且ForEachSupport该类存在于两个 JAR 文件中。显然,在某些时候,其中一个standard.jar被加载并使用,同时在 JVM 内存中仍然具有 JSTL 1.2 API。
The solution is to removethe standard.jar. You don't need it for JSTL 1.2 at all.
解决的办法是删除的standard.jar。JSTL 1.2 根本不需要它。
See also:
也可以看看:
- Our JSTL wiki page(to learn about what JARs you need)
- 我们的 JSTL wiki 页面(了解您需要哪些 JAR)
Update: as per the comments, you actually need to removethe jstl-1.2.jaras well, because the Servlet 2.5 compatible version of GAE/Jetty apparently already ships with JSTL 1.1 out the box. This was conflicting with JSTL 1.2. in your webapp.
更新:根据意见,你实际上需要去除的jstl-1.2.jar为好,因为GAE /码头的Servlet 2.5的兼容版本显然已经附带了JSTL 1.1开箱。这与 JSTL 1.2 相冲突。在您的网络应用程序中。
回答by Babajide M. Moibi
You most likely have two versions of JSTL (javax.servlet:jstl:). Remove the older version and make sure you update the version everywhere you were using the older one, and you should be good.
您很可能有两个版本的 JSTL (javax.servlet:jstl:)。删除旧版本并确保在所有使用旧版本的地方更新版本,你应该很好。

