dlmarion commented on issue #45:
URL: 
https://github.com/apache/accumulo-classloaders/issues/45#issuecomment-3762126753

   There was discussion in the original comment thread about finding a JMX 
client library to use in an end-to-end example utility. Just adding this to the 
discussion - I came across Jolokia, which can be set a a javaagent on a JVM 
that then exposes JMX MBeans via an HTTP interface. I was able to test this 
very easily by doing the following:
   
     1. Downloading the agent jar 
(https://search.maven.org/remotecontent?filepath=org/jolokia/jolokia-agent-jvm/2.4.2/jolokia-agent-jvm-2.4.2-javaagent.jar)
     2. Adding the following in the tserver options in accumulo-env.sh: 
`-javaagent:/path/to/agent.jar=port=7777,host=localhost`
     3. Then using a browser to make the following HTTP request: 
`http://localhost:7777/jolokia/read/org.apache.accumulo.classloader:type=ContextClassLoaders`.
   
   This resulted in the following response:
   ```
   {
     "request": {
       "mbean": "org.apache.accumulo.classloader:type=ContextClassLoaders",
       "type": "read"
     },
     "value": {
       "ReferencedFiles": {
         
"file:///tmp/contexts.json-c1f19a8a3b1864fcec75464ececbde919bc834e8128b72ce35d20bbdbd72a211":
 [
           
"file:/tmp/contexts/resources/example-iterators-a-1.0.0-SNAPSHOT-337fe466c1cf0f6299e468b581300d760b9c29940e007134de61246138e53164.jar"
         ]
       },
       "ObjectName": {
         "objectName": 
"org.apache.accumulo.classloader:type=ContextClassLoaders"
       }
     },
     "status": 200,
     "timestamp": 1768603278
   }
   ```
   
   Relevant links:
   https://jolokia.org/reference/html/manual/agents.html#agents-jvm
   https://jolokia.org/reference/html/manual/jolokia_protocol.html#get-requests


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to