groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul King (JIRA)" <j...@apache.org>
Subject [jira] [Closed] (GROOVY-9066) An illegal reflective access operation has occurred - on groovysh / Groovy 3.0.0-alpha-4 on Win 10 with JDK 11 (all 64 bit)
Date Thu, 04 Apr 2019 23:10:00 GMT

     [ https://issues.apache.org/jira/browse/GROOVY-9066?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Paul King closed GROOVY-9066.
-----------------------------
    Resolution: Duplicate

Thanks for reporting the issue. It may not be apparent but this is a duplicate of GROOVY-8339.
All Groovy executables are affected by the breaking changes in JDK9-12 in the same way. The
suggested workaround while we fix this issue is to use the environment variable:
{code}
> set GROOVY_TURN_OFF_JAVA_WARNINGS=true
{code}

> An illegal reflective access operation has occurred - on groovysh / Groovy 3.0.0-alpha-4
on Win 10 with JDK 11 (all 64 bit)
> ---------------------------------------------------------------------------------------------------------------------------
>
>                 Key: GROOVY-9066
>                 URL: https://issues.apache.org/jira/browse/GROOVY-9066
>             Project: Groovy
>          Issue Type: Bug
>    Affects Versions: 3.0.0-alpha-4
>         Environment: Groovy 3.0.0-alpha-4 on Win 10 with JDK 11 (all 64 bit)
>            Reporter: Alex M
>            Priority: Major
>
> An illegal reflective access operation has occurred - on groovysh / Groovy 3.0.0-alpha-4
on Win 10 with JDK 11 (all 64 bit)
>  
> Reproduction steps:
> 1) On Win 10 (64bit)
> 2) Install JDK 11 (64bit) ( verify it was referenced succesfully - CDM > java -version
> java version "11" 2018-09-25
> Java(TM) SE Runtime Environment 18.9 (build 11+28)
> Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11+28, mixed mode)
> 3) download and run Groovy installer :: groovy-3.0.0-alpha-4-installer.exe
> 4) In CDM > groovysh - produces following error
> ------------------------
> groovysh
> WARNING: An illegal reflective access operation has occurred
> WARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedClass (file:/C:/PROGRA~2/Groovy/GROOVY~1.0/lib/groovy-3.0.0-alpha-4.jar)
to method java.lang.Object.finalize()
> WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.reflection.CachedClass
> 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
> java.lang.reflect.InvocationTargetException
>  at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>  at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>  at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>  at java.base/java.lang.reflect.Method.invoke(Method.java:566)
>  at org.codehaus.groovy.tools.GroovyStarter.rootLoader(GroovyStarter.java:110)
>  at org.codehaus.groovy.tools.GroovyStarter.main(GroovyStarter.java:128)
> Caused by: java.lang.NoClassDefFoundError: Unable to load class org.apache.groovy.jaxb.extensions.JaxbExtensions
due to missing dependency javax/xml/bind/JAXBContext
>  at org.codehaus.groovy.vmplugin.v5.Java5.configureClassNode(Java5.java:408)
>  at org.codehaus.groovy.ast.ClassNode.lazyClassInit(ClassNode.java:281)
>  at org.codehaus.groovy.ast.ClassNode.getMethods(ClassNode.java:406)
>  at org.codehaus.groovy.macro.transform.MacroMethodsCache.scanExtClasses(MacroMethodsCache.java:88)
>  at org.codehaus.groovy.macro.transform.MacroMethodsCache.access$000(MacroMethodsCache.java:45)
>  at org.codehaus.groovy.macro.transform.MacroMethodsCache$2.onModule(MacroMethodsCache.java:69)
>  at org.codehaus.groovy.runtime.m12n.ExtensionModuleScanner.scanExtensionModuleFromProperties(ExtensionModuleScanner.java:87)
>  at org.codehaus.groovy.runtime.m12n.ExtensionModuleScanner.scanExtensionModuleFromMetaInf(ExtensionModuleScanner.java:81)
>  at org.codehaus.groovy.runtime.m12n.ExtensionModuleScanner.scanClasspathModulesFrom(ExtensionModuleScanner.java:63)
>  at org.codehaus.groovy.runtime.m12n.ExtensionModuleScanner.scanClasspathModules(ExtensionModuleScanner.java:54)
>  at org.codehaus.groovy.macro.transform.MacroMethodsCache.getMacroMethodsFromClassLoader(MacroMethodsCache.java:76)
>  at org.codehaus.groovy.macro.transform.MacroMethodsCache$1.provide(MacroMethodsCache.java:53)
>  at org.codehaus.groovy.macro.transform.MacroMethodsCache$1.provide(MacroMethodsCache.java:50)
>  at org.codehaus.groovy.runtime.memoize.StampedCommonCache.compute(StampedCommonCache.java:163)
>  at org.codehaus.groovy.runtime.memoize.StampedCommonCache.getAndPut(StampedCommonCache.java:154)
>  at org.codehaus.groovy.runtime.memoize.StampedCommonCache.getAndPut(StampedCommonCache.java:115)
>  at org.codehaus.groovy.macro.transform.MacroMethodsCache.get(MacroMethodsCache.java:50)
>  at org.codehaus.groovy.macro.transform.MacroCallTransformingVisitor.findMacroMethods(MacroCallTransformingVisitor.java:117)
>  at org.codehaus.groovy.macro.transform.MacroCallTransformingVisitor.visitMethodCallExpression(MacroCallTransformingVisitor.java:88)
>  at org.codehaus.groovy.ast.expr.MethodCallExpression.visit(MethodCallExpression.java:70)
>  at org.codehaus.groovy.ast.GroovyCodeVisitor.visitListOfExpressions(GroovyCodeVisitor.java:206)
>  at org.codehaus.groovy.ast.CodeVisitorSupport.visitTupleExpression(CodeVisitorSupport.java:228)
>  at org.codehaus.groovy.ast.CodeVisitorSupport.visitArgumentlistExpression(CodeVisitorSupport.java:321)
>  at org.codehaus.groovy.ast.expr.ArgumentListExpression.visit(ArgumentListExpression.java:76)
>  at org.codehaus.groovy.ast.CodeVisitorSupport.visitMethodCallExpression(CodeVisitorSupport.java:181)
>  at org.codehaus.groovy.macro.transform.MacroCallTransformingVisitor.visitMethodCallExpression(MacroCallTransformingVisitor.java:79)
>  at org.codehaus.groovy.ast.expr.MethodCallExpression.visit(MethodCallExpression.java:70)
>  at org.codehaus.groovy.ast.CodeVisitorSupport.visitBinaryExpression(CodeVisitorSupport.java:194)
>  at org.codehaus.groovy.ast.CodeVisitorSupport.visitDeclarationExpression(CodeVisitorSupport.java:295)
>  at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitDeclarationExpression(ClassCodeVisitorSupport.java:116)
>  at org.codehaus.groovy.ast.expr.DeclarationExpression.visit(DeclarationExpression.java:89)
>  at org.codehaus.groovy.ast.CodeVisitorSupport.visitExpressionStatement(CodeVisitorSupport.java:119)
>  at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitExpressionStatement(ClassCodeVisitorSupport.java:197)
>  at org.codehaus.groovy.ast.stmt.ExpressionStatement.visit(ExpressionStatement.java:42)
>  at org.codehaus.groovy.ast.CodeVisitorSupport.visitBlockStatement(CodeVisitorSupport.java:85)
>  at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitBlockStatement(ClassCodeVisitorSupport.java:106)
>  at org.codehaus.groovy.ast.stmt.BlockStatement.visit(BlockStatement.java:71)
>  at org.codehaus.groovy.ast.MethodCallTransformation.visit(MethodCallTransformation.java:48)
>  at org.codehaus.groovy.transform.ASTTransformationVisitor$3.call(ASTTransformationVisitor.java:320)
>  at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:976)
>  at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:651)
>  at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:627)
>  at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:604)
>  at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:389)
>  at groovy.lang.GroovyClassLoader.access$300(GroovyClassLoader.java:89)
>  at groovy.lang.GroovyClassLoader$5.provide(GroovyClassLoader.java:330)
>  at groovy.lang.GroovyClassLoader$5.provide(GroovyClassLoader.java:327)
>  at org.codehaus.groovy.runtime.memoize.StampedCommonCache.compute(StampedCommonCache.java:163)
>  at org.codehaus.groovy.runtime.memoize.StampedCommonCache.getAndPut(StampedCommonCache.java:154)
>  at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:325)
>  at groovy.lang.GroovyShell.parseClass(GroovyShell.java:548)
>  at groovy.lang.GroovyShell.parse(GroovyShell.java:560)
>  at groovy.lang.GroovyShell.evaluate(GroovyShell.java:444)
>  at groovy.lang.GroovyShell.evaluate(GroovyShell.java:483)
>  at groovy.lang.GroovyShell.evaluate(GroovyShell.java:454)
>  at org.codehaus.groovy.tools.shell.util.PackageHelperImpl.getPackagesAndClassesFromJigsaw(PackageHelperImpl.groovy:149)
>  at org.codehaus.groovy.tools.shell.util.PackageHelperImpl.getPackages(PackageHelperImpl.groovy:122)
>  at org.codehaus.groovy.tools.shell.util.PackageHelperImpl.initializePackages(PackageHelperImpl.groovy:59)
>  at org.codehaus.groovy.tools.shell.util.PackageHelperImpl.<init>(PackageHelperImpl.groovy:49)
>  at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
>  at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
>  at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
>  at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
>  at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:83)
>  at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:105)
>  at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:59)
>  at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:237)
>  at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:249)
>  at org.codehaus.groovy.tools.shell.Groovysh.<init>(Groovysh.groovy:108)
>  at org.codehaus.groovy.tools.shell.Groovysh.<init>(Groovysh.groovy:138)
>  at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
>  at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
>  at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
>  at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
>  at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:83)
>  at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:105)
>  at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:59)
>  at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:237)
>  at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:257)
>  at org.codehaus.groovy.tools.shell.Main.<init>(Main.groovy:65)
>  at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
>  at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
>  at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
>  at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
>  at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:83)
>  at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:105)
>  at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:59)
>  at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:237)
>  at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:257)
>  at org.codehaus.groovy.tools.shell.Main.main(Main.groovy:158)
>  ... 6 more
> ----------------
> 5) CDM > groovy -v // produces following error
> --------------------------
> groovy -v
> WARNING: An illegal reflective access operation has occurred
> WARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedClass (file:/C:/PROGRA~2/Groovy/GROOVY~1.0/lib/groovy-3.0.0-alpha-4.jar)
to method java.lang.Object.finalize()
> WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.reflection.CachedClass
> 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
> Groovy Version: 3.0.0-alpha-4 JVM: 11 Vendor: Oracle Corporation OS: Windows 10
> ------------------------



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message