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

JBIDE-26598 - fix JMX navigator local processes with JDK9+ Eclipse #619

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -20,6 +20,7 @@
import org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent;
import org.eclipse.core.runtime.preferences.InstanceScope;
import org.eclipse.osgi.util.NLS;
import org.jboss.tools.common.jdt.debug.JavaUtilities;
import org.jboss.tools.common.jdt.debug.RemoteDebugActivator;
import org.jboss.tools.common.jdt.debug.tools.ToolsCore;
import org.jboss.tools.common.jdt.debug.tools.ToolsCore.AttachedVM;
Expand Down Expand Up @@ -233,20 +234,22 @@ public String getLocalConnectorAddressInternal(Object monitoredVm, int pid) thro
try {
virtualMachine = ToolsCore.attach(pid);

String javaHome = ToolsCore.getSystemProperties(virtualMachine)
.getProperty(IConstants.JAVA_HOME_PROPERTY_KEY);
if(!JavaUtilities.isJigsawRunning()) {
Copy link
Member Author

@apupier apupier Mar 27, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please note that it would be more accurate if we are checking if jigsaw is running on the targeted vm (it will be required to handle the other problematic use case)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I created another set of PR to handle it more accurately: jbosstools/jbosstools-base#642 and #620

String javaHome = ToolsCore.getSystemProperties(virtualMachine)
.getProperty(IConstants.JAVA_HOME_PROPERTY_KEY);

File file = new File(javaHome + IConstants.MANAGEMENT_AGENT_JAR);
File file = new File(javaHome + IConstants.MANAGEMENT_AGENT_JAR);

if (!file.exists()) {
String message = NLS.bind(Messages.fileNotFoundMsg,
file.getPath());
throw new JvmCoreException(IStatus.ERROR, message,
new Exception());
}
if (!file.exists()) {
String message = NLS.bind(Messages.fileNotFoundMsg,
file.getPath());
throw new JvmCoreException(IStatus.ERROR, message,
new Exception());
}

ToolsCore.loadAgent(virtualMachine, file.getAbsolutePath(),
IConstants.JMX_REMOTE_AGENT);
ToolsCore.loadAgent(virtualMachine, file.getAbsolutePath(),
IConstants.JMX_REMOTE_AGENT);
}

Properties props = ToolsCore.getAgentProperties(virtualMachine);
url = (String) props.get(LOCAL_CONNECTOR_ADDRESS);
Expand Down