9

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.

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?

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.access$101(PrivilegedJspServlet.java:23)
    at com.google.appengine.tools.development.PrivilegedJspServlet$2.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)
Community
  • 1
  • 1
Lumpy
  • 3,632
  • 4
  • 34
  • 58
  • What is the full exception? This seems to be alone the message part of a `java.lang.NoSuchFieldError` exception. If so, please edit your question to include the full exception and stacktrace. – BalusC Oct 20 '11 at 14:40
  • What's the source of the error. Can you show the code that's causing this error? – Vivin Paliath Oct 20 '11 at 15:31
  • @Vivin: abstract classpath-related errors are hardly caused by code. Posting code won't help solving this kind of errors. Regardless, according to the stacktrace OP is using `` in `profile.jsp` file. – BalusC Oct 20 '11 at 15:39
  • @BalusC I should have taken more time to read the stack trace. I thought it was caused by him doing something strange in his jsp. Thanks for educating me. – Vivin Paliath Oct 20 '11 at 15:44

2 Answers2

25

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.jar file of JSTL 1.2 and the standard.jar file of JSTL 1.1 or 1.0 in the classpath. This field is introduced in JSTL 1.2 and the ForEachSupport class is present in the both JAR files. Apparently at some point the one of standard.jar is been loaded and used while still having the JSTL 1.2 API in JVM memory.

The solution is to remove the standard.jar. You don't need it for JSTL 1.2 at all.

See also:


Update: as per the comments, you actually need to remove the jstl-1.2.jar as 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.

Community
  • 1
  • 1
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
  • I can't find standard.jar in war/WEB-INF/lib or in any other jar locations. Where should I be looking for this file? Are there any other files that could be causing a similar conflict? – Lumpy Oct 20 '11 at 15:47
  • Perhaps in GAE/Jetty's own lib? Or even in JRE/lib(/ext)? Or maybe in flavor of an all-containing `j2ee.jar` or `javaee.jar` which you hijacked from other container like Glassfish in order to circumvent compilation errors in your project instead of compiling it against GAE/Jetty's own libs? – BalusC Oct 20 '11 at 15:48
  • Thinking once again about this, doesn't GAE/Jetty actually already ship with JSTL out the box? I recall some questions related to this... In that case you'd need to remove `jstl-1.2.jar` instead and rely on the JSTL 1.1 libs of GAE/Jetty itself. Or maybe downgrade to JSTL 1.1 compatible libs. What servlet version is your `web.xml` declared to by the way? And what servlet version does GAE/Jetty currently support as max? – BalusC Oct 20 '11 at 15:53
  • I removed jstl-1.2.jar and now everything works fine, thank you. Is there anything I will be missing using 1.1 vs 1.2? – Lumpy Oct 20 '11 at 15:58
  • My xml is set to 1.0 and my web app version is 2.5 – Lumpy Oct 20 '11 at 15:59
  • Ah, glad that it works. I'll update the answer. As to the changes, there's nothing changed with regard to core functionality. It was only a bit retrofitted to take benefit of the new EL 2.1 API. Also, the two JARs were merged into a single JAR. – BalusC Oct 20 '11 at 15:59
1

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.