You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (Jira)" <ji...@apache.org> on 2021/02/09 10:50:00 UTC
[jira] [Commented] (GROOVY-9933) Exceptions logged on Java 8
[ https://issues.apache.org/jira/browse/GROOVY-9933?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17281708#comment-17281708 ]
Paul King commented on GROOVY-9933:
-----------------------------------
I can't see any check for Java version, we just didn't seem to log anything in that case which meant there was no way to tell what went wrong in other scenarios:
https://github.com/apache/groovy/commit/2737292fcc9
We'll have to think about possibilities. One option might be to have special code to not log the ClassNotFoundException case but log a friendly message instead, e.g. "JDK9 class not found, assuming JDK8" or similar, but still log the exception in other cases.
> Exceptions logged on Java 8
> ----------------------------
>
> Key: GROOVY-9933
> URL: https://issues.apache.org/jira/browse/GROOVY-9933
> Project: Groovy
> Issue Type: Bug
> Components: groovy-runtime
> Affects Versions: 3.0.7
> Environment: MacOS
> Reporter: Benjamin Muskalla
> Priority: Minor
>
> When using Groovy 3.0.7 on a JDK 8, the following exception is logged. This causes problems for other parties scanning logs for exceptions and users trying to find real problems. The exception in question doesn't seem to be a problem though as it is expected to not find Java 9 classes on Java 8. In Groovy 2.x, this used to not log errors as it checked the java major version before loading the class.
>
> {code:java}
> 2021-02-09T10:13:25.639+0100 [DEBUG] [org.codehaus.groovy.vmplugin.VMPluginFactory] Trying to create VM plugin `org.codehaus.groovy.vmplugin.v9.Java9` by checking `java.lang.Module`, but failed:
> java.lang.ClassNotFoundException: java.lang.Modulejava.lang.ClassNotFoundException: java.lang.Module at java.net.URLClassLoader.findClass(URLClassLoader.java:382) at java.lang.ClassLoader.loadClass(ClassLoader.java:419) at java.lang.ClassLoader.loadClass(ClassLoader.java:352) at org.codehaus.groovy.vmplugin.VMPluginFactory.lambda$createPlugin$0(VMPluginFactory.java:61) at java.security.AccessController.doPrivileged(Native Method) at org.codehaus.groovy.vmplugin.VMPluginFactory.createPlugin(VMPluginFactory.java:58) at org.codehaus.groovy.vmplugin.VMPluginFactory.<clinit>(VMPluginFactory.java:45) at org.codehaus.groovy.reflection.ReflectionUtils.<clinit>(ReflectionUtils.java:47) at org.codehaus.groovy.reflection.CachedClass$3.lambda$initValue$1(CachedClass.java:90) at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:174) at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175) at java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948) at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482) at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472) at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:546) at java.util.stream.AbstractPipeline.evaluateToArrayNode(AbstractPipeline.java:260)
> {code}
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)