i am building a GWT project, with GWT-2.0.3 and eclipse plugin. well, first i tried, JSTL1.2 and servlet 2.5,
I stumbled on this while I was looking for fix JSTL for my app engine project. I found the answer on "Will It Play" page by google. Apparently you have to add
<%@page isElIgnored="false" %>
to your JSP pages to enable EL parsing.
java.lang.AbstractMethodError: javax.servlet.jsp.PageContext.getELContext()Ljavax/el/ELContext;
The webapp's runtime classpath is likely cluttered with a different version of EL JAR file (either an older version or the one of a different appserver) which lacks the in the exception mentioned method. I suspect the /WEB-INF/lib
. Get rid of it, it's normally already supplied by the appserver in question, you don't need to include it in your webapp. This applies on all appserver libraries like servlet-api.jar
and consorts by the way. You should never copy it into the webapp's /WEB-INF/lib
. That's asking for portability trouble.
I get this error too.
I've found I can fix it by moving the GWT SDK to the bottom of the classpath in the Eclipse Java Build Path -> Order and Export dialog.
However, that breaks GWT serialization with this message:
Mar 3, 2011 3:31:23 PM sun.reflect.NativeMethodAccessorImpl invoke0
WARNING: Exception while dispatching incoming RPC call
com.google.gwt.user.client.rpc.SerializationException: java.lang.reflect.InvocationTargetException
at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serializeWithCustomSerializer(ServerSerializationStreamWriter.java:764)
at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serializeImpl(ServerSerializationStreamWriter.java:727)
You can fix that by moving the GWT library back up the classpath, which makes it appear like you can either have JSTL or GWT Serialization working in Jetty, but not both.
(GWT 2.1, JSTL1.2 and servlet 2.5.)
I'd recommend just switching to an external Java server (like Tomcat, which you seem to have installed and which works with your configuration) - much less problems, easier than trying to work with the crippled Jetty that comes with GWT.
The instructions can be found in the docs. If you stick with GWT's Jetty, you will only run into more issues in the future.
Update, see comment by Pascal Thivent below:
@Pascal: sorry for that, I didn't mean to just say "Switch to external server, no talking", it's just that I've seen a lot of people on SO and on GWT's Google Group that have problems configuring Jetty that comes with GWT - in some cases it's because the configuration is somewhat different than standard, because the GWT team included an older/modified (I can't get any solid info on this) version of Jetty, for example see this post and comments there, some quotes:
NOTE: I believe the version of jetty shipped with GWT is below 6.1.12 and therefore you must leave off the first parameter in the example docs as it was added in jetty 6.1.12rc3. See the note at the top of the Jetty documents page.
Supposedly Jetty supports the servlet 2.5 specification and resource injection via the web.xml entry or @resource annotation. However, I have yet to figure out if this is supported by the Jetty version shipped with GWT. If anyone has figured out whether or not this works and if so how it is done please let me know.
Other problems occur when someone wants to use EJB.
All that (maybe in a more condensed/cryptic way) is written in GWT's documentation - for which I provided a link above to the exact paragraph addressing this issue.
Hopefully, that cleared up some things - switching to an external server just seems like the easiest, simplest and best solution - no "special GWT" configuration, meaning you can use the same configuration/server that you'll be using in production, no need to migrate your configuration to, for example, Tomcat, no unexpected bugs after migration, etc.