Can't make Ext GWT 3.0 run - gwt

I am having a problem running a Ext GWT 3.0 with GWT (version 2.4). I tried making a Web Application Project from plugin but the I get this error:
[ERROR] Unable to find 'com/extjs/gxt/ui/GXT.gwt.xml' on your classpath;
When I change the gxt.jar to lower version: gxt-2.2.5 the demo application runs.
Anyone have experience the same issue?

The module name changed from 2.2 to 3.0. Instead of inheriting the com.extjs.gxt.ui.GXT module, inherit com.sencha.gxt.ui.GXT in your module file.
<inherits name="com.sencha.gxt.ui.GXT" />
This packaging has changed, along with the packaging of all of the classes, allowing you to have both jars on the classpath at once, and even inherited at once. This was done in part because of the large number of changes from 2.2 to 3.0.

Related

"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!
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.

GWT 2.6 with GXT-3.0.1 error in compile

since the 2.6.0 release of GWT which dropped support of ie6 browser my current project which also uses GXT is failing to compile with the following error:
Loading inherited module 'com.sencha.gxt.ui.GXT'
Loading inherited module 'com.sencha.gxt.data.Data'
Loading inherited module 'com.sencha.gxt.core.Core'
[ERROR] The value ie6 was not previously defined.
[ERROR] Line 96: Unexpected exception while processing element 'set-property'
i tried to set
<set-property name="gxt.user.agent" value="safari3, safari4, safari5, chrome, air, gecko1_8, gecko1_9"/> and the <extend-property name="user.agent" ....../>
but without any success. Are there any workarounds on this?
GWT 2.6.0 has several breaking changes over GWT 2.4.0 and 2.5.1 - these don't affect all libraries, but they do affect both GXT 2 and 3. Code changes in GWT 2.6.0 that break libraries like GXT include:
Changing permutations (ie6 and opera are gone, ie10 was added, note that newer versions of opera are webkit based and do not need their own permutation)
Element added new final methods hasClassName and toggleClassName that can't compiled with XElement methods of the same name
String utils methods removed, switched to newer version of Guava (which now uses those methods)
Saw an upvote, so I know this is still getting readers months later, so editing this to point out that GXT 3.1.0 is in maven central and supports GWT 2.6.0, 2.6.1, and as of Friday anyway, supports GWT 2.7.0-SNAPSHOT. I can't promise it is totally future-proof, but as long no public methods in GWT change, it isn't likely to break again in the GWT 2.7 series.

Adding gFlot library to a GWT project fails

I downloaded gflot for my gwt project. To get to know the library I created a test project called "FlotDemo". I'm using Eclipse and created a plain vanilla gwt project with the help of the project creation wizard (the stuff with the greeting servlet and so on)
This is what I did:
Downloaded gflot-3.1.1.jar and copied it into /war/WEB-INF/lib
Added in Project->Properties->Java Build Path->Libraries gflot-jar to the path
Added <inherits name="ca.nanometrics.gflot.GFlot"/> to my "FlotDemo.gwt.xml"
Went to gFlot example and copy an pasted it to my EntryPoint class
So after step 4, eclipse strangly cannot resolve the objects from gflot I used in the code. I tried to run the web app anyway in the gwt simulator but it quit with the error message:
2013-06-05 17:24:51.212 java[12069:707] [Java CocoaComponent compatibility mode]: Enabled
2013-06-05 17:24:51.213 java[12069:707] [Java CocoaComponent compatibility mode]: Setting timeout for SWT to 0.100000
Loading modules
flotdemo.FlotDemo
Loading inherited module 'flotdemo.FlotDemo'
Loading inherited module 'ca.nanometrics.gflot.GFlot'
[ERROR] Unable to find 'ca/nanometrics/gflot/GFlot.gwt.xml' on your classpath; could be a typo, or maybe you forgot to include a classpath entry for source?
[ERROR] Line 11: Unexpected exception while processing element 'inherits'
com.google.gwt.core.ext.UnableToCompleteException: (see previous log entries)
at com.google.gwt.dev.cfg.ModuleDefLoader.nestedLoad(ModuleDefLoader.java:308)
What am I doing wrong here?
<inherits name="ca.nanometrics.gflot.GFlot"/> is the old one.
Since 3.0, use <inherits name='com.googlecode.gflot.GFlot'/> instead.
See the example.

can't compile play showcase html

I installed playN however I get this error:
[INFO] --- gwt-maven-plugin:2.4.0:compile (default) # playn-showcase-html ---
[ERROR] Error: Could not find or load main class com.google.gwt.dev.Compiler
I checked the m2 repository, and the gwt jars for 2.4 2.5 gwt seem to be there.
If I try to use GWT 2.5 in the project then I get this
The GWT SDK 'C:\Users\user.m2\repository\com\google\gwt' on the project's build path is not valid (Version is not supported, must be 2.0.0 or later)
playn-showcase-html
Unknown Google Web Toolkit Problem
Does this make sense at all?
How to fix it?
Thanks
It seems that some gwt jars in the maven repository were corrupted. I deleted them, i run the playN sample again, the jars were downloaded correctly, and the whole think worked
C:\Users\user.m2 <-- this is very strange. it looks like somehow your maven repository path is munged up.
Check your environmental variables for MAVEN_REPOSITORY and see if its set to C:\Users\user. Also, find your maven installation directory, and look under the conf directory for a settings.xml, and see if you have <localRepository>${env.MAVEN_REPOSITORY}/.m2/repository</localRepository>.

Bug? GXT (Ext GWT) Compiles in 'devmode' target but not for 'build'

I'm working on a GXT project, and I'm using GXT UiBinder. I'm compiling with ant. The target devmode works fine with no errors, and I'm able to see my application running in the browser. But using the target build I get the following error:
[ERROR] Errors in 'jar:file:/home/webbtra/dev/rail_gxt/gxt-2.2.3/gxt.jar!/com/extjs/gxt/ui/client/data/BeanModelLookup.java'
[ERROR] Internal compiler error
java.lang.IncompatibleClassChangeError: Found class com.google.gwt.core.ext.typeinfo.JClassType, but interface was expected
I'm using these versions, which I've read that they should be compatible:
GWT Version: 2.1.1 (also tried 2.2.0 and 2.0.4 with same result)
GXT Version: 2.2.3
Compilation will work if I remove <inherits name="com.jhickman.web.gwt.gxtuibinder.GxtUiBinder" /> from my module file, and use only GWT components. But again, it's strange that it works fine in devmode. Any help is appreciated.
-tjw
Figured it out. Even though GXT 2.2.3 claims to be compatible with GWT 2.2, it isn't. I reverted back to GXT 2.2.1 and GWT 2.0.4 and it works perfectly.
I just got the exact same error message you posted (even without using GxtUiBinder!), but I accidentally had set my GWT SDK to 2.1.1 (in Eclipse). I'm using "gxt-2.2.3-gwt22.jar", so this obviously cannot work.
Switching the GWT SDK to 2.2.0 solved the problem. So it seems, that GXT 2.2.3 + GWT 2.2.0 work together just fine.
If you'd like to try it again, make sure, that you don't just change the GWT library, but really switch the GWT SDK. (eg in Eclipse: Project > Properties > Google > Web Toolkit > Use specific SDK)
I'm managed to have them compiling together (gwt 2.2 + GXT 2.2.3) , but GWT Designer (Window Builder too) started throwing exceptions while parsing code. Without GXT - everything is fine. Becouse of Designer bug, i'm forced to downgrade GWT.