Eclipse Luna SR1 w/ GPE 3.8.0 -- Compilation error on GWT 2.7 project, builds fine w/ Maven 3

351 views
Skip to first unread message

Laurent D

unread,
Feb 3, 2015, 1:53:11 PM2/3/15
to google-we...@googlegroups.com

Hello there,


I decided to give GWT 2.7 a quick test using Thomas Broyer's "Multi project setup" sample included as part of its gwt-maven-plugin source:

(doc: http://mojo.codehaus.org/gwt-maven-plugin/user-guide/multiproject.html)

(source: https://github.com/gwt-maven-plugin/gwt-maven-plugin/tree/master/src/it/reactor)


While building this project with Maven 3.0.5 only required minor tweaking of the reactor project's pom (basically replacing  '@pom.version@' and '@gwt.version@' placeholders with hard-coded values), I was unable to get it to compile with GPE under Eclipse, using the 'Google > GWT Compile' option. The error I first got (which did not make much sense IMHO...) was:

Compiling module org.codehaus.mojo.gwt.test.Hello
   Looking for precompiled archives.  To disable, use -Dgwt.usearchives=false
   Loading archived module: jar:file:/C:/Local/maven2/repository/com/google/gwt/gwt-user/2.7.0/gwt-user-2.7.0.jar!/com/google/gwt/core/Core.gwtar
[ERROR] Unexpected internal compiler error
java.lang.NoClassDefFoundError: org/objectweb/asm/MethodVisitor
 at java.lang.ClassLoader.defineClass1(Native Method)
 at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
 at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)

 .../...
 
 Caused by: java.lang.ClassNotFoundException: org.objectweb.asm.MethodVisitor
 at java.net.URLClassLoader$1.run(URLClassLoader.java:366)

 .../...


I then tried to edit the POM and use "2.5.1" as GWT version and had the compiler complain about not being able to find the 'HelloAsyncService' class...
I checked and it was actually in the 'target/generated-sources/gwt' of the 'war' project, and this source directory was not on the Java Build Path in Eclipse (I guess  the POM is missing a 'maven-build-helper-plugin' exection for adding this directory as source directory in Eclipse...)
 
Anyway, just manually adding 'target/generated-sources/gwt' as a source folder to the Java Build Path and retrying 'Google > GWT Compilation', this time the project compiled fine with GPE in Eclipse.
 
Feeling relieved and confident I had finally nailed it, I then changed back the GWT version to 2.7.1 in the 'reactor' project POM to have another try, but this time I got this error in Eclipse:
 

Loading inherited module 'org.codehaus.mojo.gwt.test.Hello'
   Loading inherited module 'com.google.gwt.user.User'
      Loading inherited module 'com.google.gwt.core.Core'
         Loading inherited module 'com.google.gwt.core.CompilerParameters'
            [ERROR] Element 'module' beginning on line 17 contains unexpected attribute 'type'
            [ERROR] Failure while parsing XML
com.google.gwt.core.ext.UnableToCompleteException: (see previous log entries)
 at com.google.gwt.dev.util.xml.DefaultSchema.onUnexpectedAttribute(DefaultSchema.java:72)
 at com.google.gwt.dev.util.xml.Schema.onUnexpectedAttribute(Schema.java:80)

 
Again, this does not seem to make much sense as an 'mvn clean package' on the 'reactor' project works fine on the command line with Maven 3.0.5, as does an 'mvn gwt:compile' on the child 'war' project...

 

For the record, I'm using 32-bit Eclipse 4.4.1 on Windows 7, with GPE v3.8.0.v201410302155-rel-r44


Any ideas as to the likely cause for this error and how it can be remedied please?


I am getting more and more fed up with the Eclipse WTP, M2E and GPE deadly combination.... No offense meant, but this shaky tooling really ruins the GWT coding experience... I spend all day tweaking things in Eclipse so that I can make my GWT projects compile, and then I have to battle again to have them run in Dev Mode or Super Dev Mode as the case may be... It really is a gigantic pain, we lose whole days trying to just setup a project correctly so that it will compile and run...

Can we expect a new version of GPE anytime soon? Also, it would greatly help if you could update the GPE documentation that is rather thin, especially as far as the GWT side of things is concerned...

I am aware that people working on these various tools do their best and I do not mean to be disrespectful, but the situation has really been giving very bad press to GWT for years, and it does not seem to improve much... Setting up and developing a GWT project is already error-prone and complicated enough, we really need some more robust tooling and documentation / checklists to support development...


Sorry for such a long rant, and hoping you can provide some guidance on this,

Regards,

Laurent

Thomas Broyer

unread,
Feb 4, 2015, 6:02:13 AM2/4/15
to google-we...@googlegroups.com


On Tuesday, February 3, 2015 at 7:53:11 PM UTC+1, Laurent D wrote:

Hello there,


I decided to give GWT 2.7 a quick test using Thomas Broyer's "Multi project setup" sample included as part of its gwt-maven-plugin source:

(doc: http://mojo.codehaus.org/gwt-maven-plugin/user-guide/multiproject.html)

(source: https://github.com/gwt-maven-plugin/gwt-maven-plugin/tree/master/src/it/reactor)


Note: this is not "my" plugin, I'm just pushing updates and releases from time to time. "My" plugin is https://github.com/tbroyer/gwt-maven-plugin, and "my" multi-module setup can be found at https://github.com/tbroyer/gwt-maven-archetypes
The "setup" you're linking to is an integration test, not a sample (as warned in the documentation)

 

While building this project with Maven 3.0.5 only required minor tweaking of the reactor project's pom (basically replacing  '@pom.version@' and '@gwt.version@' placeholders with hard-coded values), I was unable to get it to compile with GPE under Eclipse, using the 'Google > GWT Compile' option. The error I first got (which did not make much sense IMHO...) was:

Compiling module org.codehaus.mojo.gwt.test.Hello
   Looking for precompiled archives.  To disable, use -Dgwt.usearchives=false
   Loading archived module: jar:file:/C:/Local/maven2/repository/com/google/gwt/gwt-user/2.7.0/gwt-user-2.7.0.jar!/com/google/gwt/core/Core.gwtar
[ERROR] Unexpected internal compiler error
java.lang.NoClassDefFoundError: org/objectweb/asm/MethodVisitor
 at java.lang.ClassLoader.defineClass1(Native Method)
 at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
 at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)

 .../...
 
 Caused by: java.lang.ClassNotFoundException: org.objectweb.asm.MethodVisitor
 at java.net.URLClassLoader$1.run(URLClassLoader.java:366)

 .../...


I then tried to edit the POM and use "2.5.1" as GWT version and had the compiler complain about not being able to find the 'HelloAsyncService' class...
I checked and it was actually in the 'target/generated-sources/gwt' of the 'war' project, and this source directory was not on the Java Build Path in Eclipse (I guess  the POM is missing a 'maven-build-helper-plugin' exection for adding this directory as source directory in Eclipse...)

Eclipse is supposed to auto-detect that folder as a source folder (I never tried it though, I don't use gwt:generateAsync, heck I don't even use RPC); try updating the project (from memory: right-click → Maven → update project from POM).
 
 
Anyway, just manually adding 'target/generated-sources/gwt' as a source folder to the Java Build Path and retrying 'Google > GWT Compilation', this time the project compiled fine with GPE in Eclipse.
 
Feeling relieved and confident I had finally nailed it, I then changed back the GWT version to 2.7.1 in the 'reactor' project POM to have another try, but this time I got this error in Eclipse:
 

Loading inherited module 'org.codehaus.mojo.gwt.test.Hello'
   Loading inherited module 'com.google.gwt.user.User'
      Loading inherited module 'com.google.gwt.core.Core'
         Loading inherited module 'com.google.gwt.core.CompilerParameters'
            [ERROR] Element 'module' beginning on line 17 contains unexpected attribute 'type'
            [ERROR] Failure while parsing XML
com.google.gwt.core.ext.UnableToCompleteException: (see previous log entries)
 at com.google.gwt.dev.util.xml.DefaultSchema.onUnexpectedAttribute(DefaultSchema.java:72)
 at com.google.gwt.dev.util.xml.Schema.onUnexpectedAttribute(Schema.java:80)

 
Again, this does not seem to make much sense as an 'mvn clean package' on the 'reactor' project works fine on the command line with Maven 3.0.5, as does an 'mvn gwt:compile' on the child 'war' project...

 

For the record, I'm using 32-bit Eclipse 4.4.1 on Windows 7, with GPE v3.8.0.v201410302155-rel-r44


Any ideas as to the likely cause for this error and how it can be remedied please?


As it's an Eclipse-specific failure, I'd ask on the GPE forum (which actually asks you to ask on StackOverflow): https://groups.google.com/d/forum/google-plugin-eclipse
 


I am getting more and more fed up with the Eclipse WTP, M2E and GPE deadly combination.... No offense meant, but this shaky tooling really ruins the GWT coding experience... I spend all day tweaking things in Eclipse so that I can make my GWT projects compile, and then I have to battle again to have them run in Dev Mode or Super Dev Mode as the case may be... It really is a gigantic pain, we lose whole days trying to just setup a project correctly so that it will compile and run...


The start of a solution is to always first understand what you want to do, then have your tools do it.
I don't quite understand why you'd want to compile from within Eclipse, and IIRC that's not really configuration.
DevMode and SuperDevMode are almost-regular launchers so you can easily tweak them to add/remove arguments, or folders to/from the classpath. And if that doesn't work the way you like, then just create regular launchers.
 

Can we expect a new version of GPE anytime soon? Also, it would greatly help if you could update the GPE documentation that is rather thin, especially as far as the GWT side of things is concerned...


This is something you should ask to the GPE guys.
 

I am aware that people working on these various tools do their best and I do not mean to be disrespectful, but the situation has really been giving very bad press to GWT for years, and it does not seem to improve much... Setting up and developing a GWT project is already error-prone and complicated enough, we really need some more robust tooling and documentation / checklists to support development...


Sorry for such a long rant, and hoping you can provide some guidance on this,


HTH 

Laurent D

unread,
Feb 4, 2015, 2:16:03 PM2/4/15
to google-we...@googlegroups.com
Hi THomas and many thanks for your quick reply !

I wasn't aware you had your own plugin at GitHub and this was different from the one at Codehaus, thanks for all these indications!

I'll definitely give your plugin a try, and will also try your archetype to test it with GWT 2.7!

Regarding your question as to why I'd want to "GWT compile" in Eclipse: this is so I can generate the GWT nocache.js, permutations and .rpc files in the Eclipse GWT output folder (which is generally different from the Maven output folder) so that I can point to it in a Dev Mode configuration. This is only for development/debugging; I rely on Maven for producing the final version of the app to be tested and deployed.
Indeed, there's a way to share the Maven GWT output folder with Eclipse in DevMode, but it's often simpler (and leads to fewer problems) to have separate Eclipse/Maven output folders fior the GWT client side files (well, this is a personal opinion of course).

I'm taking note of your recommendation that my rant should better be aimed at the GPE guys on their forum or on StackOverflow as they suggest in their forum.

Thank you for your time and for your advice.

Kind regards,
Laurent



Reply all
Reply to author
Forward
0 new messages