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

Unable to connect to generic JVM processes via discover play button #2339

Closed
skarsaune opened this issue Jun 27, 2017 · 0 comments
Closed

Unable to connect to generic JVM processes via discover play button #2339

skarsaune opened this issue Jun 27, 2017 · 0 comments

Comments

@skarsaune
Copy link
Contributor

skarsaune commented Jun 27, 2017

Procedure:

  1. Start jolokia in a plain generic Java process that is not recognized by the discovery function (ie. not tomcat/jetty/jboss etc). For ease of testing the agent can be attached and started in the Connect / local tab.
  2. Go to Connect / discover
  3. Wait for process to show up. The process should show a Java coffee cup icon according to first step
    image
  4. Hit the play button to the far right
  5. A new tab will appear for the other VM but it will be attached to the original/hawtio JVM
  6. If you look in the drop down for connections in the Connect/remote tab, an entry called undefined will appear.
    image

Problem:
The code works by

  1. creating a connection specification for the other vm and save it to local storage.
  2. Open a new hawtio tab
  3. Pass the connection name to the newly opened tab ( ?con=undefined)

The problem is that the connection name is derived from the agent definition (information about discovered java process)
options.name = agent.agent_description;

which may be undefined.

Solution:
Fall back to some safe name for the connection.

  1. Either hard coded:
    options.name = agent.agent_description || 'discover';

  2. Or unique (in case one fears overwriting definition for several discovered connections):

options.name = agent.agent_description || agent.agent_id;

Both solutions tested successfully locally.

Possible further steps:
prefix to mark connection definitions?
Cleanup after successfully connecting from new tab to remove connection from local storage, to avoid connection list being filled up? But that may give issues if one reloads the tab in browser unless the information is saved elsewhere ?
Alternatively, hide discover connections from view or store in an alternate place in local storage.

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

2 participants