GWT plugin: trouble with a4j-gwtKickStart example

I am working with the g4jsf integration library from the Ajax4JSF guys:

https://ajax4jsf.dev.java.net/nonav/ajax/gwt/gwt-cdk.html

I am trying to run their KickStart sample under IDEA 6.0 (release version, build #5766):

https://ajax4jsf.dev.java.net/files/documents/4966/39119/a4j-gwtKickStart.zip

I have been trying to get an IDEA project set up that can run the gwtKickStart example under hosted mode in the IDEA debugger. (I was able to do this on the first try, with no difficulties, using the GWT-KitchenSink sample from the GWT home page: http://code.google.com/webtoolkit/documentation/examples/kitchensink/ )

When I set up a module for gwtKickStart (either a Java application module, as in the GWT flash demo, or a Web module, as advised in more recent forum postings here), I add the sample's libraries as a project library. Then I create a GWT Run/Debug configuration, pointing it at the JavaSource/demo/gwt/public/index.html file.

There are very many problems:

1) The tests/demo/gwt/client/EntryPointTestCase.java file complains that "com.google.gwt.user.client.DOM is not present in JRE emulation library so it cannot be used in test mode".

2) Excluding that directory from the build (marking it as non-source) results in an "Invalid index" error when I try to compile. This seems to be short for an "InvalidJarIndexException" but the compiler will not tell me what jar file it is finding invalid.

3) Since the a4j-gwtKickStart's "ant shell" command successfully launches the hosted GWT browser from the command line, I tried setting up an IDEA Java application Run/Debug configuration to run the hosted browser. When I did this, I had to add gwt-dev-windows.jar to the path, and then when I would run it I would get an InvalidJarIndexException from the GWTShell class.

4) At one point last night, in an earlier set of experiments, I was able to get a GWT configuration to run (I can no longer reproduce that configuration), but it gave me various JSF errors.

In any case, it's pretty clear I'm trying to work with three technologies -- the IDEA GWT plugin, GWT itself, and the g4jsf library -- that have never been put together before by anyone. Here's hoping someone has some guidance to provide. Is there any way to debug InvalidJarIndexExceptions? Is there any way to turn up IDEA's logging level? Can GWT applications be run in hosted mode WITHOUT using the IDEA GWT plugin? Is there any more current documentation anywhere about exactly how the GWT plugin works, and what assumptions it makes about project files?

Thanks very much for any suggestions,
Rob Jellinghaus

4 comments

I have put the complete source I am working with, along with my failed attempts at an IDEA 6 project, here:

http://unrealities.com/a4j-gwtKickStart-idea6.zip

The only global library referenced is junit.

Thanks for any information whatsoever,
Rob

0

Well, I rolled back from IDEA 6.0 to IDEA 5.1, and I was able in about five minutes to set up a plain Java application module which directly launched GWTShell and was able to run the a4j-gwtKickStart sample with no problems at all.

It seems clear that the IDEA 6.0 GWT plugin has some deeply hardcoded assumptions about GWT project layout that are 1) very opaque, 2) not obvious at all, and 3) not at all compatible with the way the g4jsf project lays out its GWT sources.

I would recommend that people consider steering clear of the IDEA 6 GWT plugin for a while longer. (Nice for me, saves me the $299 upgrade cost :) The GWT plugin looks like it will be great eventually, but it has a while longer to go, and the support here seems fairly lacking....

Good luck Intellij, I hope the 2.0 or 3.0 plugin does the job!
Cheers,
Rob

0
Avatar
Nikolay Chashnikov

1) I cannot reproduce this problem. If the problem repeats please press Ctrl+B on reference to DOM class and see in which jar this class is located.
In any case, if some inspection doesn't work correctly you can disable such inspection (press Alt+Enter on a highlighted code, the press right arrow, select "Edit inspection settings" and uncheck the inspection's box).


2) I've found very strange thing:gwt-user.jar from your project contains META-INF/INDEX.LIST file which contains "javax/servlet" entry, but gwt-user.jar doesn't contain "javax.servlet" package. Looks like javax.servlet package had been removed from gwt-user.jar by hand. Removing META-INF/INDEX.LIST file from gwt-user.jar should fix the problem.
Unfortunately IDEA cannot tell you what jar is invalid because InvalidJarIndexException exception is thrown from JDK code and JDK doesn't store name of invalid jar in the exception.

In fact GWT plugin doesn't make any specific assumptions about project files. It deals only with .gwt.xml files. The only thing you need to configure is path to GWT sdk (Settings | Google Web Toolkit).

0

Thank you very much, Nikolay! You have revived my faith in IntelliJ support :)

I have still rolled back to IDEA 5.1 as the upgrade cost issue is a blocker for me (at least until I get my bonus in January!). But I can at least give you a firm answer to why #2 is happening.

The gwt-user.jar as shipped from Google includes the javax.servlet classes to facilitate running GWTShell in standalone hosted mode. BUT, it is not legal to deploy a jar in a Tomcat webapp if it contains duplicate copies of the javax.servlet classes. And there has been much confusion on the GWT forums about how to handle this issue. For instance, here is one thread documenting the wrong way to do it, which is to just delete the files from the jar using a zip utility:

http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/a403ebd45c94c77e

There is a later post that documents the right way, which is to use ant to rebuild the jar file, with a corrected manifest:

http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/ab0052a4c5834ff5/fbbc25e7ee85632b

I will certainly use the latter method in future, once I get back on IDEA 6.0! It would be great if the GWT plugin were able to detect this problem or otherwise warn about the possibility (maybe in the documentation for the plugin? or something???), since it looks like it will be a fairly common issue in homegrown GWT projects....

Google is aware of the issue and claims to have marked it "fixed" --
http://code.google.com/p/google-web-toolkit/issues/detail?id=130 --
but it is not clear from that issues entry exactly which release they fixed it in, or how they fixed it :( Also note that the a4j-gwtKickStart sample I was working with is apparently based on GWT 1.1.0...

Anyway, thanks again.
Cheers!
Rob

0

Please sign in to leave a comment.