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

Inconsistency in WebLogic MBean Retrieval Between JMX Exporter Versions 0.17.2 and 1.0.1 #998

Open
Sophisycho opened this issue Sep 6, 2024 · 2 comments
Assignees

Comments

@Sophisycho
Copy link

Hi JMX Exporter team,

I've been using your project for WebLogic monitoring and noticed something strange between versions 0.17.2 and 1.0.1. In 0.17.2, I can retrieve WebLogic MBeans without needing to add the following JVM argument:

-Djavax.management.builder.initial=weblogic.management.jmx.mbeanserver.WLSMBeanServerBuilder

But when I switched to version 1.0.1, I had to add this option for the MBeans to show up. It seems odd since I thought this option was supposed to be mandatory across all versions.

Could you shed some light on why this is happening? Is this an intentional change in newer versions, or is there something else going on?

Thanks in advance for any clarification!

Best regards

@dhoard dhoard self-assigned this Sep 6, 2024
@dhoard
Copy link
Collaborator

dhoard commented Sep 6, 2024

@Sophisycho I'm unaware of any changes in the exporter code that would change the behavior.

Looking at the relevant code in 0.17.2 and 1.0.1 the only change was to allow RMI to the registry without SSL...

0.17.2

if (jmxUrl.isEmpty()) {
beanConn = ManagementFactory.getPlatformMBeanServer();
} else {
Map<String, Object> environment = new HashMap<String, Object>();
if (username != null && username.length() != 0 && password != null && password.length() != 0) {
String[] credent = new String[] {username, password};
environment.put(javax.management.remote.JMXConnector.CREDENTIALS, credent);
}
if (ssl) {
environment.put(Context.SECURITY_PROTOCOL, "ssl");
SslRMIClientSocketFactory clientSocketFactory = new SslRMIClientSocketFactory();
environment.put(RMIConnectorServer.RMI_CLIENT_SOCKET_FACTORY_ATTRIBUTE, clientSocketFactory);
environment.put("com.sun.jndi.rmi.factory.socket", clientSocketFactory);
}
jmxc = JMXConnectorFactory.connect(new JMXServiceURL(jmxUrl), environment);
beanConn = jmxc.getMBeanServerConnection();

1.0.1

if (jmxUrl.isEmpty()) {
beanConn = ManagementFactory.getPlatformMBeanServer();
} else {
Map<String, Object> environment = new HashMap<>();
if (username != null
&& username.length() != 0
&& password != null
&& password.length() != 0) {
String[] credent = new String[] {username, password};
environment.put(javax.management.remote.JMXConnector.CREDENTIALS, credent);
}
if (ssl) {
environment.put(Context.SECURITY_PROTOCOL, "ssl");
SslRMIClientSocketFactory clientSocketFactory = new SslRMIClientSocketFactory();
environment.put(
RMIConnectorServer.RMI_CLIENT_SOCKET_FACTORY_ATTRIBUTE,
clientSocketFactory);
if (!"true".equalsIgnoreCase(System.getenv("RMI_REGISTRY_SSL_DISABLED"))) {
environment.put("com.sun.jndi.rmi.factory.socket", clientSocketFactory);
}
}
jmxc = JMXConnectorFactory.connect(new JMXServiceURL(jmxUrl), environment);
beanConn = jmxc.getMBeanServerConnection();

@dhoard
Copy link
Collaborator

dhoard commented Oct 22, 2024

@Sophisycho I suspect it's related to #128

I would try using startDelaySeconds.

This will delay initial metrics collection/prevent calls to ManagementFactory.getPlatformMBeanServer() in scenarios where a custom MBeanServer implementation is being used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants