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

error opening local connection #63

Open
alxgomz opened this issue Apr 15, 2019 · 3 comments
Open

error opening local connection #63

alxgomz opened this issue Apr 15, 2019 · 3 comments

Comments

@alxgomz
Copy link

alxgomz commented Apr 15, 2019

I'm trying to open a connection to a local java process using the open PID command.
Whe doing so I have the follwoin g exception (in verbose mode):

Welcome to JMX terminal. Type "help" for available commands.
$>open 1933
java.lang.UnsupportedOperationException: Operation requires JDK instead of JRE
        at org.cyclopsgroup.jmxterm.pm.UnsupportedJavaProcessManager.get(UnsupportedJavaProcessManager.java:54)                                                                               
        at org.cyclopsgroup.jmxterm.SyntaxUtils.getUrl(SyntaxUtils.java:59)
        at org.cyclopsgroup.jmxterm.cmd.OpenCommand.execute(OpenCommand.java:73)
        at org.cyclopsgroup.jmxterm.cc.CommandCenter.doExecute(CommandCenter.java:188)
        at org.cyclopsgroup.jmxterm.cc.CommandCenter.doExecute(CommandCenter.java:158)
        at org.cyclopsgroup.jmxterm.cc.CommandCenter.execute(CommandCenter.java:206)
        at org.cyclopsgroup.jmxterm.boot.CliMain.execute(CliMain.java:176)
        at org.cyclopsgroup.jmxterm.boot.CliMain.main(CliMain.java:50)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)                                                                                              
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.codehaus.classworlds.Launcher.launchStandard(Launcher.java:353)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:264)
        at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)                                                                                              
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.codehaus.classworlds.uberjar.boot.Bootstrapper.bootstrap(Bootstrapper.java:209)
        at org.codehaus.classworlds.uberjar.boot.Bootstrapper.main(Bootstrapper.java:116)
Caused by: java.lang.RuntimeException: Operation requires JDK instead of JRE
        at org.cyclopsgroup.jmxterm.pm.JConsoleClassLoaderFactory.getClassLoader(JConsoleClassLoaderFactory.java:42)                                                                          
        at org.cyclopsgroup.jmxterm.cc.JPMFactory.<init>(JPMFactory.java:34)
        at org.cyclopsgroup.jmxterm.cc.CommandCenter.<init>(CommandCenter.java:87)
        at org.cyclopsgroup.jmxterm.cc.CommandCenter.<init>(CommandCenter.java:71)
        at org.cyclopsgroup.jmxterm.boot.CliMain.execute(CliMain.java:136)
        ... 15 more

The java environment is indeed a JRE and not a JDK however, checking the code the strack tracepoints to I don't understand why I'm getting this error.
JConsoleClassLoaderFactory.java tests for java.io.File.isFile('lib/tools.jar') and should only throw this RuntimeException in case it this file is not a file.

I have started jmxterm setting the JAVA_HOME env to the directory containing lib/ and even tried starting it with java installation being the PWD as well...

Why am I getting this exception and is the JDK really needed in order to open a local process?

@alxgomz
Copy link
Author

alxgomz commented Apr 15, 2019

I forgot to mention it but I of course have tools.jar and jconsole.jar within the lib directory of my java installation.
And sorry if this is not the right place to post that but I couldn't find another place

@OrangeDog
Copy link

A similar issue with 1.0.1

$>open 2813
#UnsupportedOperationException: /usr/lib/jvm/java-8-openjdk-amd64/lib/jconsole.jar file is not found

Problem is jconsole.jar is not included in the headless JDK, because it requires a GUI.

@StyXman
Copy link

StyXman commented Mar 21, 2024

I htink this is fixed by downloading the -uber.jar. Did you try that?

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