gpt4 book ai didi

java - Websphere 管理工具

转载 作者:行者123 更新时间:2023-11-30 04:27:00 24 4
gpt4 key购买 nike

我正在尝试为 websphere 创建一个管理客户端程序,但是当我尝试连接时,我收到以下消息。

也许我缺少一些库(我在记事本中创建我的应用程序)。

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

我的代码:

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); }
}
}

最佳答案

尝试将 $WEBSPHERE_HOME/AppServer/runtimes/com.ibm.ws.admin.client_8.5.0.jar 或类似的文件(如果您使用的是不同的 WebSphere 版本)添加到类路径中。这是 WebSphere Admin Client 所需的 jar。

关于java - Websphere 管理工具,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15631819/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com