Friday, May 29, 2020

Re: Issue with GWT 2.9.0 and Annotations/Predicates emulation

I was too quick to declare victory. 

I did not realize that I was no longer building with GWT 2.9.0 due to a bad merge my pom was overwritten with 2.8.2 again.

But what you just wrote helped indeed. I was still using jsinterop-base 1.0.0-RC1 and jsinterop-annotations 1.0.0.

Thanks for the help once more. Now I have a second problem, this time with some generics that is accepted by javac or IntelliJ but GWTC seems to not support it.


On Thursday, May 28, 2020 at 8:25:37 PM UTC+2, Colin Alworth wrote:
Glad you solved yours! As another update, we've seen two other cases of something that looks sort of similar to this.

In one instance, there was a dependency in the project of an old version of jsinterop-annotations, instead of the expected 2.0.0 release.

In the other instance, the project was creating a massive "reflection cache" of all annotations - the two fixes are to either exclude the jsinterop annotations from the cache (abbreviated rant: a cache like this should be based on a whitelist, not a blacklist), or provide sources and a .gwt.xml file for the annotations.

-Colin

On Thursday, May 28, 2020 at 1:03:48 PM UTC-5, David Nouls wrote:
Strange, just retried today and now the compile worked properly.

Thanks for the support!
On 19 May 2020, 16:41 +0200, Colin Alworth <nilo...@gmail.com>, wrote:
Nothing should have changed here as far as I am aware - GWT itself continues to have emulation for Annotation, Enum, etc (Predicate doesnt seem to be listed in your error)

One change was made in .gwt.xml files with their inherits - the jsinterop-annotations jar no longer contains a .gwt.xml file, and so Core.gwt.xml no longer references it (nor did it need to to begin with).

Are you compiling with -strict, and if so, is this the entire log?

I just pulled https://github.com/nmorel/gwt-jackson/ and updated it to use gwt 2.9, and it seems to run its tests cleanly for the main gwt-jackson package, and after I also update guava, the whole build passes:
[INFO] Reactor Summary for gwt-jackson :: Extensions :: Guava 0.15.5-SNAPSHOT:
[INFO]
[INFO] gwt-jackson :: Extensions :: Guava ................. SUCCESS [ 35.796 s]
[INFO] gwt-jackson :: Extensions :: Objectify ............. SUCCESS [ 27.423 s]
[INFO] gwt-jackson :: Extensions :: Remote Logging ........ SUCCESS [ 22.288 s]
[INFO] gwt-jackson :: Examples ............................ SUCCESS [  0.241 s]
[INFO] gwt-jackson :: Examples :: Minimal ................. SUCCESS [ 11.884 s]
[INFO] gwt-jackson :: Examples :: Hello World ............. SUCCESS [ 15.610 s]
[INFO] gwt-jackson :: Examples :: GWTP .................... SUCCESS [ 17.687 s]
[INFO] gwt-jackson :: Examples :: Requestor ............... SUCCESS [ 19.848 s]
[INFO] gwt-jackson :: Examples :: RestyGWT ................ SUCCESS [ 16.277 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  02:47 min
[INFO] Finished at: 2020-05-19T09:36:53-05:00
[INFO] ------------------------------------------------------------------------


Changes I made to run this:

diff --git a/extensions/guava/pom.xml b/extensions/guava/pom.xml
index 99e928a..739b629 100644
--- a/extensions/guava/pom.xml
+++ b/extensions/guava/pom.xml
@@ -29,7 +29,7 @@
   <description>Extension to support Guava types like Optional or ImmutableSet</description>
 
   <properties>
-    <guava.version>19.0</guava.version>
+    <guava.version>29.0-jre</guava.version>
   </properties>
 
   <dependencies>
diff --git a/pom.xml b/pom.xml
index 8eb1f1d..6250ad4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -86,10 +86,10 @@
     <maven-deploy-plugin.version>2.8.1</maven-deploy-plugin.version>
     <maven-jar-plugin.version>2.4</maven-jar-plugin.version>
     <maven-javadoc-plugin.version>2.10.4</maven-javadoc-plugin.version>
-    <gwt-maven-plugin.version>2.7.0</gwt-maven-plugin.version>
+    <gwt-maven-plugin.version>2.8.2</gwt-maven-plugin.version>
 
     <!-- Dependencies version -->
-    <gwt.version>2.7.0</gwt.version>
+    <gwt.version>2.9.0</gwt.version>
     <jackson.version>2.10.1</jackson.version>
     <javapoet.version>1.0.0</javapoet.version>
     <junit.version>4.12</junit.version>
@@ -201,6 +201,7 @@
             <testTimeOut>1000</testTimeOut>
             <!--Only required due to a GWT DateTimeFormat issue see https://github.com/gwtproject/gwt/issues/8259-->
             <extraJvmArgs>-Duser.timezone=UTC</extraJvmArgs>
+            <sourceLevel>1.8</sourceLevel>
           </configuration>
           <dependencies>
             <dependency>


So I don't think this is intrinsic to GWT 2.9.0 or gwt-jackson - can you verify that gwt-jackson itself doesn't have this issue for you?

The one "compiler mysteriously breaks" issue I'm aware of in GWT 2.9.0 is to do with gwt-unitCache not being removed when you change sourceLevel, but perhaps there is another case we are missing - you could try deleting this directory (it usually lives next to the war/ dir) and see if this resolves your issue. If so, we'd like a little more detail on how you ran your project before/after so that we can more completely solve this.

-Colin

On Saturday, May 16, 2020 at 5:00:54 AM UTC-5, David Nouls wrote:
Compiling module com.swift.cloud.platform.multitenant.event.SerializationTest.JUnit
   Resolving com.fasterxml.jackson.annotation.JacksonAnnotation
      Found type 'com.fasterxml.jackson.annotation.JacksonAnnotation'
         [WARN] Unable to resolve interface java/lang/annotation/Annotation
   Resolving com.fasterxml.jackson.annotation.JacksonAnnotationsInside
      Found type 'com.fasterxml.jackson.annotation.JacksonAnnotationsInside'
         [WARN] Unable to resolve interface java/lang/annotation/Annotation
   Resolving com.fasterxml.jackson.annotation.JsonAnyGetter
      Found type 'com.fasterxml.jackson.annotation.JsonAnyGetter'
         [WARN] Unable to resolve interface java/lang/annotation/Annotation
   Resolving com.fasterxml.jackson.annotation.JsonAnySetter
      Found type 'com.fasterxml.jackson.annotation.JsonAnySetter'
         [WARN] Unable to resolve interface java/lang/annotation/Annotation
   Resolving com.fasterxml.jackson.annotation.JsonCreator
      Found type 'com.fasterxml.jackson.annotation.JsonCreator'
         [WARN] Unable to resolve interface java/lang/annotation/Annotation
   Resolving com.fasterxml.jackson.annotation.JsonCreator.Mode
      Found type 'com.fasterxml.jackson.annotation.JsonCreator.Mode'
         [ERROR] Unable to find class java/lang/Enum
Compiling module com.swift.cloud.platform.multitenant.event.SerializationTest.JUnit
   Resolving com.fasterxml.jackson.annotation.JacksonAnnotation
      Found type 'com.fasterxml.jackson.annotation.JacksonAnnotation'
         [WARN] Unable to resolve interface java/lang/annotation/Annotation
   Resolving com.fasterxml.jackson.annotation.JacksonAnnotationsInside
      Found type 'com.fasterxml.jackson.annotation.JacksonAnnotationsInside'
         [WARN] Unable to resolve interface java/lang/annotation/Annotation
   Resolving com.fasterxml.jackson.annotation.JsonAnyGetter
      Found type 'com.fasterxml.jackson.annotation.JsonAnyGetter'
         [WARN] Unable to resolve interface java/lang/annotation/Annotation
   Resolving com.fasterxml.jackson.annotation.JsonAnySetter
      Found type 'com.fasterxml.jackson.annotation.JsonAnySetter'
         [WARN] Unable to resolve interface java/lang/annotation/Annotation
   Resolving com.fasterxml.jackson.annotation.JsonCreator
      Found type 'com.fasterxml.jackson.annotation.JsonCreator'
         [WARN] Unable to resolve interface java/lang/annotation/Annotation
   Resolving com.fasterxml.jackson.annotation.JsonCreator.Mode
      Found type 'com.fasterxml.jackson.annotation.JsonCreator.Mode'
         [ERROR] Unable to find class java/lang/Enum
Compiling module com.swift.cloud.platform.multitenant.event.SerializationTest.JUnit
   Resolving com.fasterxml.jackson.annotation.JacksonAnnotation
      Found type 'com.fasterxml.jackson.annotation.JacksonAnnotation'
         [WARN] Unable to resolve interface java/lang/annotation/Annotation
   Resolving com.fasterxml.jackson.annotation.JacksonAnnotationsInside
      Found type 'com.fasterxml.jackson.annotation.JacksonAnnotationsInside'
         [WARN] Unable to resolve interface java/lang/annotation/Annotation
   Resolving com.fasterxml.jackson.annotation.JsonAnyGetter
      Found type 'com.fasterxml.jackson.annotation.JsonAnyGetter'
         [WARN] Unable to resolve interface java/lang/annotation/Annotation
   Resolving com.fasterxml.jackson.annotation.JsonAnySetter
      Found type 'com.fasterxml.jackson.annotation.JsonAnySetter'
         [WARN] Unable to resolve interface java/lang/annotation/Annotation
   Resolving com.fasterxml.jackson.annotation.JsonCreator
      Found type 'com.fasterxml.jackson.annotation.JsonCreator'
         [WARN] Unable to resolve interface java/lang/annotation/Annotation
   Resolving com.fasterxml.jackson.annotation.JsonCreator.Mode
      Found type 'com.fasterxml.jackson.annotation.JsonCreator.Mode'
         [ERROR] Unable to find class java/lang/Enum


--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit/cde29480-a9fc-4deb-9e07-c17429dd4a0b%40googlegroups.com.

No comments:

Post a Comment