Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error trying to compile examples project: scala.reflect.internal.MissingRequirementError #160

Closed
yonigibbs opened this issue Sep 7, 2018 · 7 comments

Comments

@yonigibbs
Copy link

Hi,

I just cloned the kafka-streams-examples project and am trying to compile it but getting this error:

scala.reflect.internal.MissingRequirementError

I noticed that I had some missing files, as described in this issue, so tried following the steps there, but it made no difference.

Here are the steps I took:

$ git clone https://github.com/confluentinc/kafka-streams-examples.git .

At this point I checked what branch I was on, as mentioned in issue 144:

$ git branch
* 5.0.0-post

Then I ran this:

$ mvn clean install -Dmaven.test.skip=true
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:/usr/share/maven/lib/guice.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Detecting the operating system and CPU architecture
[INFO] ------------------------------------------------------------------------
[INFO] os.detected.name: linux
[INFO] os.detected.arch: x86_64
[INFO] os.detected.version: 4.15
[INFO] os.detected.version.major: 4
[INFO] os.detected.version.minor: 15
[INFO] os.detected.release: ubuntu
[INFO] os.detected.release.version: 18.04
[INFO] os.detected.release.like.ubuntu: true
[INFO] os.detected.release.like.debian: true
[INFO] os.detected.classifier: linux-x86_64
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] Building kafka-streams-examples 5.0.0
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:3.0.0:clean (default-clean) @ kafka-streams-examples ---
[INFO] 
[INFO] --- maven-checkstyle-plugin:2.17:check (validate) @ kafka-streams-examples ---
[INFO] 
[INFO] --- maven-enforcer-plugin:3.0.0-M1:enforce (enforce-versions) @ kafka-streams-examples ---
[INFO] 
[INFO] --- build-helper-maven-plugin:1.10:add-source (add-source) @ kafka-streams-examples ---
[INFO] Source directory: /home/yoni/work/github/confluentinc/kafka-streams-examples-2/src/main/scala added.
[INFO] Source directory: /home/yoni/work/github/confluentinc/kafka-streams-examples-2/target/generated-sources added.
[INFO] 
[INFO] --- avro-maven-plugin:1.8.2:schema (default) @ kafka-streams-examples ---
[INFO] 
[INFO] --- maven-resources-plugin:3.0.2:resources (default-resources) @ kafka-streams-examples ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 15 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.3:compile (default-compile) @ kafka-streams-examples ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 68 source files to /home/yoni/work/github/confluentinc/kafka-streams-examples-2/target/classes
[INFO] /home/yoni/work/github/confluentinc/kafka-streams-examples-2/src/main/java/io/confluent/examples/streams/SumLambdaExampleDriver.java: Some input files use or override a deprecated API.
[INFO] /home/yoni/work/github/confluentinc/kafka-streams-examples-2/src/main/java/io/confluent/examples/streams/SumLambdaExampleDriver.java: Recompile with -Xlint:deprecation for details.
[INFO] /home/yoni/work/github/confluentinc/kafka-streams-examples-2/src/main/java/io/confluent/examples/streams/microservices/domain/Schemas.java: Some input files use unchecked or unsafe operations.
[INFO] /home/yoni/work/github/confluentinc/kafka-streams-examples-2/src/main/java/io/confluent/examples/streams/microservices/domain/Schemas.java: Recompile with -Xlint:unchecked for details.
[INFO] 
[INFO] --- scala-maven-plugin:3.2.1:compile (default) @ kafka-streams-examples ---
[INFO] /home/yoni/work/github/confluentinc/kafka-streams-examples-2/src/main/java:-1: info: compiling
[INFO] /home/yoni/work/github/confluentinc/kafka-streams-examples-2/src/main/scala:-1: info: compiling
[INFO] /home/yoni/work/github/confluentinc/kafka-streams-examples-2/target/generated-sources:-1: info: compiling
[INFO] /home/yoni/work/github/confluentinc/kafka-streams-examples-2/target/generated-sources/annotations:-1: info: compiling
[INFO] Compiling 75 source files to /home/yoni/work/github/confluentinc/kafka-streams-examples-2/target/classes at 1536317738525
[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)
[ERROR]         at scala.reflect.internal.Mirrors$RootsBase.getModuleOrClass(Mirrors.scala:53)
[ERROR]         at scala.reflect.internal.Mirrors$RootsBase.getModuleOrClass(Mirrors.scala:45)
[ERROR]         at scala.reflect.internal.Mirrors$RootsBase.getModuleOrClass(Mirrors.scala:45)
[ERROR]         at scala.reflect.internal.Mirrors$RootsBase.getModuleOrClass(Mirrors.scala:66)
[ERROR]         at scala.reflect.internal.Mirrors$RootsBase.getClassByName(Mirrors.scala:102)
[ERROR]         at scala.reflect.internal.Mirrors$RootsBase.getRequiredClass(Mirrors.scala:105)
[ERROR]         at scala.reflect.internal.Definitions$DefinitionsClass.ObjectClass$lzycompute(Definitions.scala:257)
[ERROR]         at scala.reflect.internal.Definitions$DefinitionsClass.ObjectClass(Definitions.scala:257)
[ERROR]         at scala.reflect.internal.Definitions$DefinitionsClass.init(Definitions.scala:1394)
[ERROR]         at scala.tools.nsc.Global$Run.<init>(Global.scala:1215)
[ERROR]         at scala.tools.nsc.Driver.doCompile(Driver.scala:31)
[ERROR]         at scala.tools.nsc.MainClass.doCompile(Main.scala:23)
[ERROR]         at scala.tools.nsc.Driver.process(Driver.scala:51)
[ERROR]         at scala.tools.nsc.Driver.main(Driver.scala:64)
[ERROR]         at scala.tools.nsc.Main.main(Main.scala)
[ERROR]         at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR]         at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[ERROR]         at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR]         at java.base/java.lang.reflect.Method.invoke(Method.java:564)
[ERROR]         at scala_maven_executions.MainHelper.runMain(MainHelper.java:164)
[ERROR]         at scala_maven_executions.MainWithArgsInFile.main(MainWithArgsInFile.java:26)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.386 s
[INFO] Finished at: 2018-09-07T11:55:39+01:00
[INFO] Final Memory: 44M/154M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal net.alchim31.maven:scala-maven-plugin:3.2.1:compile (default) on project kafka-streams-examples: 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

In case it's of any use, here's two other bits of info:

$ java -version
openjdk version "10.0.2" 2018-07-17
OpenJDK Runtime Environment (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.1)
OpenJDK 64-Bit Server VM (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.1, mixed mode)
$ scala -version
Scala code runner version 2.11.12 -- Copyright 2002-2017, LAMP/EPFL

Thanks.

@mjsax
Copy link
Member

mjsax commented Sep 7, 2018

I am on different versions (on Mac):

$ java -version
java version "1.8.0_102"
Java(TM) SE Runtime Environment (build 1.8.0_102-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.102-b14, mixed mode)
$ scala -version
Scala code runner version 2.12.6 -- Copyright 2002-2018, LAMP/EPFL and Lightbend, Inc.

It compiles for me. Can you try a different Java/Scala version?

@yonigibbs
Copy link
Author

Excellent, that fixed it, thanks very much! I installed JDK 8 and swapped to use that, and the mvn cmd line now works.

Would you like me to mark this issue as closed, or keep it as an open issue because the examples didn't work for me on Linux on JDK 10?

Note, however, that the classes that are missing, as described in issue 144, are still missing when I open the project in the IDE (IntelliJ in my case). I'll add a comment to that issue.

@mjsax
Copy link
Member

mjsax commented Sep 10, 2018

\cc @ybyzek @miguno What is the goal for the examples? Should they work with Java10, too?

If yes, we might want to add Java10 to the build, too.

@guozhangwang
Copy link
Contributor

@yonigibbs I think your observed issue is due to scala 2.11.11 and below's plugin does not work well with Java10: scala/scala-dev#139 (comment)

@guozhangwang
Copy link
Contributor

@mjsax based on what I've got so far, we probably just need to document that if you're using J9+, you'd need to use Scala 2.12+.

@guozhangwang
Copy link
Contributor

Filed #167 for this.

@yonigibbs
Copy link
Author

Thanks for looking at this, @guozhangwang. I upgraded to 2.12.6 of Scala, but no luck I'm afraid: same error as above. I re-cloned the repo into a new folder in case that made a difference but it didn't.

However for my requirements it doesn't really matter: I just wanted to get the examples up and running, and using JDK8 instead of 10 for this is fine for me. So no need to re-open this case as far as I'm concerned.

Thanks again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants