0

Im trying to view the available MBeans in order to come up with a solution (access adminserver jmx and monitor sessions/connections/etc. of all other servers in the domain). Weblogic server is running on a remote server.

The idea is to create a java script which connects to the JMX, reads the domain and finds the connected servers, export the list of connected server to a monitoring tool and then every x minutes ping Weblogics mbean server and find out the needed params for each server within the domain. Yet when I try creating a connection to the Weblogic JMX, im hitting a "infinite loop" which I assume that means a connection is repetitively trying to be made unsuccessfully.

The admin server has been given these params (start up):

-XX:+UnlockCommercialFeatures -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9001 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.rmi.port=9001 

I have:

  • locally installed WLS version : fmw_14.1.1.0.0_wls_lite_quick_generic
  • added wlthint3client.jar to classpath within IDEA
  • tried checking the firewall by pinging the IP:PORT via telnet in cmd, the port is definitely open

Method creating a connection to JMX:

 String protocol = "t3"; String jndiroot = "/jndi/"; String mBeanServer = "weblogic.management.mbeanservers.domainruntime"; public MBeanServerConnection getMBeanServerConnection() throws IOException { return getJmxConnector().getMBeanServerConnection(); } public JMXConnector getJmxConnector() throws IOException { JMXServiceURL serviceURL = new JMXServiceURL(protocol, hostname, port, jndiroot + mBeanServer); Hashtable<String,String> hashtable = new Hashtable<String, String>(); hashtable.put(Context.SECURITY_PRINCIPAL, username); hashtable.put(Context.SECURITY_CREDENTIALS, password); hashtable.put(JMXConnectorFactory.PROTOCOL_PROVIDER_PACKAGES, "weblogic.management.remote"); System.out.println("MAKING JMX CONNECTION..."); connector = JMXConnectorFactory.connect(serviceURL, hashtable); System.out.println("JMX CONNECTION MADE..."); return connector; } 

Only the first print is executed...

When performing a connection to service:jmx:rmi:///jndi/rmi://<WLS_IP>:9001/jmxrmi everything works fine, however this is not a connection to the MBean Server, meaning I dont have access to the required MBeans for monitoring the server domain and its traffic.

1 Answer 1

2

Add the following JVM Property to your server instance to get access to WebLogic's mbeans :

-Djavax.management.builder.initial=weblogic.management.jmx.mbeanserver.WLSMBeanServerBuilder 
Sign up to request clarification or add additional context in comments.

3 Comments

This was precisely what was needed, this enabled me to access the WLS MBeans. However, I am trying to access the WLS MBean server which contains the Runtime MBeans (e.g. WebAppComponentRuntime bean containing the count of current sessions). So pretty much its either a bad WL config, wlthint3client isnt working properly with my client or something I have overseen... (Currently stuck and loading like with the example in the question when performing a service:jmx:t3://xxxxx:9001/jndi/weblogic.management.mbeanservers.domainruntime connection) Any tips @EmmanuelCollin ?
You can get access to server runtimes this way : ObjectName service = new ObjectName("com.bea:Name=DomainRuntimeService,Type=weblogic.management.mbeanservers.domainruntime.DomainRuntimeServiceMBean"); ObjectName[] servers = (ObjectName[]) connection.getAttribute(service, "ServerRuntimes");
Thanks, I tried this But without any luck (bean not found). however from the docs and other posts i have read, in order to view the runtime beans, i have to make a connection to runtime mbean server iba t3 protocol.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.