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

Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$2 #308

Closed
CooperStansbury opened this issue Jun 15, 2018 · 12 comments

Comments

@CooperStansbury
Copy link

robot throws illegal reflective access message when run using the following java installation on Darwin:

java 10.0.1 2018-04-17
Java(TM) SE Runtime Environment 18.3 (build 10.0.1+10)
Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10.0.1+10, mixed mode)

My system config:

17.6.0 Darwin Kernel Version 17.6.0: Tue May 8 15:22:16 PDT 2018; root:xnu-4570.61.1~1/RELEASE_X86_64 x86_64

The full warning message below. See a similar known issue with recent activity 1133

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$2 (file:/Applications/robot/robot.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$2
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

The message does not cause robot operation to exit, or fail to execute. I silenced the message by adding a VM option to the shell script.

@jamesaoverton
Copy link
Member

Thanks for the report. I haven't tried Java 10 yet, and I haven't encountered this before.

ROBOT does not use Guice directly, but we import OWLAPI which does. Here's a relevant OWLAPI issue: owlcs/owlapi#652

Can you tell whether the error is coming from OWLAPI (which we import) or from ROBOT proper?

@CooperStansbury
Copy link
Author

Hard to tell without digging further. Added some verbose output, but am not smart enough decode....

[0.828s][info][class,load] com.sun.proxy.$Proxy18 source: __JVM_DefineClass__
[0.830s][info][class,load] jdk.internal.reflect.GeneratedConstructorAccessor2 source: __JVM_DefineClass__
[0.831s][info][class,load] com.google.inject.spi.ProviderLookup source: file:/Applications/robot/robot.jar
[0.831s][info][class,load] com.google.inject.spi.ProviderLookup$1 source: file:/Applications/robot/robot.jar
[0.832s][info][class,load] com.google.inject.spi.ProvidesMethodBinding source: file:/Applications/robot/robot.jar
[0.832s][info][class,load] com.google.inject.internal.ProviderMethod source: file:/Applications/robot/robot.jar
[0.833s][info][class,load] com.google.inject.internal.cglib.core.$CodeGenerationException source: file:/Applications/robot/robot.jar
[0.833s][info][class,load] com.google.inject.internal.ProviderMethod$FastClassProviderMethod source: file:/Applications/robot/robot.jar
[0.833s][info][class,load] com.google.inject.internal.ProviderMethod$ReflectionProviderMethod source: file:/Applications/robot/robot.jar
[0.833s][info][class,load] com.google.inject.Exposed source: file:/Applications/robot/robot.jar
[0.834s][info][class,load] com.google.inject.internal.BytecodeGen$Visibility source: file:/Applications/robot/robot.jar
[0.834s][info][class,load] com.google.inject.internal.BytecodeGen$Visibility$1 source: file:/Applications/robot/robot.jar
[0.834s][info][class,load] com.google.inject.internal.BytecodeGen$Visibility$2 source: file:/Applications/robot/robot.jar
[0.834s][info][class,load] com.google.inject.internal.cglib.reflect.$FastClass$Generator source: file:/Applications/robot/robot.jar
[0.834s][info][class,load] com.google.inject.internal.cglib.core.$GeneratorStrategy source: file:/Applications/robot/robot.jar
[0.834s][info][class,load] com.google.inject.internal.cglib.core.$Predicate source: file:/Applications/robot/robot.jar
[0.835s][info][class,load] com.google.inject.internal.cglib.core.$AbstractClassGenerator$Source source: file:/Applications/robot/robot.jar
[0.835s][info][class,load] com.google.inject.internal.cglib.reflect.$FastClass source: file:/Applications/robot/robot.jar
[0.836s][info][class,load] com.google.inject.internal.cglib.core.$DefaultGeneratorStrategy source: file:/Applications/robot/robot.jar
[0.836s][info][class,load] com.google.inject.internal.asm.$ClassVisitor source: file:/Applications/robot/robot.jar
[0.836s][info][class,load] com.google.inject.internal.cglib.core.$DebuggingClassWriter source: file:/Applications/robot/robot.jar
[0.837s][info][class,load] com.google.inject.internal.asm.$ClassWriter source: file:/Applications/robot/robot.jar
[0.837s][info][class,load] com.google.inject.internal.asm.$FieldVisitor source: file:/Applications/robot/robot.jar
[0.837s][info][class,load] com.google.inject.internal.asm.$FieldWriter source: file:/Applications/robot/robot.jar
[0.838s][info][class,load] com.google.inject.internal.asm.$AnnotationVisitor source: file:/Applications/robot/robot.jar
[0.838s][info][class,load] com.google.inject.internal.asm.$AnnotationWriter source: file:/Applications/robot/robot.jar
[0.838s][info][class,load] com.google.inject.internal.asm.$MethodVisitor source: file:/Applications/robot/robot.jar
[0.839s][info][class,load] com.google.inject.internal.asm.$MethodWriter source: file:/Applications/robot/robot.jar
[0.841s][info][class,load] com.google.inject.internal.asm.$ByteVector source: file:/Applications/robot/robot.jar
[0.842s][info][class,load] com.google.inject.internal.asm.$Item source: file:/Applications/robot/robot.jar
[0.843s][info][class,load] com.google.inject.internal.cglib.transform.$ClassTransformer source: file:/Applications/robot/robot.jar
[0.843s][info][class,load] com.google.inject.internal.cglib.core.$ClassEmitter source: file:/Applications/robot/robot.jar
[0.843s][info][class,load] com.google.inject.internal.cglib.reflect.$FastClassEmitter source: file:/Applications/robot/robot.jar
[0.845s][info][class,load] com.google.inject.internal.cglib.core.$LocalVariablesSorter source: file:/Applications/robot/robot.jar
[0.845s][info][class,load] com.google.inject.internal.cglib.core.$CodeEmitter source: file:/Applications/robot/robot.jar
[0.846s][info][class,load] com.google.inject.internal.cglib.core.$ClassEmitter$2 source: file:/Applications/robot/robot.jar
[0.846s][info][class,load] com.google.inject.internal.cglib.core.$ClassEmitter$3 source: file:/Applications/robot/robot.jar
[0.846s][info][class,load] com.google.inject.internal.cglib.core.$ClassInfo source: file:/Applications/robot/robot.jar
[0.846s][info][class,load] com.google.inject.internal.cglib.core.$ClassEmitter$1 source: file:/Applications/robot/robot.jar
[0.846s][info][class,load] com.google.inject.internal.cglib.core.$ObjectSwitchCallback source: file:/Applications/robot/robot.jar
[0.847s][info][class,load] com.google.inject.internal.cglib.core.$Transformer source: file:/Applications/robot/robot.jar
[0.847s][info][class,load] com.google.inject.internal.cglib.core.$ProcessSwitchCallback source: file:/Applications/robot/robot.jar
[0.847s][info][class,load] com.google.inject.internal.cglib.core.$TypeUtils source: file:/Applications/robot/robot.jar
[0.848s][info][class,load] com.google.inject.internal.cglib.core.$CollectionUtils source: file:/Applications/robot/robot.jar
[0.855s][info][class,load] com.google.inject.internal.cglib.core.$Signature source: file:/Applications/robot/robot.jar
[0.855s][info][class,load] com.google.inject.internal.asm.$Type source: file:/Applications/robot/robot.jar
[0.856s][info][class,load] com.google.inject.internal.asm.$Opcodes source: file:/Applications/robot/robot.jar
[0.857s][info][class,load] com.google.inject.internal.cglib.core.$Constants source: file:/Applications/robot/robot.jar
[0.857s][info][class,load] com.google.inject.internal.cglib.core.$AbstractClassGenerator$1 source: file:/Applications/robot/robot.jar
[0.862s][info][class,load] com.google.inject.internal.asm.$Label source: file:/Applications/robot/robot.jar
[0.863s][info][class,load] com.google.inject.internal.cglib.core.$MethodInfo source: file:/Applications/robot/robot.jar
[0.863s][info][class,load] com.google.inject.internal.cglib.core.$CodeEmitter$State source: file:/Applications/robot/robot.jar
[0.864s][info][class,load] com.google.inject.internal.cglib.core.$LocalVariablesSorter$State source: file:/Applications/robot/robot.jar
[0.864s][info][class,load] com.google.inject.internal.asm.$Frame source: file:/Applications/robot/robot.jar
[0.865s][info][class,load] com.google.inject.internal.cglib.core.$VisibilityPredicate source: file:/Applications/robot/robot.jar
[0.866s][info][class,load] com.google.inject.internal.cglib.core.$ReflectUtils source: file:/Applications/robot/robot.jar
[0.866s][info][class,load] com.google.inject.internal.cglib.core.$ReflectUtils$4 source: file:/Applications/robot/robot.jar
[0.866s][info][class,load] com.google.inject.internal.cglib.core.$ReflectUtils$3 source: file:/Applications/robot/robot.jar
[0.867s][info][class,load] com.google.inject.internal.cglib.core.$ReflectUtils$1 source: file:/Applications/robot/robot.jar
[0.867s][info][class,load] com.google.inject.internal.cglib.core.$ReflectUtils$2 source: file:/Applications/robot/robot.jar
[0.867s][info][class,load] java.lang.ClassFormatError source: jrt:/java.base
[0.868s][info][class,load] java.lang.AssertionStatusDirectives source: jrt:/java.base
[0.868s][info][class,load] java.lang.reflect.AccessibleObject$$Lambda$37/1394940518 source: java.lang.reflect.AccessibleObject
[0.868s][info][class,load] jdk.internal.module.IllegalAccessLogger$$Lambda$38/892083096 source: jdk.internal.module.IllegalAccessLogger
[0.869s][info][class,load] java.lang.invoke.LambdaForm$MH/554868511 source: java.lang.invoke.LambdaForm
[0.869s][info][class,load] jdk.internal.module.IllegalAccessLogger$$Lambda$39/1520387953 source: jdk.internal.module.IllegalAccessLogger
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$2 (file:/Applications/robot/robot.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$2
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

Here's a section of compilation:

    756  796       4       java.util.HashMap::putVal (300 bytes)   made not entrant
    757  984       3       com.google.common.base.Preconditions::checkNotNull (18 bytes)
    757  985       3       com.google.common.base.Preconditions::checkNotNull (14 bytes)
    757  986       1       java.util.concurrent.locks.AbstractQueuedSynchronizer::getState (5 bytes)
    758  987       3       jdk.internal.misc.Unsafe::pickPos (14 bytes)
    758  988       3       java.lang.PublicMethods$Key::hashCode (19 bytes)
    758  989       4       java.util.HashMap::putVal (300 bytes)
    758  990       3       sun.reflect.generics.visitor.Reifier::make (9 bytes)
    759  991       3       sun.reflect.generics.visitor.Reifier::<init> (10 bytes)
    759  992       1       com.google.inject.TypeLiteral::getRawType (5 bytes)
    759  993       3       com.google.common.base.Preconditions::checkArgument (18 bytes)
    759  995       3       sun.reflect.generics.parser.SignatureParser::markToCurrent (16 bytes)
    759  996       3       com.google.common.collect.Iterators$12::hasNext (13 bytes)
    759  994       1       com.google.inject.internal.ProviderMethodsModule$Signature::hashCode (5 bytes)
    760  997       1       java.util.stream.AbstractPipeline::getStreamAndOpFlags (5 bytes)
    760  998       3       java.util.stream.ReferencePipeline$Head::forEach (26 bytes)
    760  999       3       java.util.stream.AbstractPipeline::sourceStageSpliterator (112 bytes)
    761 1001       3       java.lang.reflect.Method::getExceptionTypes (11 bytes)
    761 1003       3       jdk.internal.reflect.ClassFileAssembler::emitShort (24 bytes)
    761 1002       3       java.lang.PublicMethods$MethodList::<init> (10 bytes)
    761 1004       1       java.util.HashMap::size (5 bytes)
    762 1000       4       java.lang.AbstractStringBuilder::isLatin1 (19 bytes)
    762  180       3       java.lang.AbstractStringBuilder::isLatin1 (19 bytes)   made not entrant
    766 1005       3       sun.net.www.ParseUtil::match (50 bytes)
    766 1006       4       sun.net.www.ParseUtil::firstEncodeIndex (98 bytes)
    769  542       3       sun.net.www.ParseUtil::firstEncodeIndex (98 bytes)   made not entrant
    774 1007       4       java.util.HashMap::newNode (13 bytes)
    775 1008  s    3       java.lang.StringBuffer::append (13 bytes)
    777   71       3       java.util.HashMap::newNode (13 bytes)   made not entrant
    785 1009       3       java.lang.Float::isNaN (12 bytes)
    786 1010       3       jdk.internal.org.objectweb.asm.MethodWriter::visitFieldInsn (256 bytes)
    786 1014     n 0       java.lang.invoke.MethodHandle::invokeBasic(LLL)L (native)   
    787 1013       3       java.lang.invoke.MethodHandles$Lookup::lookupClassOrNull (17 bytes)
    787 1011       3       jdk.internal.org.objectweb.asm.ClassWriter::newFieldItem (77 bytes)
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$2 (file:/Applications/robot/robot.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$2
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

@jamesaoverton
Copy link
Member

Thanks. Unfortunately I can't decipher it either. 😄 Maybe it will make more sense to someone else.

I still suspect that this is a problem with OWLAPI rather than ROBOT.

@beckyjackson
Copy link
Contributor

It's a problem with Guice. It looks like they fixed it for Guice 4.2 (google/guice@d95c8c0), but I guess OWLAPI hasn't updated? I just checked their pom.xml and it's bringing in Guice 4.1.

@jamesaoverton
Copy link
Member

It looks like OWLAPI will move away from Guice:
owlcs/owlapi#775

@CooperStansbury Do you get similar errors when running Protégé 5 with Java 10?

@CooperStansbury
Copy link
Author

CooperStansbury commented Jul 24, 2018 via email

@jamesaoverton
Copy link
Member

We just tried six versions of the JDK with our continuous integration system #318. All six passed https://travis-ci.org/ontodev/robot/builds/407624154, including oraclejdk10 with Oracle Java 10.0.2 https://travis-ci.org/ontodev/robot/jobs/407624157.

@CooperStansbury Can you please try to reproduce the problem with Java 10.0.2 ?

@CooperStansbury
Copy link
Author

CooperStansbury commented Jul 24, 2018 via email

@jamesaoverton
Copy link
Member

Well at least we're eliminating some possibilities.

My next idea is to change ROBOT https://github.com/ontodev/robot/blob/master/pom.xml and upgrade owlapi-distribution from 4.2.6 to 4.2.8, which would match Protégé https://github.com/protegeproject/protege/blob/master/pom.xml.

@CooperStansbury If you have the time and inclination to test that, it would be very helpful. @rctauber and I are struggling with some deadlines. If not, no problem, we'll get to it as soon as we can.

@CooperStansbury
Copy link
Author

CooperStansbury commented Jul 25, 2018 via email

@jamesaoverton
Copy link
Member

The Guice dependency has been removed from OWLAPI 5.1.6 and 4.5.4.

To minimize compatibility problems, we've been trying to keep ROBOT's OWLAPI dependency in sync with the latest Protégé release. That said, I don't expect that upgrading ROBOT to 4.5.4 would cause any problems.

@beckyjackson
Copy link
Contributor

We have updated to OWLAPI 4.5.6. If this issue persists, please re-open.

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