How to read Weblogic Server details using Restful Java Client

In this post, I will explain how can you read informations from you web logic server using java client.

Use Case – This is small extract from a big use case where we are trying to build a dashboard we can keep seeing status of our deployed applications.

Solution – Only how to get all server and their status,

– Start JDeveloper
– Open localhost:7101/console
– select domain from left pane = “Default”
– expand Advanced from right pane -> Check Restart may be required. Enable RESTful Management Services


– Create a Java Client like below,

package view;

import com.sun.jersey.api.client.Client;
import com.sun.jersey.api.client.ClientResponse;
import com.sun.jersey.api.client.WebResource;
import com.sun.jersey.api.client.filter.HTTPBasicAuthFilter;

public class JerseyClientGet {

public static void main(String[] args) {
try {
Client client = Client.create();
final HTTPBasicAuthFilter authFilter = new HTTPBasicAuthFilter(“weblogic”, “welcome1”);
WebResource webResource = client

* http://localhost:7001/management/tenant-monitoring/clusters
http://localhost:7001/management/tenant-monitoring/clusters/{cluster name}
http://localhost:7001/management/tenant-monitoring/applications/{application name}
http://localhost:7001/management/tenant-monitoring/datasources/{datasource name}*/

ClientResponse response = webResource.accept(“text/html”)
if (response.getStatus() != 200) {
throw new RuntimeException(“Failed : HTTP error code : “
+ response.getStatus());
String output = response.getEntity(String.class);
System.out.println(“Output from Server …. \n”);
} catch (Exception e) {


– Run client
– Output as below, (I have copied out from console and pasted in html to show in this manner.)



Happy Coding!


एक उत्तर दें

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  बदले )

Google+ photo

You are commenting using your Google+ account. Log Out /  बदले )

Twitter picture

You are commenting using your Twitter account. Log Out /  बदले )

Facebook photo

You are commenting using your Facebook account. Log Out /  बदले )


Connecting to %s