title: error while creating adminclient for websphere 7.0.0.11
body: <p>I need to develop an application for managing WebSphere Application Server v7.0.0.11. I explored a bit and found out that we can use Mbeans. Actually I need to create something similar as Web-sphere's web console.</p>
  
  <p>My problem is that the application should be in C# .net so is there any connector/Adapter to invoke web-sphere's management API. Please point me in right direction.</p>
  
  <p>I am a C#.net developer and a total newbie in java/websphere, I tried creating Admin Client Example from IBM site by using packages found at IBM/Webshpere/Cimrepos directory. The name of Jar file is <strong><code>com.ibm.wplc.was_7.0.0.11.jar</code></strong> I unzipped that jar file in the same folder.</p>
  
  <p>So now My App is starts, connects to websphere successfully and finds mbean on the nodeAgent. The problem I am facing in invoking mbean. I am getting following error message.</p>
  
  <p><em><strong><code>exception invoking launchProcess : javax.management.ReflectionExcetion: Target Method not found com.ibm.ws.management.nodeagent.NodeAgent.launchProcess</code></em></strong></p>
  
  <p>I am using following url for list of mbean</p>
  
  <p><a href="http://pic.dhe.ibm.com/infocenter/wasinfo/v7r0/index.jsp?topic=/com.ibm.websphere.javadoc.doc/web/mbeanDocs/index.html" rel="nofollow">http://pic.dhe.ibm.com/infocenter/wasinfo/v7r0/index.jsp?topic=/com.ibm.websphere.javadoc.doc/web/mbeanDocs/index.html</a></p>
  
  <p>i tried using different methods from nodeAgent mbean but no joy , I am always getting same exception <strong>"method not found"</strong>.</p>
  
  <p>Following is the code snipped for invoking launchprocess</p>
  
  <pre><code>private void invokeLaunchProcess(String serverName)  
      {  
          // Use the launchProcess operation on the NodeAgent MBean to start  
          // the given server  
          String opName = "launchProcess";  
          String signature[] = { "java.lang.String" };  
          String params[] = { serverName };  
          boolean launched = false;  
          try  
          {  
              Boolean b = (Boolean)adminClient.invoke(nodeAgent, opName, params, null);  
              launched = b.booleanValue();  
              if (launched)  
                  System.out.println(serverName + " was launched");  
              else  
                  System.out.println(serverName + " was not launched");  
  
          }  
          catch (Exception e)  
          {  
              System.out.println("Exception invoking launchProcess: " + e);  
          }  
      }
  </code></pre>
  
  <p>Full Code could be found on following link</p>
  
  <p><a href="http://pic.dhe.ibm.com/infocenter/wasinfo/v6r0/index.jsp?topic=%2Fcom.ibm.websphere.express.doc%2Finfo%2Fexp%2Fae%2Ftjmx_develop.html" rel="nofollow">http://pic.dhe.ibm.com/infocenter/wasinfo/v6r0/index.jsp?topic=%2Fcom.ibm.websphere.express.doc%2Finfo%2Fexp%2Fae%2Ftjmx_develop.html</a></p>
  
  <p>Please let me know what I am doing wrong, do i need to include some other package ? I browsed <code>com.ibm.wplc.was_7.0.0.11.jar</code>, there isn't any folder named nodeagent in <code>com\ibm\ws\managemnt</code>. I found the same jar file in Appserver\runtimes library. </p>
  
  <p>Any help is greatly appreciated, Thanks in Advance. </p>
  
  <p><strong>Getting Mbean</strong> </p>
  
  <pre><code>private void getNodeAgentMBean(String nodeName)
      {
          // Query for the ObjectName of the NodeAgent MBean on the given node
          try
          {
              String query = "WebSphere:type=NodeAgent,node=" + nodeName + ",*";
              ObjectName queryName = new ObjectName(query);
              Set s = adminClient.queryNames(queryName, null);
              if (!s.isEmpty())
                  nodeAgent = (ObjectName)s.iterator().next();
              else
              {
                  System.out.println("Node agent MBean was not found");
                  System.exit(-1);
              }
          }
          catch (MalformedObjectNameException e)
          {
              System.out.println(e);
              System.exit(-1);
          }
          catch (ConnectorException e)
          {
              System.out.println(e);
              System.exit(-1);
          }catch (Exception e){
              e.printStackTrace();
              System.exit(-1);
          }
  
          System.out.println("Found NodeAgent MBean for node " + nodeName);
      }
  </code></pre>