GWT 1.6, JSP's wont compile.

296 views
Skip to first unread message

Adrian

unread,
Apr 13, 2009, 6:46:23 PM4/13/09
to Google Web Toolkit
Hi Everyone,


I'm sure that this will be something stupid that I'm missing but I've
found I cannot get JSP's to compile in hosted mode if they include any
Java 1.5+ stuff, like generics or for each loops.

For example I'm using the latest Eclipse with the new GWT plugin, if I
create a new GWT project then add a jsp that has code using generics I
get this error when I load the jsp:

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


You can see the entire output at: http://pastebin.com/m7f0cd05a


I can't seem to find anyone else having this problem so any advice
would be great.


Thanks,
Adrian
Message has been deleted
Message has been deleted
Message has been deleted

Ken

unread,
Apr 13, 2009, 11:23:14 PM4/13/09
to Google Web Toolkit
I'm having the same exact problem.
I've tried it on both Mac OS X and Windows.

Adrian

unread,
Apr 14, 2009, 10:13:17 PM4/14/09
to Google Web Toolkit
Ok, so it's not just me!

Does anyone have any idea on how to go about finding an answer to this
problem? Even if you don't know the answer any suggestions are welcome
because this one has me stumped.

- Adrian
Message has been deleted

Salvador Diaz

unread,
Apr 15, 2009, 7:31:17 AM4/15/09
to Google Web Toolkit
It looks like the app server on which you're trying to load the jsp
doesn't support java 1.5 or you compiled your jsp with 1.4 or
something like that. Can't really tell without more details though. I
hope that helps you.

Cheers,

Salvador
Message has been deleted

Ken

unread,
Apr 15, 2009, 9:15:14 AM4/15/09
to Google Web Toolkit
The app server is the one bundled with GWT hosted mode, I believe it's
Jetty. If you use a servlet that has 1.5 stuff in it, it works fine.
When I was investigating, I noticed that the JSP does successfully
produce a servlet. I copied this servlet and compiled it myself and
it worked fine, even in hosted mode. I believe it's failing at the
point where the generated servlet (.java) is being compiled into a
class (.class). Like you said, it seems like for some reason it's
targeting version 1.4 or something like that. It's confusing though
that the problem is during compilation, because if you start with a
servlet (rather than a JSP) it compiles with no problem.

I have a feeling this might have something to do with it:
http://code.google.com/p/google-web-toolkit/source/detail?r=5109

It appears that something different happens underneath when a servlet
is compiled as opposed to when a servlet generated by a JSP is
compiled.

Miguel Méndez

unread,
Apr 15, 2009, 10:48:47 AM4/15/09
to Google-We...@googlegroups.com
It looks like it is a bug with Jetty instance used when a GWT-only web app has JSPs with generics.  

It does not appear that the App Engine devserver has this problem.  I went ahead and filed a bug against GWT for this, Issue 3557.  As a workaround, you could add App Engine to your project.
--
Miguel

Ken

unread,
Apr 15, 2009, 6:09:04 PM4/15/09
to Google Web Toolkit
Wow, thanks for this tip! I've been meaning to explore App Engine,
and this gave me even more reason to. I just tested it all out and it
works like a charm. I was worried it wouldn't allow the quick
turnaround, but you can use GWT hosted mode with it. They did a
really sweet job with this.

Thank you also for filing the bug report. You got the gist of it.
It's not just generics, it's other 1.5+ features too (like "for each"
loops) but it's probably not a huge deal.

Thanks,
Ken

On Apr 15, 10:48 am, Miguel Méndez <mmen...@google.com> wrote:
> It looks like it is a bug with Jetty instance used when a GWT-only web app
> has JSPs with generics.
> It does not appear that the App Engine
> devserver<http://code.google.com/appengine/docs/java/tools/devserver.html>
> has
> this problem.  I went ahead and filed a bug against GWT for this,
> Issue 3557<http://code.google.com/p/google-web-toolkit/issues/detail?id=3557>.

Adrian

unread,
Apr 15, 2009, 6:41:21 PM4/15/09
to Google Web Toolkit
Thanks for the replies guys, this is very helpful.

I've added a link to this discussion in the bug report.

- Adrian

Miguel Méndez

unread,
Apr 16, 2009, 9:21:31 AM4/16/09
to Google-We...@googlegroups.com
Thanks for updating the issue.
--
Miguel

arm...@gmail.com

unread,
Apr 28, 2009, 2:06:32 PM4/28/09
to Google Web Toolkit
Also an issue for us. We cannot use appengine, so I'd love to hear of
a fix or other workaround.

George

Miguel Méndez

unread,
Apr 28, 2009, 2:28:04 PM4/28/09
to Google-We...@googlegroups.com
I'm not aware of any workarounds at the moment.  We'll keep you posted.
--
Miguel

Ramin Ziai

unread,
Jul 17, 2013, 6:36:48 AM7/17/13
to google-we...@googlegroups.com, Google Web Toolkit, aha...@gmail.com
Hi all,

it's been while since this error has been reported, but as i experienced it is still not fixed.

I searched for hours before i came across this workaround, which works for me.

http://code.google.com/p/google-web-toolkit/issues/detail?id=3557#c43

Good luck!
Reply all
Reply to author
Forward
0 new messages