eclipsegwtgxtgwt-super-dev-mode

"Cannot be resolved to a type" after upgrading to GWT 2.7. and trying to compile a multi-project module


I´ve been having trouble getting the Super-Dev-Mode to work with GWT 2.7. and GXT 3.1.x The classical Dev-Mode starts without trouble, but the Super-Dev-Mode and GWT-compile the project won`t work.

I am currently working with Eclipse 4.4.2 with Java 1.7_2 on Windows. So let´s pretend we have 2 GWT/GXT projects (no Maven) with GWT 2.6 and GXT 3.1.x (Projects are backuped on a repository).

One is called A and the other project is called B. Project A has many packages and no entrypoint (to just work as a library/framework), just an abstract entrypoint every other project has to extend. The other one is called B and inherits from A, the entrypoint extends the entrypoint of A.

When starting the project under GWT 2.6 in classical Dev-Mode the project works fine. When upgrading to GWT 2.7. it will work fine with the classical Dev-Mode, an even in Super-Dev-Mode the Codeserver starts to run, but when compiling the module i get an error that some code seems not to live under a package 'client' so i migrated it into a own package and added the sourcepath to the A.gwt.xml.

After fixing this error and starting the Super-Dev-Mode again (and when trying to GWT-compile) I get errors like this:

 Ignored 15 units with compilation errors in first pass.
Compile with -strict or with -logLevel set to TRACE or DEBUG to see all errors.
   Finding entry point classes
      Tracing compile failure path for type 'com.example.b.client.B'
         [ERROR] Errors in 'file:/C:/Workspace/ProjectB/src/com/example/b/client/B.java'
            [ERROR] com.example.a.client.A cannot be resolved to a type
         [ERROR] Errors in 'file:/C:/Workspace/ProjectA/src/com/example/a/view/ExampleLayout.java'
            [ERROR] com.example.a.view.ILayout cannot be resolved to a type
         [ERROR] Errors in 'file:/C:/Workspace/ProjectA/src/com/example/a/client/service/ExampleServiceAsync.java'
            [ERROR] com.example.a.model.Examplemodel cannot be resolved to a type
         [ERROR] Errors in 'file:/C:/Workspace/ProjectA/src/com/example/a/model/OtherExampleModel.java'
            [ERROR] com.example.a.hibernate.model.ComOtherExampleModel cannot be resolved to a type
         [ERROR] Errors in 'file:/C:/Workspace/ProjectB/src/com/example/b/client/service/OtherExampleServiceAsync.java'
            [ERROR] com.example.a.model.NewExampleModel cannot be resolved to a type
         ...
     (and many more)

Project A is included in the buildpath of the project B, when creating a custom run configuration where the project is added to "user entries" and adding source folders to "user" entries wont work. For the custom run configuration i used something like the following arguments:

"-src src/ -src ${workspace_loc:ProjectA} com.example.b.B"

And even:

"-src src/ -src ${workspace_loc:ProjectA} com.example.b.B com.example.a.A"

I widely searched for solutions and even tried to set up the workspace again, checkout the projects from the repository again, organize imports and even adding every package to the buildpath of A.

I also tried to add this to the .gwt.xml files didn´t work:

<add-linker name="xsiframe"/>

How can I solve the "cannot be resolved to a type" error? I would really appreciate every form of help to get this problem done! Thanks!


Solution

  • One possible problem could be your version of GXT. If you are using GXT 3.1.1 (which was the latest GPL-release), then you can not use GWT 2.7.0.

    Take a look at the version table:

    GXT versions

    As you can see, Sencha GXT 3.1.1 does not support GWT 2.7.0. The first GXT release which will support GWT 2.7.0 is GXT 3.1.2.