我正在尝试从Websphere Application Server连接到远程Websphere部署管理器。为此,我使用的是Websphere AdminClient,但是当我试图运行以下代码时,我仍然会得到错误java.lang.NoClassDefFoundError: AdminClient:
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();
}我已将com.ibm.ws.admin.client_8.5.0.jar添加到项目中。
这也是我刚开始时的进口品
import java.util.Properties;
import com.ibm.websphere.management.*;
import com.ibm.websphere.management.exception.ConnectorException;有人知道我做错了什么吗?
发布于 2016-05-25 14:11:04
看来我自己解决了这个问题。如果有类似的问题,将com.ibm.ws.admin.client_x.x.x.jar添加到WEB/lib文件夹中。
https://stackoverflow.com/questions/37410030
复制相似问题