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

IllegalArgumentException thrown in analysis of Java compiled with --add-exports #837

Open
mnd999 opened this issue Jul 14, 2020 · 2 comments

Comments

@mnd999
Copy link

mnd999 commented Jul 14, 2020

Hopefully I'm in the right place. I've been looking at improving the Maven support in bloop for a project I'm working on. One of the Java modules in this project is hacking the module system using --add-exports which then seems to trip up in zinc when it tries the analysis step on the class that Javac spits out.

Essentially I'm getting this trace, which gets through javac with a warning because of the specific --add-exports jdk.javadoc/jdk.javadoc.internal.tool=ALL-UNNAMED passed in on the command line.

[E] Unexpected error when compiling annotations: 'superclass access check failed: class org.neo4j.annotations.api.PublicApiDoclet$FilteringDocletEnvironment (in unnamed module @0x7c9a7643) cannot access class jdk.javadoc.internal.tool.DocEnvImpl (in module jdk.javadoc) because module jdk.javadoc does not export jdk.javadoc.internal.tool to unnamed module @0x7c9a7643'
[T] java.lang.IllegalAccessError: superclass access check failed: class org.neo4j.annotations.api.PublicApiDoclet$FilteringDocletEnvironment (in unnamed module @0x7c9a7643) cannot access class jdk.javadoc.internal.tool.DocEnvImpl (in module jdk.javadoc) because module jdk.javadoc does not export jdk.javadoc.internal.tool to unnamed module @0x7c9a7643
[T]     java.base/java.lang.ClassLoader.defineClass1(Native Method)
[T]     java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017)
[T]     java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174)
[T]     java.base/java.net.URLClassLoader.defineClass(URLClassLoader.java:550)
[T]     java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:458)
[T]     java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:452)
[T]     java.base/java.security.AccessController.doPrivileged(Native Method)
[T]     java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:451)
[T]     java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:589)
[T]     java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
[T]     java.base/java.lang.Class.getDeclaredClasses0(Native Method)
[T]     java.base/java.lang.Class.getDeclaredClasses(Class.java:2196)
[T]     sbt.internal.inc.ClassToAPI$.structure(ClassToAPI.scala:184)
[T]     sbt.internal.inc.ClassToAPI$.x$2$lzycompute$1(ClassToAPI.scala:130)
[T]     sbt.internal.inc.ClassToAPI$.x$2$1(ClassToAPI.scala:130)
[T]     sbt.internal.inc.ClassToAPI$.instance$lzycompute$1(ClassToAPI.scala:130)
[T]     sbt.internal.inc.ClassToAPI$.instance$1(ClassToAPI.scala:130)
[T]     sbt.internal.inc.ClassToAPI$.$anonfun$toDefinitions0$1(ClassToAPI.scala:137)
[T]     xsbti.api.SafeLazyProxy$$anon$1.get(SafeLazyProxy.scala:30)
[T]     xsbti.api.SafeLazy$Impl.get(SafeLazy.java:64)
[T]     sbt.internal.inc.ClassToAPI$.$anonfun$process$2(ClassToAPI.scala:32)
[T]     scala.collection.immutable.List.foreach(List.scala:392)
[T]     scala.collection.generic.TraversableForwarder.foreach(TraversableForwarder.scala:38)
[T]     scala.collection.generic.TraversableForwarder.foreach$(TraversableForwarder.scala:38)
[T]     scala.collection.mutable.ListBuffer.foreach(ListBuffer.scala:47)
[T]     sbt.internal.inc.ClassToAPI$.process(ClassToAPI.scala:32)
[T]     sbt.internal.inc.javac.AnalyzingJavaCompiler.readAPI$1(AnalyzingJavaCompiler.scala:169)
[T]     sbt.internal.inc.javac.AnalyzingJavaCompiler.$anonfun$compile$20(AnalyzingJavaCompiler.scala:190)
[T]     sbt.internal.inc.classfile.Analyze$.readInheritanceDependencies$1(Analyze.scala:179)
[T]     sbt.internal.inc.classfile.Analyze$.$anonfun$apply$15(Analyze.scala:185)
[T]     sbt.internal.inc.classfile.Analyze$.$anonfun$apply$15$adapted(Analyze.scala:99)
[T]     scala.collection.TraversableLike$WithFilter.$anonfun$foreach$1(TraversableLike.scala:912)
[T]     scala.collection.mutable.HashMap.$anonfun$foreach$1(HashMap.scala:149)
[T]     scala.collection.mutable.HashTable.foreachEntry(HashTable.scala:237)
[T]     scala.collection.mutable.HashTable.foreachEntry$(HashTable.scala:230)
[T]     scala.collection.mutable.HashMap.foreachEntry(HashMap.scala:44)
[T]     scala.collection.mutable.HashMap.foreach(HashMap.scala:149)
[T]     scala.collection.TraversableLike$WithFilter.foreach(TraversableLike.scala:911)
[T]     sbt.internal.inc.classfile.Analyze$.apply(Analyze.scala:99)
[T]     sbt.internal.inc.javac.AnalyzingJavaCompiler.$anonfun$compile$19(AnalyzingJavaCompiler.scala:190)
[T]     sbt.internal.inc.javac.AnalyzingJavaCompiler.$anonfun$compile$19$adapted(AnalyzingJavaCompiler.scala:188)
[T]     scala.collection.TraversableLike$WithFilter.$anonfun$foreach$1(TraversableLike.scala:912)
[T]     scala.collection.immutable.List.foreach(List.scala:392)
[T]     scala.collection.TraversableLike$WithFilter.foreach(TraversableLike.scala:911)
[T]     sbt.internal.inc.javac.AnalyzingJavaCompiler.$anonfun$compile$17(AnalyzingJavaCompiler.scala:188)
[T]     scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
[T]     sbt.internal.inc.javac.AnalyzingJavaCompiler.timed(AnalyzingJavaCompiler.scala:234)
[T]     sbt.internal.inc.javac.AnalyzingJavaCompiler.compile(AnalyzingJavaCompiler.scala:188)
[T]     sbt.internal.inc.javac.AnalyzingJavaCompiler.compile(AnalyzingJavaCompiler.scala:73)
[T]     sbt.internal.inc.bloop.internal.BloopHighLevelCompiler.$anonfun$compile$9(BloopHighLevelCompiler.scala:179)
[T]     scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
[T]     sbt.internal.inc.bloop.internal.BloopHighLevelCompiler.$anonfun$compile$1(BloopHighLevelCompiler.scala:72)
[T]     bloop.tracing.BraveTracer.traceInternal(BraveTracer.scala:64)
[T]     bloop.tracing.BraveTracer.trace(BraveTracer.scala:38)
[T]     sbt.internal.inc.bloop.internal.BloopHighLevelCompiler.timed$1(BloopHighLevelCompiler.scala:71)
[T]     sbt.internal.inc.bloop.internal.BloopHighLevelCompiler.$anonfun$compile$8(BloopHighLevelCompiler.scala:172)
[T]     scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
[T]     monix.eval.internal.TaskRunLoop$.monix$eval$internal$TaskRunLoop$$loop$1(TaskRunLoop.scala:187)
[T]     monix.eval.internal.TaskRunLoop$RestartCallback$1.onSuccess(TaskRunLoop.scala:119)
[T]     monix.eval.Task$.$anonfun$forkedUnit$2(Task.scala:1463)
[T]     java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1426)
[T]     java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
[T]     java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
[T]     java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
[T]     java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
[T]     java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)
[E] Failed to compile 'annotations'

See also - scalacenter/bloop-maven-plugin#26

@bryan-atwood-kr
Copy link

bryan-atwood-kr commented Aug 27, 2021

@mnd999 Were you able to find a fix for this..running across the same issue at runtime when adding a stored procedure jar to neo4j.

@mnd999
Copy link
Author

mnd999 commented Aug 30, 2021

@bryan-atwood-kr Sorry, no this kind of internals is a bit beyond me. Bloop, I think is also using a zinc fork anyway so it might not even be their bug.

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

2 participants