[ 
https://issues.apache.org/jira/browse/CASSANDRA-19001?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17804491#comment-17804491
 ] 

Ekaterina Dimitrova commented on CASSANDRA-19001:
-------------------------------------------------

Thank you,  [~paulo] for the extensive review and the patches! I truly 
appreciate it!

Please find my responses below:
{quote}JRE is on {{/opt/java/openjdk/bin/java}}
{quote}
LGTM, sorry I forgot about that earlier. 
{quote} I updated the check [on this 
commit|https://github.com/pauloricardomg/cassandra/commit/97472afcc4f63291ebbbcc6aab476b0ccf12ce06]
 to check for the presence of the {{javac}} executable on the {{$PATH}} or 
{{$JAVA_HOME}} to detect whether a JDK is present. Let me know what do you 
think.
{quote}
I was using the runtime check, not the javac command check, because you can 
have a few different installations on a machine, and while you try to use JRE, 
the check for javac still passes as you also have jdk11 for example, on the 
same machine
{quote}Added [this 
commit|https://github.com/pauloricardomg/cassandra/commit/cdc4124873f2b29c4d42e3265a9c7f408bcd98c4]
 to 
[pauloricardomg/19001-5.0-patch|https://github.com/apache/cassandra/compare/trunk...pauloricardomg:cassandra:19001-5.0-patch]
 to fail "nodetool sjk" with a nicer message when a JDK is not found:
{quote}
I get below on my machine with that patch and JRE, just local build running on 
my laptop (I would have to clear from my path the jdk11 for the check to pass 
as expected):

 
{code:java}
bin/nodetool sjk jps
WARNING: Unknown module: jdk.compiler specified to --add-exports
WARNING: Unknown module: jdk.attach specified to --add-exports
WARNING: Unknown module: jdk.compiler specified to --add-opens
ERROR 14:04:02,644 Java home points to 
/Library/Java/JavaVirtualMachines/temurin-17.jre/Contents/Home make sure it is 
not a JRE path
ERROR 14:04:02,645 Failed to add tools.jar to classpath
java.lang.ClassNotFoundException: com.sun.tools.attach.VirtualMachine
 at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source)
 at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown 
Source)
 at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
 at org.gridkit.lab.jvm.attach.AttachAPI.<clinit>(AttachAPI.java:52)
 at org.gridkit.lab.jvm.attach.AttachManager.<clinit>(AttachManager.java:75)
 at org.gridkit.jvmtool.cmd.ProcListCmd$JPS.run(ProcListCmd.java:74)
 at org.apache.cassandra.tools.nodetool.Sjk$Wrapper.run(Sjk.java:219)
 at org.apache.cassandra.tools.nodetool.Sjk.runInternal(Sjk.java:83)
 at org.apache.cassandra.tools.NodeTool$NodeToolCmd.run(NodeTool.java:368)
 at org.apache.cassandra.tools.NodeTool.execute(NodeTool.java:267)
 at org.apache.cassandra.tools.NodeTool.main(NodeTool.java:85)
java.lang.NoClassDefFoundError: com/sun/tools/attach/VirtualMachine
 at 
org.gridkit.lab.jvm.attach.AttachManager$AttachManagerInt.getVmList(AttachManager.java:217)
 at 
org.gridkit.lab.jvm.attach.AttachManager$AttachManagerInt.internalListJavaProcesses(AttachManager.java:224)
 at 
org.gridkit.lab.jvm.attach.AttachManager.listJavaProcesses(AttachManager.java:105)
 at org.gridkit.jvmtool.cmd.ProcListCmd$JPS.run(ProcListCmd.java:74)
 at org.apache.cassandra.tools.nodetool.Sjk$Wrapper.run(Sjk.java:219)
 at org.apache.cassandra.tools.nodetool.Sjk.runInternal(Sjk.java:83)
 at org.apache.cassandra.tools.NodeTool$NodeToolCmd.run(NodeTool.java:368)
 at org.apache.cassandra.tools.NodeTool.execute(NodeTool.java:267)
 at org.apache.cassandra.tools.NodeTool.main(NodeTool.java:85)
Caused by: java.lang.ClassNotFoundException: com.sun.tools.attach.VirtualMachine
 at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source)
 at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown 
Source)
 at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
 ... 9 more
{code}
 

Also, I believe we should not prevent from running all sjk commands with JRE. 
There are some which do not require the modules. 

For example - sjk ttop
{quote}I inspected chronicle queue code and documentation
{quote}
There was lazy consensus on the ML around chronicle and JRE. Thus, I did not 
finish digging there but documented the recommendation. Also, we use 
chronicle-queue, chronicle-core, chronicle-bytes, chronicle-wire, and 
chronicle-threads, and [the 
docs|https://chronicle.software/chronicle-support-java-17/] are not 
particularly for chronicle-queue. If the community goes into that road, we must 
check them all. Furthermore, it could be performance-related, not definitive 
failure. 

> Check whether the startup warnings for unknown modules represent a legit 
> problem or cosmetic issue
> --------------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-19001
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-19001
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Local/Other
>            Reporter: Ekaterina Dimitrova
>            Assignee: Ekaterina Dimitrova
>            Priority: Normal
>             Fix For: 5.0-rc, 5.0.x, 5.x
>
>
> During the 5.0 alpha 2 release 
> [vote|https://lists.apache.org/thread/lt3x0obr5cpbcydf5490pj6b2q0mz5zr], 
> [~paulo] raised the following concerns:
> {code:java}
> Launched a tarball-based 5.0-alpha2 container on top of
> "eclipse-temurin:17-jre-focal" and the server starts up fine, can run
> nodetool and cqlsh.
> I got these seemingly harmless JDK17 warnings during startup and when
> running nodetool (no warnings on JDK11):
> WARNING: Unknown module: jdk.attach specified to --add-exports
> WARNING: Unknown module: jdk.compiler specified to --add-exports
> WARNING: Unknown module: jdk.compiler specified to --add-opens
> WARNING: A terminally deprecated method in java.lang.System has been called
> WARNING: System::setSecurityManager has been called by
> org.apache.cassandra.security.ThreadAwareSecurityManager
> (file:/opt/cassandra/lib/apache-cassandra-5.0-alpha2-SNAPSHOT.jar)
> WARNING: Please consider reporting this to the maintainers of
> org.apache.cassandra.security.ThreadAwareSecurityManager
> WARNING: System::setSecurityManager will be removed in a future release
> Anybody knows if these warnings are legit/expected ? We can create
> follow-up tickets if needed.
> $ java --version
> openjdk 17.0.9 2023-10-17
> OpenJDK Runtime Environment Temurin-17.0.9+9 (build 17.0.9+9)
> OpenJDK 64-Bit Server VM Temurin-17.0.9+9 (build 17.0.9+9, mixed mode,
> sharing)
> {code}
> {code:java}
> Clarification: - When running nodetool only the "Unknown module" warnings 
> show up. All warnings show up during startup.{code}
> We need to verify whether this presents a real problem in the features where 
> those modules are expected to be used, or if it is a false alarm. 
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to