Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

workaround for GWT+Jetty JSP compiler issue? (Java 1.5 source level not recognized)

Tags:

As this thread shows, there seems to be an issue getting JSPs to compile in GWT hosted mode with the new Jetty server:

2. ERROR in /tmp/Jetty_0_0_0_0_8080_war____ut4fm1/jsp/org/apache/jsp/  test_jsp.java (at line 53)          new java.util.ArrayList<String>();                                  ^^^^^^  Syntax error, parameterized types are only available if source level  is 1.5  

Does anyone have a workaround? It's possible that this commit might be related. I don't know what equivalent to org.eclipse.jdt.core.JDTCompilerAdapter should be used for building outside of Eclipse (e.g. on the command line). This is a real blocker for us adopting GWT 1.6, so any pointers are highly appreciated.

like image 343
George Armhold Avatar asked Apr 30 '09 14:04

George Armhold


1 Answers

This problem is generated by the default values used by JspServlet, which compiles using 1.4 for source/target values.

  1. You can cofigure this servlet by adding

    <servlet>     <servlet-name>jsp</servlet-name>     <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>     <init-param>         <param-name>compilerSourceVM</param-name>         <param-value>1.5</param-value>     </init-param>     <init-param>         <param-name>compilerTargetVM</param-name>         <param-value>1.5</param-value>     </init-param>     <load-on-startup>3</load-on-startup> </servlet> 
  2. There is one more issue as you can't configure JspServlet with the current jasper-compiler-5.0.28. You should download jasper-compiler-5.0.30 and make sure is in your classpath before gwt. There are other latest jasper compiler jars out-there but i'm not sore of how compatible are with jakarta-tomcat-5.0.28. I solved this problem by adding a dependency on jakarta-tomcat-5.0.30 in GWT 1.6.4. You can download the GWT compiled with this dependency from http://raisercostin.googlecode.com/files/gwt-windows-1.6.4.raisercostin.zip

I described the solution at http://code.google.com/p/raisercostin/wiki/GwtEclipsePluginDebug too.

like image 174
raisercostin Avatar answered Sep 20 '22 19:09

raisercostin