uber / uReplicator

Improvement of Apache Kafka Mirrormaker
Apache License 2.0
917 stars 199 forks source link

Error while compiling on Ubuntu Bionic #157

Open josephmc5 opened 6 years ago

josephmc5 commented 6 years ago

uReplicator compiles fine on an older version (Xenial) but fails in Bionic.

[INFO] Compiling 7 source files to ~/uReplicator/uReplicator-Worker/target/classes at 1540231220956
Downloading from maven-restlet: http://maven.restlet.org/org/scala-lang/scala-library/2.11.4/scala-library-2.11.4.jar
Downloading from central: https://repo.maven.apache.org/maven2/org/scala-lang/scala-library/2.11.4/scala-library-2.11.4.jar
Downloaded from central: https://repo.maven.apache.org/maven2/org/scala-lang/scala-library/2.11.4/scala-library-2.11.4.jar (5.5 MB at 7.6 MB/s)
Downloading from maven-restlet: http://maven.restlet.org/org/scala-lang/scala-library/2.11.6/scala-library-2.11.6.jar
Downloading from central: https://repo.maven.apache.org/maven2/org/scala-lang/scala-library/2.11.6/scala-library-2.11.6.jar
Downloaded from central: https://repo.maven.apache.org/maven2/org/scala-lang/scala-library/2.11.6/scala-library-2.11.6.jar (5.6 MB at 7.1 MB/s)
[ERROR] error: scala.reflect.internal.MissingRequirementError: object java.lang.Object in compiler mirror not found.
[ERROR]     at scala.reflect.internal.MissingRequirementError$.signal(MissingRequirementError.scala:17)
[ERROR]     at scala.reflect.internal.MissingRequirementError$.notFound(MissingRequirementError.scala:18)
[INFO]  at scala.reflect.internal.Mirrors$RootsBase.getModuleOrClass(Mirrors.scala:53)
[INFO]  at scala.reflect.internal.Mirrors$RootsBase.getModuleOrClass(Mirrors.scala:45)
[INFO]  at scala.reflect.internal.Mirrors$RootsBase.getModuleOrClass(Mirrors.scala:45)
[INFO]  at scala.reflect.internal.Mirrors$RootsBase.getModuleOrClass(Mirrors.scala:66)
[INFO]  at scala.reflect.internal.Mirrors$RootsBase.getClassByName(Mirrors.scala:102)
[INFO]  at scala.reflect.internal.Mirrors$RootsBase.getRequiredClass(Mirrors.scala:105)
[INFO]  at scala.reflect.internal.Definitions$DefinitionsClass.ObjectClass$lzycompute(Definitions.scala:257)
[INFO]  at scala.reflect.internal.Definitions$DefinitionsClass.ObjectClass(Definitions.scala:257)
[INFO]  at scala.reflect.internal.Definitions$DefinitionsClass.init(Definitions.scala:1394)
[INFO]  at scala.tools.nsc.Global$Run.<init>(Global.scala:1215)
[INFO]  at scala.tools.nsc.Driver.doCompile(Driver.scala:31)
[INFO]  at scala.tools.nsc.MainClass.doCompile(Main.scala:23)
[INFO]  at scala.tools.nsc.Driver.process(Driver.scala:51)
[INFO]  at scala.tools.nsc.Driver.main(Driver.scala:64)
[INFO]  at scala.tools.nsc.Main.main(Main.scala)
[INFO]  at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[INFO]  at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[INFO]  at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[INFO]  at java.base/java.lang.reflect.Method.invoke(Method.java:564)
[INFO]  at org_scala_tools_maven_executions.MainHelper.runMain(MainHelper.java:161)
[INFO]  at org_scala_tools_maven_executions.MainWithArgsInFile.main(MainWithArgsInFile.java:26)
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] uReplicator ........................................ SUCCESS [  2.301 s]
[INFO] uReplicator-Controller ............................. SUCCESS [ 58.926 s]
[INFO] uReplicator-Worker ................................. FAILURE [ 23.520 s]
[INFO] uReplicator-Distribution ........................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:25 min
[INFO] Finished at: 2018-10-22T11:00:23-07:00
[INFO] Final Memory: 100M/725M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.scala-tools:maven-scala-plugin:2.14.1:compile (scala-compile-first) on project uReplicator-Worker: wrap: org.apache.commons.exec.ExecuteException: Process exited with an error: 1(Exit value: 1) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :uReplicator-Worker
$ java -version
openjdk version "10.0.2" 2018-07-17
OpenJDK Runtime Environment (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.2)
OpenJDK 64-Bit Server VM (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.2, mixed mode)
guthyerrz commented 5 years ago

Using the Java 8 version of OpenJDK resolved this issue for me.

sudo update-alternatives --config java
sudo update-alternatives --config javac

Source: https://stackoverflow.com/questions/38602889/failed-to-initialize-compiler-object-java-lang-object-in-compiler-mirror-not-fo

ocontant commented 5 years ago

[WARNING] Expected all dependencies to require Scala version: 2.11.8 [WARNING] com.uber.uReplicator:uReplicator-Worker:1.0.0-SNAPSHOT requires scala version: 2.11.8 [WARNING] org.scala-lang:scala-compiler:2.11.8 requires scala version: 2.11.8 [WARNING] org.scala-lang:scala-reflect:2.11.8 requires scala version: 2.11.8 [WARNING] org.scala-lang.modules:scala-xml_2.11:1.0.4 requires scala version: 2.11.4 [WARNING] Multiple versions of scala libraries detected!

Running in error when running : mvn clean package INFO] uReplicator ........................................ SUCCESS [ 0.417 s] [INFO] uReplicator-Common ................................. SUCCESS [ 39.068 s] [INFO] uReplicator-Controller ............................. SUCCESS [ 30.489 s]

[INFO] uReplicator-Worker ................................. FAILURE [ 2.776 s]

[INFO] uReplicator-Manager ................................ SKIPPED [INFO] uReplicator-Distribution ........................... SKIPPED [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 01:13 min [INFO] Finished at: 2019-07-22T14:09:09+04:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.scala-tools:maven-scala-plugin:2.14.1:compile (scala-compile-first) on project uReplicator-Worker: wrap: org.apache.commons.exec.ExecuteException: Process exited with an error: 1(Exit value: 1) -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.scala-tools:maven-scala-plugin:2.14.1:compile (scala-compile-first) on project uReplicator-Worker: wrap: org.apache.commons.exec.ExecuteException: Process exited with an error: 1(Exit value: 1)

Release 1.0 and running into error with latest default-jdk on Ubuntu. java --version openjdk 11.0.3 2019-04-16 OpenJDK Runtime Environment (build 11.0.3+7-Ubuntu-1ubuntu219.04.1) OpenJDK 64-Bit Server VM (build 11.0.3+7-Ubuntu-1ubuntu219.04.1, mixed mode, sharing)