GWT 2.7.0 Compilation failed [ERROR] Could not find class java / lang / Object

I have a project that builds in 2.6.1 and cannot build in 2.7.0. I hunted the internet for a good answer, but I couldn't find one.

Here is the Maven build output:

... Uninteresting material deleted

[INFO] Compiling module XXXX
[INFO]    Looking for precompiled archives.  To disable, use -Dgwt.usearchives=false
[INFO]    Loading archived module: jar:file:/C:/Users/3433/.m2/repository/com/google/gwt/gwt-user/2.7.0/gwt-user-2.7.0.jar!/com/google/gwt/core/Core.gwtar

      

...

[INFO]    Compiling...
[INFO]       Compilation completed in 5,95 seconds
[INFO]    Invalid Unit: com.google.gwt.validation.client.impl.BaseGwtConfiguration
[INFO]    Invalid Unit: com.google.gwt.validation.client.spi.GwtValidationProvider

      

... removed other invalid units.

[INFO]    Invalid Unit: com.google.gwt.validation.client.spi.BaseConfigurationState
[INFO]    Invalid Unit: java.lang.String
[INFO]    Invalid units found: 11
[INFO]    Compiling...
[INFO]       Compilation completed in 0,04 seconds
[INFO]    Added 3762 units to cache since last cleanup.
[INFO]    Tracing compile failure path for type 'java.lang.String'
[INFO]       Errors in 'jar:file:/C:/Users/3433/.m2/repository/com/google/gwt/gwt-user/2.7.0/gwt-user-2.7.0.jar!/com/google/gwt/emul/java/lang/String.java'
[INFO]          Line 976: The method getDefault() is undefined for the type Locale
[INFO]    Removing invalidated units
[INFO] Wrote 3762 units to persistent cache.
[INFO]    Resolving java.util.Locale
[INFO]       Found type 'java.util.Locale'
[INFO]          [WARN] Unable to resolve supertype java/lang/Object

      

Many bugs removed ...

[INFO]    Resolving com.google.gwt.core.client.AsyncProvider
[INFO]       Found type 'com.google.gwt.core.client.AsyncProvider'
[INFO]          [ERROR] Unable to find class java/lang/Object

[INFO]          Resolving method get
[INFO]             Found type 'com.google.gwt.core.client.Callback'
[INFO]                [ERROR] Unable to find class java/lang/Object

      

Removed hundreds of similar errors

[INFO]    Tracing compile failure path for type 'java.lang.Object'
[INFO]       [ERROR] Errors in 'file:/usr/local/google/home/dankurka/gwt/user/super/com/google/gwt/emul/java/lang/Object.java'
[INFO]          [ERROR] java.lang.String cannot be resolved to a type

      

What is Dan Kurka's home path in my build?

Any ideas?

+3


source to share


1 answer


I know this is an old post, but I recently had the same problem, so I thought I'd post my findings.

In my case, I migrated from GWT 2.5.1 to 2.7.0. We had a java.util.Locale class in our code so that the GWT compiler had all the source code it needed to emulate and did not follow the structure of the same class in GWT 2.7.0. I had to add the missing methods and everything was fine after that.



To find the cause, I had to recompile the -Dgwt.logLevel = DEBUG parameter. Without this kit, the root cause of my problem was hidden. When I compiled with a set of log levels, I was able to see what the problem was:

[INFO]    Compiling...
[INFO]       30% complete (ETR: 9 seconds)
[INFO]       30% complete (ETR: 9 seconds)
[INFO]       30% complete (ETR: 9 seconds)
[INFO]       30% complete (ETR: 9 seconds)
[INFO]       40% complete (ETR: 8 seconds)
[INFO]       50% complete (ETR: 6 seconds)
[INFO]       60% complete (ETR: 4 seconds)
[INFO]       70% complete (ETR: 3 seconds)
[INFO]       80% complete (ETR: 2 seconds)
[INFO]       90% complete (ETR: 1 seconds)
[INFO]       100% complete (ETR: 0 seconds)
[INFO]       Compilation completed in 11.10 seconds
[INFO]    java.util.Locale isn't structurally same.
[INFO]    Invalid Unit: java.lang.String
[INFO]    Invalid units found: 1
[INFO]    Compiling...
[INFO]       Compilation completed in 0.02 seconds
[INFO]    Added 5097 units to cache since last cleanup.
[INFO]    Tracing compile failure path for type 'java.lang.String'
[INFO]       Errors in 'jar:file:/Users/randymay/.m2/repository/com/google/gwt/gwt-user/2.7.0/gwt-user-2.7.0.jar!/com/google/gwt/emul/java/lang/String.java'
[INFO]          Line 991: The method getDefault() is undefined for the type Locale
[INFO]          Line 976: The method getDefault() is undefined for the type Locale
[INFO]       Checked 1 dependencies for errors.

      

+1


source







All Articles