• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1388
  • Last Modified:

Start Servers using JMX - WebSphere Application Server

Hello,
I would like to start WAS servers from a remote location for which I think JMX is the best way to do so. But , when I try to query:
 ObjectName QueryName = new ObjectName("WebSphere:*,type=server") - doesnt include the stopped server information , which is proably because the requested objects are not created yet.
Can some one please advice how to implement this...
Thanks
0
sravy
Asked:
sravy
1 Solution
 
sravyAuthor Commented:
try
        {
                  String host = "host";
                  String port = "port";
                  String opName = "launchProcess";
                  String signature[] = { "java.lang.String"};
                  Object params[] = { "servername"};

            Properties config = new Properties();
                  config.put (AdminClient.CONNECTOR_HOST,  host);
                  config.put (AdminClient.CONNECTOR_PORT,  port);
                  config.put (AdminClient.CONNECTOR_TYPE, AdminClient.CONNECTOR_TYPE_SOAP);
                    AdminClient _soapClient = AdminClientFactory.createAdminClient(config);

                  ObjectName m_oQueryName = new ObjectName("WebSphere:*,type=NodeAgent");
                  Set m_oAllNamesSet = _soapClient.queryNames(m_oQueryName, null);
                  if(m_oAllNamesSet != null)
                  {
                        Iterator m_oIter = m_oAllNamesSet.iterator();
                        while(m_oIter.hasNext())
                        {
                              ObjectName m_node = (ObjectName)m_oIter.next();
                              String m_nodeName = (String)(m_node.getKeyProperty("node"));
                             _soapClient.invoke(m_node, opName, params, signature);
                        }
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now