AT

Can I surpress gremlin console's warnings?

Ddanielcraig2311/7/2023
How can I surpress these WARNING messages? I've tried gremlin -l but can't seem to get the syntax right because it seems to have no effect when I do gremlin -l ERROR
% gremlin
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedClass (file:/usr/local/apache-tinkerpop-gremlin-console-3.6.2/lib/groovy-2.5.15-indy.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

\,,,/
(o o)
-----oOOo-(3)-oOOo-----
plugin activated: tinkerpop.server
plugin activated: tinkerpop.utilities
plugin activated: tinkerpop.tinkergraph
% gremlin
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedClass (file:/usr/local/apache-tinkerpop-gremlin-console-3.6.2/lib/groovy-2.5.15-indy.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

\,,,/
(o o)
-----oOOo-(3)-oOOo-----
plugin activated: tinkerpop.server
plugin activated: tinkerpop.utilities
plugin activated: tinkerpop.tinkergraph
Solution:
I have found that export JDK_JAVA_OPTIONS="$JDK_JAVA_OPTIONS --illegal-access=deny" produces the following ``` % export JDK_JAVA_OPTIONS="$JDK_JAVA_OPTIONS --illegal-access=deny" % gremlin NOTE: Picked up JDK_JAVA_OPTIONS: --illegal-access=deny...
Jump to solution
Solution
Ddanielcraig2311/7/2023
I have found that export JDK_JAVA_OPTIONS="$JDK_JAVA_OPTIONS --illegal-access=deny" produces the following
% export JDK_JAVA_OPTIONS="$JDK_JAVA_OPTIONS --illegal-access=deny"
% gremlin
NOTE: Picked up JDK_JAVA_OPTIONS: --illegal-access=deny

\,,,/
(o o)
-----oOOo-(3)-oOOo-----
plugin activated: tinkerpop.server
plugin activated: tinkerpop.utilities
plugin activated: tinkerpop.tinkergraph
gremlin>
% export JDK_JAVA_OPTIONS="$JDK_JAVA_OPTIONS --illegal-access=deny"
% gremlin
NOTE: Picked up JDK_JAVA_OPTIONS: --illegal-access=deny

\,,,/
(o o)
-----oOOo-(3)-oOOo-----
plugin activated: tinkerpop.server
plugin activated: tinkerpop.utilities
plugin activated: tinkerpop.tinkergraph
gremlin>
Sspmallette11/8/2023
Those warnings come directly from the JVM at JDK11, so you can't really control them with logging infrastructure. There's some details about those warnings here: https://linuxpip.org/an-illegal-reflective-access-operation-has-occurred/ Note that in 3.7.0 the warnings are resolved as we were able to finally upgrade Groovy (the source of the issue) past 2.5.x.

Looking for more? Join the community!