Git Product home page Git Product logo

jmxterm's People

Contributors

arohter avatar blacelle avatar chenzhang22 avatar dependabot[bot] avatar diegobe avatar henri-tremblay avatar jiaqi avatar jluehe avatar joncourt avatar jpoittevin avatar kongslund avatar npiguet avatar nyg avatar okummer avatar richlv avatar rroblak avatar sam-meder avatar sergeykranga avatar sjohnc avatar velo avatar wattazoum avatar yakirgb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jmxterm's Issues

Does not build or run with java9

Tried with Java9.0.4

Build time error:
[INFO] Running org.cyclopsgroup.jmxterm.pm.JConsoleClassLoaderFactoryTest
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.049 s <<< FAILURE! - in org.cyclopsgroup.jmxterm.pm.JConsoleClassLoaderFactoryTest
[ERROR] testLoad(org.cyclopsgroup.jmxterm.pm.JConsoleClassLoaderFactoryTest) Time elapsed: 0.012 s <<< ERROR!
java.lang.RuntimeException: Operation requires JDK instead of JRE
at org.cyclopsgroup.jmxterm.pm.JConsoleClassLoaderFactoryTest.testLoad(JConsoleClassLoaderFactoryTest.java:22)

Runtime error:
:~/Downloads$ java -jar jmxterm-1.0.0-uber.jar
java.lang.NullPointerException
at org.codehaus.classworlds.Launcher.getEnhancedMainMethod(Launcher.java:195)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:294)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
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:564)
at org.codehaus.classworlds.uberjar.boot.Bootstrapper.bootstrap(Bootstrapper.java:209)
at org.codehaus.classworlds.uberjar.boot.Bootstrapper.main(Bootstrapper.java:116)

Containerized/Dockerized

It'd be nice to spin this up as a docker instance. It'd be compatible for people with java 9 + (partial workaround for #48) if they can build/run as a docker image. Publishing this officially to dockerhub would make this very accessible

UndeclaredThrowableException

Tried to connect to a local JVM with 1.0.1, openjdk-8-jdk.

Welcome to JMX terminal. Type "help" for available commands.
$>open 17057
#UndeclaredThrowableException:
$>

Support for JMX auth + SSL encryption

Hi,

Even when adding the following SSL properties, jmxterm over SSL+authentication failed (while it works in clear + authentication). Does jmxterm support SSL and could you provide an example ?

-Djavax.net.ssl.trustStore=/etc/cassandra/truststore.jks
-Djavax.net.ssl.trustStorePassword=changeit
-Dcom.sun.management.jmxremote.registry.ssl=true
-Dssl.enable=true


java.io.IOException: Failed to retrieve RMIServer stub: javax.naming.CommunicationException [Root exception is java.rmi.ConnectIOException: non-JRMP server at remote endpoint]
at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:369)
at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:270)
at org.cyclopsgroup.jmxterm.cc.SessionImpl.doConnect(SessionImpl.java:85)
at org.cyclopsgroup.jmxterm.cc.SessionImpl.connect(SessionImpl.java:49)
at org.cyclopsgroup.jmxterm.cc.CommandCenter.connect(CommandCenter.java:110)
at org.cyclopsgroup.jmxterm.boot.CliMain.execute(CliMain.java:139)
at org.cyclopsgroup.jmxterm.boot.CliMain.main(CliMain.java:48)
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:498)
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:498)
at org.codehaus.classworlds.uberjar.boot.Bootstrapper.bootstrap(Bootstrapper.java:209)
at org.codehaus.classworlds.uberjar.boot.Bootstrapper.main(Bootstrapper.java:116)
Caused by: javax.naming.CommunicationException [Root exception is java.rmi.ConnectIOException: non-JRMP server at remote endpoint]
at com.sun.jndi.rmi.registry.RegistryContext.lookup(RegistryContext.java:136)
at com.sun.jndi.toolkit.url.GenericURLContext.lookup(GenericURLContext.java:205)
at javax.naming.InitialContext.lookup(InitialContext.java:417)
at javax.management.remote.rmi.RMIConnector.findRMIServerJNDI(RMIConnector.java:1955)
at javax.management.remote.rmi.RMIConnector.findRMIServer(RMIConnector.java:1922)
at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:287)
... 20 more
Caused by: java.rmi.ConnectIOException: non-JRMP server at remote endpoint
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:248)
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:202)
at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:338)
at sun.rmi.registry.RegistryImpl_Stub.lookup(RegistryImpl_Stub.java:112)
at com.sun.jndi.rmi.registry.RegistryContext.lookup(RegistryContext.java:132)
... 25 more

Please create releases in github

Hi,
The project's wiki page points to this github repository for the source code (see http://wiki.cyclopsgroup.org/jmxterm/source.html).
However this github project does not have any releases. Without any releases it's not really possible (to easily) download the exact source code for a certain release. For example I need to download the source code for the 1.0 alpha 4 version (e.g. for legal check for a big company, which has a process for legal check, which requires the source code packages of open source components with their respective versions).
Apart from this, having releases of a software makes life easier anyway and this is how things normally work.
Please, please create a release at least for 1.0 alpha 4 version and for further releases!

Can't run an operation with "-" or " " in an argument

Hi, I have a JMX operation that takes a string that has spaces in it, if I try to, for example:

run runnableOperation "this is my argument"

I get:
Operation runnableOperation with 4 parameters doesn't exist in bean ....

Or, if my operation requires a - in the argument, the Commons-Cli parser fails:

MalformedArgException: Apache Jakarta commons-cli couldn't parse arguments [ "ping, -c1, 192.168.1.20"]

Am I doing the right thing by putting my string arguments in " or is there another way? Is there a workaround?

Many thanks, otherwise JMXTerm is fantastic.
Dan.

Publish your public key

There's no point in providing ASC files if we cannot find your public key. Please rectify. Thank You.

Method signature not respected when having two methods with the same name

We are trying to invoke a method on an MBean that have two methods defined

  • registerProcess(String, int)
  • registerProcess(String, String)

We want to invoke the second method but jmxterm always chooses the first method it sees having the correct name and number of arguments. It does not seem to take the actual method signature into consideration.

Any workaround to this?

This issue was observered with jmxterm-1.0-alpha-4-uber.jar

ERROR: bean name isn't valid

Hi there,
Im using jmxterm to monitor jmx mbeans of Solr.

When i set the domain like => "domain solr/song" then run beans command. It gives me all beans list.
Well. When i send request any attribute of any beans, i get it, bean name isn't valid.

How could it be ?

Example :
$>domain solr/song
$>beans

domain = solr/song:

solr/song:id=debug,type=debug
solr/song:id=facet,type=facet
solr/song:id=get,type=get
solr/song:id=highlight,type=highlight
solr/song:id=mlt,type=mlt
$>get -b solr/song:id=mlt,type=mlt *

IllegalArgumentException: Bean name solr/song:id=mlt,type=mlt isn't valid.

jmxterm does not work with OpenJDK11

Switching in RHEL7 from :

1.8.0.171-8.b10.el7_5

to

11.0.1.13-3.el7_6 or 11.0.4.11-1.el7_7.

The following command:

java -jar /opt/applications/monitoring/jmxterm-1.0.0-uber.jar -l ${KAFKA_HOST}:9999 -n < /opt/applications/monitoring/jmx-config

throws the following exception:

java.lang.NullPointerException
	at org.codehaus.classworlds.Launcher.getEnhancedMainMethod(Launcher.java:195)
	at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:294)
	at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
	at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
	at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
	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.classworlds.uberjar.boot.Bootstrapper.bootstrap(Bootstrapper.java:209)
	at org.codehaus.classworlds.uberjar.boot.Bootstrapper.main(Bootstrapper.java:116)

My gut feeling that it generally doesn't work with OpenJDK11 independently of the exact version

(edit: format exception)

JMX auth + SSL do not work with version 1.0.1

java -Djavax.net.ssl.trustStore=/path/truststore.jks -Djavax.net.ssl.trustStorePassword=password -jar jmxterm-1.0.1-uber.jar -l service:jmx:rmi:///jndi/rmi://1.2.3.4:8099/jmxrmi -u foo -p foobar
Exception in thread "main" java.io.IOException: Failed to retrieve RMIServer stub: javax.naming.CommunicationException [Root exception is java.rmi.ConnectIOException: non-JRMP server at remote endpoint]
at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:369)
at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:270)
at org.cyclopsgroup.jmxterm.cc.SessionImpl.doConnect(SessionImpl.java:64)
at org.cyclopsgroup.jmxterm.cc.SessionImpl.connect(SessionImpl.java:39)
at org.cyclopsgroup.jmxterm.cc.CommandCenter.connect(CommandCenter.java:103)
at org.cyclopsgroup.jmxterm.boot.CliMain.execute(CliMain.java:126)
at org.cyclopsgroup.jmxterm.boot.CliMain.main(CliMain.java:41)
Caused by: javax.naming.CommunicationException [Root exception is java.rmi.ConnectIOException: non-JRMP server at remote endpoint]
at com.sun.jndi.rmi.registry.RegistryContext.lookup(RegistryContext.java:136)
at com.sun.jndi.toolkit.url.GenericURLContext.lookup(GenericURLContext.java:205)
at javax.naming.InitialContext.lookup(InitialContext.java:417)
at javax.management.remote.rmi.RMIConnector.findRMIServerJNDI(RMIConnector.java:1955)
at javax.management.remote.rmi.RMIConnector.findRMIServer(RMIConnector.java:1922)
at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:287)
... 6 more
Caused by: java.rmi.ConnectIOException: non-JRMP server at remote endpoint
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:248)
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:202)
at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:338)
at sun.rmi.registry.RegistryImpl_Stub.lookup(RegistryImpl_Stub.java:112)
at com.sun.jndi.rmi.registry.RegistryContext.lookup(RegistryContext.java:132)
... 11 more

With jconsole it works.

From an earlier issue, this was fixed in 1.0.1 ?

The Mbean's name contain spaces leads to a bug

example:
error:
$>bean -d java.lang java.lang:name=Perm Gen
#IllegalArgumentException: Bean name java.lang:name=Perm isn't valid
$>bean java.lang:name=Perm Gen,type=MemoryPool
#IllegalArgumentException: Please specify domain using either -d option or domain command

normal:
$>bean java.lang:name=CodeCacheManager,type=MemoryManager
#bean is set to java.lang:name=CodeCacheManager,type=MemoryManager

Is there is any way to switch off debug log statements?

From shell script I am invoking jmxterm command like below:
java -cp $component_home/$component_name-$buildVersion.jar org.cyclopsgroup.jmxterm.boot.CliMain --url "$jmxURL" -n -input $tmpfile

But it generates set of debug logs which I don't want to give to end user. Is there any way to switch off all log level except ERROR?

Welcome to JMX terminal. Type "help" for available commands.
#domain is set to com.anz.markets.efx.client.stp
#bean is set to com.anz.markets.efx.client.stp:name=ClientStpGridPublisherJMXEndpoint
#calling operation reprocessFailedEvents of mbean com.anz.markets.efx.client.stp:name=ClientStpGridPublisherJMXEndpoint
#operation returns:
15:12:08.453 [main] DEBUG org.apache.commons.beanutils.converters.BooleanConverter - Setting default value: false
15:12:08.458 [main] DEBUG org.apache.commons.beanutils.converters.BooleanConverter - Converting 'Boolean' value 'false' to type 'Boolean'
15:12:08.458 [main] DEBUG org.apache.commons.beanutils.converters.BooleanConverter - No conversion required, value is already a Boolean

RPM plugin fails to run due to older maven-site-plugin version

Out of the box checkout, the rpm:rpm plugin doesn't work on:

Maven: 3.5.4
Java: 1.8.0_172

The parent pom specifies a maven-site-plugin version of 3.4, however I run into problems under the above config that seems to suggest the older version of the site plugin no longer functional in modern JVMs:

see: https://stackoverflow.com/questions/51091539/maven-site-plugins-3-3-java-lang-classnotfoundexception-org-apache-maven-doxia

I tried hacking a copy of the parent plugin to set the site plugin to 3.7.1 but running into further incompatibilities:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.7.1:site (default-site) on project jmxterm: SiteToolException: Error parsing site descriptor: TEXT must be immediately followed by END_TAG and not START_TAG (position: START_TAG seen ..."\n                src="http://www.google-analytics.com/urchin.js">... @16:65) -> [Help 1]

Looks like a URL somewhere in one of the POM descriptors is not returning something expected ?

Support bean name with a space in it

This is related to #4

We have bean name holding a space in it. It seems not possible to fetch them. It would be nice if these could be protected by double-quotes for instance

clean checkout does not compile - complains about missing org.cyclopsgroup:cyclopsgroup-java-parent:pom:1.0.0-SNAPSHOT

Out of the box checkout does fail immediately - probably missing dependencies, that mvn can not resolve...

$ mvn install
[INFO] Scanning for projects...
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR]   The project org.cyclopsgroup:jmxterm:1.0.0-SNAPSHOT (jmxterm\pom.xml) has 1 error
[ERROR]     Non-resolvable parent POM: Could not find artifact org.cyclopsgroup:cyclopsgroup-java-parent:pom:1.0.0-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 6, column 13 -> [Help 2]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException

So where can I get this parent-dependency?

RPM plugin configuration effectively declares ownership over /usr/bin

I can't be certain this is still true because I'm having trouble actually building the RPM, but I've hit this same problem myself a few times I think I'm probably close to right here.

$ rpm -ql jmxterm | grep bin
/usr/bin
/usr/bin/jmxterm

(this is on an older version of the JMXTERM package I created ages ago)

The RPM is declaring it owns /usr/bin, which I think you'll agree is overreaching a bit.

I think you will need to modify the pom so that the <directoryIncluded>false</directoryIncluded> for the jmxterm.sh section of the maven-rpm-plugin configuration..

new verbosity level

it would be great if there were a new verbosity level, something like "ERROR_ONLY" which would print a brief error message for any error, but act like SILENT for any non-error messages.

How can I list the bean childrens ?

First thank you for this great tool, it helps a lot when you try to work from cli/ssh.

I was trying to get the list of jdbc configured datasources from a jboss as server and the jmx name should looks like this โ€œjboss.as:subsystem=datasources,data-source=โ€ . Trying to use this in jmxterm returns:
$>info -b jboss.as:subsystem=datasources,data-source=

#IllegalArgumentException: Bean name jboss.as:subsystem=datasources,data-source=* isn't valid
$>bean jboss.as:subsystem=datasources,data-source=*
#IllegalArgumentException: Bean name jboss.as:subsystem=datasources,data-source=* isn't valid

but I am able to get information if I select:

$>bean jboss.as:subsystem=datasources
#bean is set to jboss.as:subsystem=datasources
$>bean jboss.as:subsystem=datasources,data-source=ExampleDS,statistics=pool
#bean is set to jboss.as:subsystem=datasources,data-source=ExampleDS,statistics=pool

For mbean model and supported childrens please have a look on:
https://access.redhat.com/webassets/avalon/d/red_hat_jboss_enterprise_application_platform/7.3/mgmt_model/subsystem/datasources/index.html

There is another way to query for the list of childrens or how can I get the list of mbean childrens using jmxterm ?

Thank you in advance for the time and effort you put in this.

Unsupported protocol remote+http and http-remoting-jmx

open service:jmx:remote+http://127.0.0.1:9990
gives:
#RuntimeIOException: Runtime IO exception: Unsupported protocol: remote+http
same with
open service:jmx:http-remoting-jmx://127.0.0.1:9990
which gives:
#RuntimeIOException: Runtime IO exception: Unsupported protocol: http-remoting-jmx

added jboss-client.jar to the classpath but no help. Without this, jmxterm cannot manage wildfly java environment.

domain with "#" in between cannot be set

In our app, we have domains with "#" in between, eg: aaa#bbb#ccc#

using jconsole eg, we could select the domain

but when try to set the domain in the jmxterm, it got truncated (left with aaa), and hence the domain cannot be set.

but the "domains" command is able to list it.

in src/main/java/org/cyclopsgroup/jmxterm/cc/CommandCenter.java , the doExecute(String command) method truncate the # , why?

    // Truncate command if there's # character
    int commandEnds = command.indexOf( '#' );
    if ( commandEnds != -1 )
    {   
        command = command.substring( 0, commandEnds );
    }  

WARNING: An illegal reflective access operation has occurred

Hi.
I am getting following warnings while connecting to the jxm console:
$ java -jar /vendor/jmxterm/jmxterm-1.0.2-uber.jar -l 119511
Delete /u01/app/home/asmsadm/.jmxterm_history if you encounter error right after launching me.WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.cyclopsgroup.jmxterm.utils.WeakCastUtils$2 (file:/vendor/jmxterm/jmxterm-1.0.2-uber.jar) to method sun.tools.jconsole.LocalVirtualMachine.getAllVirtualMachines()
WARNING: Please consider reporting this to the maintainers of org.cyclopsgroup.jmxterm.utils.WeakCastUtils$2
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
Welcome to JMX terminal. Type "help" for available commands.
$>Fri Sep 25 15:18:45 EDT 2020: Connected nj01smgapp5061.smg.iconectiv.com
/
#IllegalArgumentException: Command / isn't valid, run help to see available commands
$>
$>

Dependency on jconsole prevents operation on headless JVM

I'm trying to run jmxterm on a docker image that has a headless JVM installed. I get the following error:

root@51a832163f66:/var/lib/jetty# java -jar /jmxterm-1.0.0-uber.jar
Welcome to JMX terminal. Type "help" for available commands.
$>open 1
#UnsupportedOperationException: /usr/lib/jvm/java-8-openjdk-amd64/lib/jconsole.jar file is not found

Is there any way to run jmxterm on a headless JVM?

Tab-completion throws NoClassDefFoundError: jline/Completor

Rebuilt 56880c0 from clean (fresh clone, deleted ~/.m2)

Now tab completion fails with this:

$ java -jar ~/jmxterm/target/jmxterm-1.0-SNAPSHOT-uber.jar -l localhost:50111
Welcome to JMX terminal. Type "help" for available commands.
$>bean <TAB>
---------------------------------------------------
constituent[0]: jar:file:/home/oliver/jmxterm/target/jmxterm-1.0-SNAPSHOT-uber.jar!/WORLDS-INF/lib/jmxterm.jar
constituent[1]: jar:file:/home/oliver/jmxterm/target/jmxterm-1.0-SNAPSHOT-uber.jar!/WORLDS-INF/lib/commons-beanutils.jar
constituent[2]: jar:file:/home/oliver/jmxterm/target/jmxterm-1.0-SNAPSHOT-uber.jar!/WORLDS-INF/lib/commons-collections.jar
constituent[3]: jar:file:/home/oliver/jmxterm/target/jmxterm-1.0-SNAPSHOT-uber.jar!/WORLDS-INF/lib/commons-lang.jar
constituent[4]: jar:file:/home/oliver/jmxterm/target/jmxterm-1.0-SNAPSHOT-uber.jar!/WORLDS-INF/lib/commons-logging.jar
constituent[5]: jar:file:/home/oliver/jmxterm/target/jmxterm-1.0-SNAPSHOT-uber.jar!/WORLDS-INF/lib/commons-io.jar
constituent[6]: jar:file:/home/oliver/jmxterm/target/jmxterm-1.0-SNAPSHOT-uber.jar!/WORLDS-INF/lib/caff.jar
constituent[7]: jar:file:/home/oliver/jmxterm/target/jmxterm-1.0-SNAPSHOT-uber.jar!/WORLDS-INF/lib/jcli.jar
constituent[8]: jar:file:/home/oliver/jmxterm/target/jmxterm-1.0-SNAPSHOT-uber.jar!/WORLDS-INF/lib/jline.jar
---------------------------------------------------
Exception in thread "main" java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    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.NoClassDefFoundError: jline/Completor
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:792)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:635)
    at org.codehaus.classworlds.UberJarRealmClassLoader.loadClassDirect(UberJarRealmClassLoader.java:199)
    at org.codehaus.classworlds.DefaultClassRealm.loadClass(DefaultClassRealm.java:255)
    at org.codehaus.classworlds.RealmClassLoader.loadClass(RealmClassLoader.java:214)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at org.cyclopsgroup.jmxterm.cc.ConsoleCompletor.complete(ConsoleCompletor.java:71)
    at jline.console.ConsoleReader.complete(ConsoleReader.java:3077)
    at jline.console.ConsoleReader.readLine(ConsoleReader.java:2501)
    at jline.console.ConsoleReader.readLine(ConsoleReader.java:2162)
    at org.cyclopsgroup.jmxterm.io.JlineCommandInput.readLine(JlineCommandInput.java:48)
    at org.cyclopsgroup.jmxterm.boot.CliMain.execute(CliMain.java:173)
    at org.cyclopsgroup.jmxterm.boot.CliMain.main(CliMain.java:50)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    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)
    ... 6 more

The failing line is attempting to construct a CliCompletor instance (from jcli).
jline.Completor does not exist in the version of jline packaged with jmxterm.
So this looks like version skew in the version of jline expected by jmxterm and jcli.

JMXTerm slow?

I seem to get rather poor performance from jmxterm compared to cmdline-jmxclient. Are there any flags to the build or command to speed this along?

[08:21:06][malexander@aztlan jmxterm-master]$  time echo get -s -b java.lang:type=Runtime Name | java -jar target/jmxterm-1.0-SNAPSHOT-uber.jar -l renraku:4242 -u qanmsuser -p ******
Welcome to JMX terminal. Type "help" for available commands.
$>get -s -b java.lang:type=Runtime Name
#mbean = java.lang:type=Runtime:
20574@renraku
$>
real    0m4.082s
user    0m3.634s
sys     0m0.128s
[08:21:14][malexander@aztlan jmxterm-master]$ time java -jar ~/bin/cmdline-jmxclient-0.10.3.jar qanmsuser:****** renraku:4242 java.lang:type=Runtime Name
06/14/2013 08:21:21 -0400 org.archive.jmx.Client Name: 20574@renraku

real    0m0.514s
user    0m0.188s
sys     0m0.044s

sl4j packaging

I tried to build an RPM from master today, but when I run jmxterm I get the classic slf4j error/warning:

https://www.slf4j.org/codes.html#StaticLoggerBinder

By adding in a slf4j-simple into the dependency set these messages go away. I'm not sure if this is the best way to do it, and what affect it would have on jmxterm logging though.

Error building from source

I'm very familiar with Maven, and I've checked out the latest master and tried to build (so I could generate an RPM) but I'm getting this failure:

[ jmxterm ](master)$ mvn package
[INFO] Scanning for projects...
[WARNING] The POM for org.cyclopsgroup:kaufman-beans:jar:1.0.0-SNAPSHOT is missing, no dependency information available
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR]   The project org.cyclopsgroup:jmxterm:1.0.0-SNAPSHOT (/workspace_intellij/jmxterm/pom.xml) has 1 error
[ERROR]     Unresolveable build extension: Plugin org.cyclopsgroup:awss3-maven-wagon:1.4.0 or one of its dependencies could not be resolved: Failure to find org.cyclopsgroup:kaufman-beans:jar:1.0.0-SNAPSHOT in https://repo.aconex.com/content/groups/public-snapshots was cached in the local repository, resolution will not be reattempted until the update interval of nexus-public-snapshots has elapsed or updates are forced -> [Help 2]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException

I can't find exactly where the awss3-maven-wagon dependency is coming in from because I can't build it (a requirement for mvn dependency:tree) but the underlying kaufman-beans dependency is not in the Maven Central repo I can see (certainly not through oss.sonatype.org I'm searching.)

jxmterm Will Not Run on JDK11 (amazon corretto)

$ java -version
openjdk version "11.0.5" 2019-10-15 LTS
OpenJDK Runtime Environment Corretto-11.0.5.10.1 (build 11.0.5+10-LTS)
OpenJDK 64-Bit Server VM Corretto-11.0.5.10.1 (build 11.0.5+10-LTS, mixed mode)

$ java -jar jmxterm-1.0.0-uber.jar
java.lang.NullPointerException
at org.codehaus.classworlds.Launcher.getEnhancedMainMethod(Launcher.java:195)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:294)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
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.classworlds.uberjar.boot.Bootstrapper.bootstrap(Bootstrapper.java:209)
at org.codehaus.classworlds.uberjar.boot.Bootstrapper.main(Bootstrapper.java:116)

Beans command does not accept spaces in domain name

I try to run following commnad:
beans -d java.lang:name=Code Cache,type=MemoryPool

Then I get:
#IllegalArgumentException: Domain java.lang:name=Code doesn't exist, check your spelling

It looks like this command does not handle well with names having ' ' (in my case 'Code Cache ')

open -PID- does not return

Thanks for this great tool, I use it a lot. But in one of my environments, I am unable to open a connection to a running Tomcat (all components do work on other machines with JMXTerm uber 1.0.2). Please refer this attempt:

grafik

after both open commands in my screenshot I've waited several minutes without it getting back to prompt. I then ctrl+c out of it. I dont understand, what I am missing here. There is no feedback (also with verbose option on). I'd expect an error, or a timeout oslt.
I'd be happy if you could advise!

Error with verbose argument

I get the following error while launching with the following arguments:

java -jar jmxterm-1.0-alpha-4-uber.jar -l localhost:9010 -v

java.lang.IllegalArgumentException: No enum constant org.cyclopsgroup.jmxterm.io.VerboseLevel.
    at java.lang.Enum.valueOf(Enum.java:238)
    at org.cyclopsgroup.jmxterm.io.VerboseLevel.valueOf(VerboseLevel.java:12)
    at org.cyclopsgroup.jmxterm.boot.CliMain.execute(CliMain.java:73)
    at org.cyclopsgroup.jmxterm.boot.CliMain.main(CliMain.java:48)
    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)

get only value of java.lang:type=Memory HeapMemoryUsage used|committed|...

Hi,

I'm trying to only get the value of java.lang:type=Memory HeapMemoryUsage.used.

The following does not work:

echo 'get used -s -b java.lang:type=Memory HeapMemoryUsage' | java -jar /tmp/jmxterm-1.0-alpha-4-uber.jar -l localhost:10006 -v silent -n

The result is

{ 
  committed = 663617536;
  init = 62761024;
  max = 1908932608;
  used = 424752800;
 }

What I expected is

424752800

I'm not a java programmer, but a sysadmin trying to get these values into Zabbix.

Can you give me a clue?

Thanks,
Sven

jmxterm left JMX connection open

I'm using jmxterm to check if my services are running using something like this:

echo "get -s -b kafka.server:type=app-info version" | java -jar /usr/bin/jmxterm-1.0.0-uber.jar -l 127.0.0.1:10000 -n -e

As side effect, I'm seeing several (more than 20) threads JMX server connection timeout XXX on my service.

Seems jmxterm is not disconnecting.

https://github.com/jiaqi/jmxterm/blob/master/src/main/java/org/cyclopsgroup/jmxterm/boot/CliMain.java#L149

I see it does close() the session, but, doesn't disconnected() the fore mentioned session.

I will be submitting a patch shortly

How to track java.nio domain

Pls suggest

$>beans
#domain = java.nio:
java.nio:name=direct,type=BufferPool
java.nio:name=mapped,type=BufferPool

$>bean java.nio:type=BufferPool
#IllegalArgumentException: Bean name java.nio:type=BufferPool isn't valid

Security issues in v1.0.1

Hi there ๐Ÿ‘‹, we detect that the latest version uses a dependency with security issues:

commons-beanutils
1.9.3

I've seen that was updated in commit 7cb8f02 but no release was triggered.

Do you have a release scheduled soon?

error opening local connection

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?

jmx open failure, can you elucidate?

I'm troubleshooting some Cassandra issues and I've narrowed it down to some oddness around jmx being accessed externally (externally from the server). Using jmxterm, I can connect locally on a Cassandra host, but cannot fully connect remotely to the other nodes in the cluster. Can you shed some light on what this connection error would mean? My best guess is the random ephemeral port the connection switches to after the initial connection is made is failing, but I can't see how. See log below - first connection is the local host, second connection is the host right next to it.

$ java -jar jmxterm-1.0.1-uber.jar -v verbose Welcome to JMX terminal. Type "help" for available commands. $>open 10.148.20.31:7199 #Connection to 10.148.20.31:7199 is opened $>close #disconnected $>open 10.148.20.32:7199 org.cyclopsgroup.jmxterm.io.RuntimeIOException: Runtime IO exception: no such object in table at org.cyclopsgroup.jmxterm.cc.CommandCenter.doExecute(CommandCenter.java:144) at org.cyclopsgroup.jmxterm.cc.CommandCenter.execute(CommandCenter.java:184) at org.cyclopsgroup.jmxterm.boot.CliMain.execute(CliMain.java:141) at org.cyclopsgroup.jmxterm.boot.CliMain.main(CliMain.java:41) Caused by: java.rmi.NoSuchObjectException: no such object in table at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:303) at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:279) at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:164) at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(RemoteObjectInvocationHandler.java:235) at java.rmi.server.RemoteObjectInvocationHandler.invoke(RemoteObjectInvocationHandler.java:180) at com.sun.proxy.$Proxy8.newClient(Unknown Source) at javax.management.remote.rmi.RMIConnector.getConnection(RMIConnector.java:2430) at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:308) at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:270) at org.cyclopsgroup.jmxterm.cc.SessionImpl.doConnect(SessionImpl.java:64) at org.cyclopsgroup.jmxterm.cc.SessionImpl.connect(SessionImpl.java:39) at org.cyclopsgroup.jmxterm.cmd.OpenCommand.execute(OpenCommand.java:60) at org.cyclopsgroup.jmxterm.cc.CommandCenter.doExecute(CommandCenter.java:169) at org.cyclopsgroup.jmxterm.cc.CommandCenter.doExecute(CommandCenter.java:142) ... 3 more $>

not working inside a container of `mcr.microsoft.com/java/jre-headless:11-zulu-centos` image

As already mentioned by others, looks like not working with headless jre, is it known and expected? Or it's going and is possible to be fixed?

98s         Warning   Unhealthy   pod/xxxxxx-7d5588cf66-ss9xp   Liveness probe failed: Exception in thread "main" j
ava.lang.UnsupportedOperationException: sun.tools.jconsole.LocalVirtualMachine, operation on this JDK(11.0.9.1+1-LTS) is
n't fully supported
            at org.cyclopsgroup.jmxterm.pm.UnsupportedJavaProcessManager.get(UnsupportedJavaProcessManager.java:40)
            at org.cyclopsgroup.jmxterm.SyntaxUtils.getUrl(SyntaxUtils.java:41)
            at org.cyclopsgroup.jmxterm.boot.CliMain.execute(CliMain.java:135)
            at org.cyclopsgroup.jmxterm.boot.CliMain.main(CliMain.java:41)
Caused by: java.lang.ClassNotFoundException: sun.tools.jconsole.LocalVirtualMachine
            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.cyclopsgroup.jmxterm.jdk6.Jdk6JavaProcessManager.<init>(Jdk6JavaProcessManager.java:22)
            at org.cyclopsgroup.jmxterm.cc.JPMFactory.<init>(JPMFactory.java:33)
            at org.cyclopsgroup.jmxterm.cc.CommandCenter.<init>(CommandCenter.java:75)
            at org.cyclopsgroup.jmxterm.cc.CommandCenter.<init>(CommandCenter.java:60)
            at org.cyclopsgroup.jmxterm.boot.CliMain.execute(CliMain.java:113)
            ... 1 more

not using flushing IO but doing 100s of system calls

during the output phase of a command (say "get"), each and every value gets written out to stdout/file immediately - there is no caching/flushing happening out of the box.

This results in lots of individual write system-calls.

Example system calls for get -i -b "java.lang:type=Memory" * :

write(1, "  ", 2)                       = 2
write(1, "init", 4)                     = 4
write(1, " = ", 3)                      = 3
write(1, "24313856", 8)                 = 8
write(1, ";", 1)                        = 1
write(1, " (init)", 7)                  = 7
write(1, "\n", 1)                       = 1
write(1, "  ", 2)                       = 2
write(1, "max", 3)                      = 3
write(1, " = ", 3)                      = 3
write(1, "138412032", 9)                = 9
write(1, ";", 1)                        = 1
write(1, " (max)", 6)                   = 6
write(1, "\n", 1)                       = 1

This is bad from a performance perspective and also bad for efficient output parsing...

Some caching/flushing would help reduce the overhead and help with output parsing.

Empty string is passed as null

I'm not sure if this is a regression from: https://bugs.launchpad.net/jmxterm/+bug/319064

But I'm trying to pass in an empty string and it keeps getting converted to null:

$>run forceKeyspaceCleanup keyspace1 ""
#calling operation forceKeyspaceCleanup of mbean org.apache.cassandra.db:type=StorageService with params [keyspace1, null]
javax.management.RuntimeMBeanException: java.lang.NullPointerException
	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.rethrow(DefaultMBeanServerInterceptor.java:839)
	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.rethrowMaybeMBeanException(DefaultMBeanServerInterceptor.java:852)
	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:821)

I also tried with double quotes around keyspace1 and it had the same output.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.