创建用于Java的WebSphere管理客户机程序 [英] Create WebSphere administrative client program for java
问题描述
我使用IBM WebSphere服务器。我需要为使用WebSphere管理API的Java创建WebSphere管理客户机程序。我使用<一个href=\"http://pic.dhe.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=/com.ibm.websphere.ex$p$pss.doc/info/exp/ae/tjmx_develop.html\"相对=nofollow>这$ C,用于创建管理客户机$ C
I am using IBM WebSphere server. I need to Create WebSphere administrative client program for java using WebSphere Administrative API's. I am using this code for creating admin client
...
adminClient = AdminClientFactory.createAdminClient(connectProps);
...
但它给例外。
系统无法创建SOAP连接器连接在端口8881到主机本地主机。
创建客户端后,我想通过这个API来配置WASADMIN。我是在正确的轨道?
After creating client I want to configure WASADMIN through this API. Am I on right track?
我需要通过这个API共享库。
I need to get shared library through this API.
推荐答案
检查,如果你有这样的服务器SOAP连接器端口设置为8881.
check if you have this server SOAP connector port set to 8881.
在DMGR单击服务器名称不是端口进行检查。如果不使用8881比它更改为正确的端口正在使用你试图连接到服务器。
In Dmgr click the server name than Ports to check it. If not using 8881 than change it to the correct port being used by the server you're trying to connect to.
更新:
我在我的环境(Linux)的做了一个测试及以下code的工作(我不得不添加WebSphere_ND8.5 /应用服务器/运行时/ com.ibm.ws.admin.client_8.5.0.jarto类路径运行它没有得到一个ClassNotFoundException):
I did a test in my environment(Linux) and the following code worked( I had to add WebSphere_ND8.5/AppServer/runtimes/com.ibm.ws.admin.client_8.5.0.jarto classpath to run it without getting a ClassNotFoundException):
import java.util.Properties;
import java.util.logging.Logger;
import com.ibm.websphere.management.AdminClient;
import com.ibm.websphere.management.AdminClientFactory;
import com.ibm.websphere.management.exception.ConnectorException;
public class AdminConnect {
private static Logger logger = Logger.getLogger(AdminConnect.class.getName());
/**
* @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, "localhost");
connectProps.setProperty(AdminClient.CONNECTOR_PORT, "8880");
// connectProps.setProperty(AdminClient.USERNAME, "test2");
// connectProps.setProperty(AdminClient.PASSWORD, "user24test");
AdminClient adminClient = null;
try
{
adminClient = AdminClientFactory.createAdminClient(connectProps);
logger.info("Connected successfuly with WebSphere :) ");
}
catch (ConnectorException e)
{
logger.severe("Exception creating admin client: " + e);
e.printStackTrace();
}
}
}
这篇关于创建用于Java的WebSphere管理客户机程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!