I am trying to connect to a remote Websphere Deployment manager from a Websphere Application Server. For this I am using the Websphere AdminClient, but I keep getting the error java.lang.NoClassDefFoundError: com/ibm/websphere/management/AdminClientFactory when I try to run this code:
props = new Properties();
props.setProperty(AdminClient.CONNECTOR_HOST, hostname);
props.setProperty(AdminClient.CONNECTOR_TYPE, AdminClient.CONNECTOR_TYPE_SOAP);
props.setProperty(AdminClient.CONNECTOR_PORT, "8880");
props.setProperty(AdminClient.USERNAME, "<username>");
props.setProperty(AdminClient.PASSWORD, "<password>");
props.setProperty(AdminClient.CONNECTOR_SECURITY_ENABLED, "true");
try {
adminClient = AdminClientFactory.createAdminClient(props);
} catch (Exception e) {
// TODO Auto-generated catch block
System.out.println("Something went wrong");
e.printStackTrace();
}
I have added the com.ibm.ws.admin.client_8.5.0.jar to the project.
Also here are the imports I have at the start
import java.util.Properties;
import com.ibm.websphere.management.*;
import com.ibm.websphere.management.exception.ConnectorException;
Does anyone know what I did wrong?