Q:

Websphere administration tool

I'm trying to create an administrative client program for websphere,
but when I'm trying to connect I get the following message.
Maybe I lack some libs (I create my app in notepad).
at TryConnection1.main(TryConnection1.java:37) Caused by: java.lang.ClassNotFoundException: com.ibm.websphere.security.auth.WSL oginFailedException
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    ... 1 more

My code: 
import java.util.Properties;
import javax.management.MalformedObjectNameException; 
import javax.management.ObjectName; 

import javax.management.*;
import com.ibm.websphere.management.*; 
import com.ibm.websphere.management.AdminClient; 
import com.ibm.websphere.management.AdminClientFactory; 
import com.ibm.websphere.management.exception.*;

import com.ibm.websphere.management.exception.ConnectorException;

public class TryConnection1 {

    /**  * @param args  */

    public static void main(String[] args) {

    Properties connectProps = new Properties(); 
    connectProps.setProperty(AdminClient.CONNECTOR_TYPE, AdminClient.CONNECTOR_TYPE_SOAP);

    connectProps.setProperty(AdminClient.CONNECTOR_HOST, "hostgoeshere");
    connectProps.setProperty(AdminClient.CONNECTOR_PORT, "portgoeshere");
    connectProps.setProperty(AdminClient.USERNAME, "usernamegoeshere");
    connectProps.setProperty(AdminClient.PASSWORD, "passgoeshere");

    AdminClient adminClient = null; 
    try {
        adminClient = AdminClientFactory.createAdminClient(connectProps); 
    } catch(ConnectorException e) {
        System.out.println("Exception creating admin client: " + e); }
    }
}

A:

try to add $WEBSPHERE_HOME/AppServer/runtimes/com.ibm.ws.admin.client_8.5.0.jar, or similar if you're using a different WebSphere version, to your classpath. This is the required jar for WebSphere Admin Client.

