0

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?

Strike08
  • 267
  • 1
  • 2
  • 17

1 Answers1

2

It seems I have solved this one myself. If anyone has a similar problem add the com.ibm.ws.admin.client_x.x.x.jar to the folder WEB-INF/lib

Strike08
  • 267
  • 1
  • 2
  • 17