gwt 2.8 throws exception when compiling with guava 20 - gwt

I am trying to upgrade to the newly released guava-gwt 20. I am getting this exception when I do a gwt compile. I did not get any errors prior to upgrading to guava 20. I am using the gwt 2.8.0. Is there a module I need to reference? Much appreciated!
[INFO] Tracing compile failure path for type 'java.util.concurrent.Future'
[INFO] [ERROR] Errors in 'jar:file:/Users/Eric/.m2/repository/com/google/guava/guava-gwt/20.0/guava-gwt-20.0.jar!/java/util/super/java/util/concurrent/Future.java'
[INFO] [ERROR] Line 32: No source code is available for type java.lang.InterruptedException; did you forget to inherit a required module?
[INFO] Tracing compile failure path for type 'java.util.concurrent.CountDownLatch'
[INFO] [ERROR] Errors in 'jar:file:/Users/Eric/.m2/repository/com/google/guava/guava-gwt/20.0/guava-gwt-20.0.jar!/java/util/super/java/util/concurrent/CountDownLatch.java'
[INFO] [ERROR] Line 30: No source code is available for type java.lang.InterruptedException; did you forget to inherit a required module?
[INFO] [ERROR] Aborting compile due to errors in some input files

This appears to be a Guava bug. Until we fix it, you can work around it by adding <inherits name="java.lang.Lang"/> to your .gwt.xml.

Related

"Referring to non-existent method org.scalatest.Matchers.convertToAnyShouldWrapper" after upgrading scalatest to 3.1.4

I've scala and scalajs project and it is in github for reference.
Initially I've scalatest version 3.0.3 and scalacheck version 1.13.5. The command sbt clean test is working fine.
I've updated scalatest version to 3.1.4 and scalacheck version 1.14.3.
After this updated scala project tests are working fine but scalajs tests are not.
The error I'm getting is
[info] Fast optimizing /Users/rajkumar.natarajan/Documents/Coding/misc/sjs-test-error/core/js/target/scala-2.12/reftree-test-fastopt.js
[error] Referring to non-existent method org.scalatestplus.scalacheck.ScalaCheckConfiguration.$$init$()scala.Unit
[error] called from generic.RefTreeSpec.()
[error] called from generic.RefTreeSpec.()
[error] called from core module analyzer
[error] Referring to non-existent method org.scalatestplus.scalacheck.ScalaCheckDrivenPropertyChecks.$$init$()scala.Unit
[error] called from generic.RefTreeSpec.()
[error] called from generic.RefTreeSpec.()
[error] called from core module analyzer
[error] There were linking errors
[error] (coreJS / Test / fastOptJS) There were linking errors
[error] Total time: 31 s, completed Jun 9, 2021, 5:54:57 PM
The changes are in this commit.
I tried to figure out but I'm novice in scalajs. Is there anything extra I need to do to work correctly?
In your diff, at https://github.com/rajcspsg/sjs-test-error/commit/bb3f00cc542b29998af271530dccae9b73f2ad00#diff-5634c415cd8c8504fdb973a3ed092300b43c4b8fc1e184f7249eb29a55511f91R33, you have a dependency on
"org.scalatestplus" %% "scalacheck-1-14" % "3.1.3.0" % Test
which uses %%. This is a dependency on a JVM artifact, which brings the JVM version of its own dependencies. You end up with two versions of ScalaTest on your classpath: one for the JVM and one for JS. With bad luck, the one for the JVM gets selected, and therefore shadows the one for JS. This results in the linking errors that you get.
You can fix this by using %%% instead of %% in that dependency, assuming that that library is available for Scala.js. If it isn't, you'll have to find a way not to need that dependency at all.

No source code is available for type <xyz>; did you forget to inherit a required module?

I'm trying to add a dependency to my GWT project. The problem is that I am getting the following error:
[INFO] --- gwt-maven-plugin:1.0-beta-2:codeserver (default-cli) # mahlzeit-web ---
[INFO] Turning off precompile in incremental mode.
[INFO] Super Dev Mode starting up
[INFO] workDir: E:\java\mahlzeit-web\mahlzeit-web\target\gwt\codeserver
[INFO] Loading Java files in com.mahlzeit.web.App.
[INFO] Tracing compile failure path for type 'com.mahlzeit.web.GoogleCalendarPanel'
[INFO] [ERROR] Errors in 'file:/E:/java/mahlzeit-web/mahlzeit-web/mahlzeit-web-client/src/main/java/com/mahlzeit/web/GoogleCalendarPanel.java'
[INFO] [ERROR] Line 54: No source code is available for type com.bradrydzewski.gwt.calendar.client.Calendar; did you forget to inherit a required module?
[INFO] [ERROR] Line 161: No source code is available for type com.bradrydzewski.gwt.calendar.client.event.DeleteHandler<T>; did you forget to inherit a required module?
[INFO] [ERROR] Line 162: No source code is available for type com.bradrydzewski.gwt.calendar.client.event.DeleteEvent<T>; did you forget to inherit a required module?
I know I would have to add something like <source ...> to my App.gwt.xml file but that is generated. I am using the gwt-maven-archetypes in Eclipse.
How can I add this dependency s.t. the GWT Compiler finds the sources in the library .jar file?
You need to add the appropriate <inherits/> to your src/main/module.gwt.xml.
The plugin will only generate those inherits for JARs that contain a META-INF/gwt/mainModule (if that's what you mean by "that is generated"), i.e. almost none of them.

GWT Compilation error with GWT 2.5

I am trying to compile a GWT project but I am getting the following error: Can anyone please explain if I am missing anything? I have downloaded the GWT plugins for the eclipse.
Compiling module com.nolij.nolijweb.ui.entrypoint.user.UserInterface Validating units:
Ignored 28 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
[ERROR] Errors in 'com/google/gwt/core/client/GWTBridge.java'
[ERROR] Line 25: No source code is available for type com.google.gwt.core.shared.GWTBridge; did you forget to inherit a required module?
[ERROR] Unable to find type 'com.nolij.nolijweb.ui.entrypoint.user.client.UserInterface'
[ERROR] Hint: Previous compiler errors may have made this type unavailable
[ERROR] Hint: Check the inheritance chain from your module; it may not be inheriting a required module or a module may not be adding its source path entries properly

Casbah MongoDB driver compiler error

I'm using the Casbah driver for MongoDB and while I compiled my project, it fails with the following error:
[INFO] Compiling 12 source files to /core/target/classes at 1394903201140
[ERROR] error: bad symbolic reference. A signature in MongoClient.class refers to type MongoClientURI
[INFO] in package com.mongodb which is not available.
[INFO] It may be completely missing from the current classpath, or the version on
[INFO] the classpath might be incompatible with the version used when compiling MongoClient.class.
[ERROR] error: bad symbolic reference. A signature in MongoClient.class refers to type MongoClient
[INFO] in package com.mongodb which is not available.
[INFO] It may be completely missing from the current classpath, or the version on
[INFO] the classpath might be incompatible with the version used when compiling MongoClient.class.
[ERROR] two errors found
I'm having the following setup as my maven dependency:
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>casbah_2.10</artifactId>
<version>2.7.0-RC2</version>
</dependency>
Why would it now fail during compilation? Any clues what to look for or what to change? Additionally, I also see the following warnings:
[WARNING] Expected all dependencies to require Scala version: 2.10.3
[WARNING] org.mongodb:casbah_2.10:2.7.0-RC2 requires scala version: 2.10.3
[WARNING] org.mongodb:casbah-commons_2.10:2.7.0-RC2 requires scala version: 2.10.3
[WARNING] com.github.nscala-time:nscala-time_2.10:0.6.0 requires scala version: 2.10.2
Has this got any relation to the compilation failure? Additionally, I ran maven in debug mode and this is what I see in my classpath:
[DEBUG] Classpath: [/../../target/classes
/Softwares/maven-repo/org/scala-lang/scala-library/2.10.3/scala-library-2.10.3.jar
/Softwares/maven-repo/org/mongodb/casbah-commons_2.10/2.7.0-RC2/casbah-commons_2.10-2.7.0-RC2.jar
/Softwares/maven-repo/com/github/nscala-time/nscala-time_2.10/0.6.0/nscala-time_2.10-0.6.0.jar
/Softwares/maven-repo/org/joda/joda-convert/1.2/joda-convert-1.2.jar
/Softwares/maven-repo/org/slf4j/slf4j-api/1.6.0/slf4j-api-1.6.0.jar
/Softwares/maven-repo/org/mongodb/casbah-core_2.10/2.7.0-RC2/casbah-core_2.10-2.7.0-RC2.jar
/Softwares/maven-repo/org/mongodb/casbah-query_2.10/2.7.0-RC2/casbah-query_2.10-2.7.0-RC2.jar
/Softwares/maven-repo/org/mongodb/casbah-gridfs_2.10/2.7.0-RC2/casbah-gridfs_2.10-2.7.0-RC2.jar
/Softwares/maven-repo/com/novus/salat-core_2.9.2/0.0.8/salat-core_2.9.2-0.0.8.jar
/Softwares/maven-repo/com/novus/salat-util_2.9.2/0.0.8/salat-util_2.9.2-0.0.8.jar
/Softwares/maven-repo/org/scala-lang/scalap/2.9.2/scalap-2.9.2.jar
/Softwares/maven-repo/org/scala-lang/scala-compiler/2.9.2/scala-compiler-2.9.2.jar
/Softwares/maven-repo/org/mongodb/mongo-java-driver/2.7.3/mongo-java-driver-2.7.3.jar
/Softwares/maven-repo/com/mongodb/casbah/casbah-core_2.9.1/2.1.5-1/casbah-core_2.9.1-2.1.5-1.jar
/Softwares/maven-repo/com/mongodb/casbah/casbah-commons_2.9.1/2.1.5-1/casbah-commons_2.9.1-2.1.5-1.jar
/Softwares/maven-repo/org/scala-tools/time/time_2.9.1/0.5/time_2.9.1-0.5.jar
/Softwares/maven-repo/org/scalaj/scalaj-collection_2.9.1/1.2/scalaj-collection_2.9.1-1.2.jar
/Softwares/maven-repo/com/mongodb/casbah/casbah-query_2.9.1/2.1.5-1/casbah-query_2.9.1-2.1.5-1.jar
/Softwares/maven-repo/net/liftweb/lift-json_2.9.1/2.4/lift-json_2.9.1-2.4.jar
/Softwares/maven-repo/com/thoughtworks/paranamer/paranamer/2.3/paranamer-2.3.jar
/Softwares/maven-repo/com/typesafe/config/1.0.2/config-1.0.2.jar
/Softwares/maven-repo/joda-time/joda-time/2.3/joda-time-2.3.jar]
I do not understand from where did the other dependencies especially the ones like casbah-core_2.9.1, casbah-query_2.9.1 make it to my classpath? I do not have them as my maven dependencies in my pom.xml! It is confusing.
I figured out what the problem is. I had an additional dependency to the salat framework that I do not use nut somehow was added during evaluation. It actually was pulling in those additional jar files into the classpath which actually seems to be the reason for this error!

GWT Compile error:

I created a service, async, impl for an rpc service. However, when I go to do the gwt compile (I'm using Eclispe Indigo with the gwt 2.4 plugin) I'm getting these errors:
Compile with -strict or with -logLevel set to TRACE or DEBUG to see all errors.
Scanning for additional dependencies: file:/C:/.../client/activity/CalculatorActivity.java
Computing all possible rebind results for '...Calculator.client.CalculatorService'
Rebinding com... CalculatorService
Checking rule
[ERROR] Errors in 'file:/...Calcuator/src/...Calculator/client/CalculatorService.java'
[ERROR] Line 17: No source code is available for type java.io.InputStream; did you forget to inherit a required module?
[ERROR] Unable to find type '...Calculator.client.CalculatorService'
[ERROR] Hint: Previous compiler errors may have made this type unavailable
[ERROR] Hint: Check the inheritance chain from your module; it may not be inheriting a required module or a module may not be adding its source path entries properly
[ERROR] Errors in 'file:/...Calculator/client/activity/CalculatorActivity.java'
[ERROR] Line 59: Failed to resolve '...CalculatorService' via deferred binding
[ERROR] Cannot proceed due to previous errors
I'm not sure what is causing this? I'm not getting any compile errors under Eclipse, but something isn't setup right for the RPC service apparently.
Any ideas as to what the problem is?
It seems, you use the InputStream class somewhere in your client side code. But in client side code you are restricted to the classes mentioned in the JRE Emulation Reference.