连接websphere的问题

藍色的海 发布于 2012/07/05 17:37
阅读 2K+
收藏 0

在连接websphere中,我的代码是:

 

public void createAdminClient(){
		Properties connectProps=new Properties();
		connectProps.setProperty(AdminClient.CONNECTOR_TYPE, AdminClient.CONNECTOR_TYPE_SOAP);
		connectProps.setProperty(AdminClient.CONNECTOR_HOST, "192.168.1.129");
		connectProps.setProperty(AdminClient.CONNECTOR_PORT,"8880");
		try{
			adminClient=AdminClientFactory.createAdminClient(connectProps);
		}catch(ConnectorException e){
			System.out.println(e.getMessage());
			System.exit(-1);
		}
		System.out.println("adminClient="+adminClient);
		System.out.println("Connect to DeployManagement!");
 }

运行结果是:

 

七月 05, 2012 9:31:11 上午 com.ibm.websphere.management.AdminClientFactory
警告: ADMC0046W
七月 05, 2012 9:31:12 上午 com.ibm.ws.management.connector.interop.JMXClassLoader
警告: Could not find tmx4jTransform.jar in null/etc/tmx4jTransform.jar - Interoperability to older versions of WebSphere is disabled
七月 05, 2012 9:31:13 上午 com.ibm.ws.ssl.config.SSLConfigManager
信息: ssl.disable.url.hostname.verification.CWPKI0027I
adminClient=com.ibm.ws.management.AdminClientImpl@1847db1
Connect to DeployManagement!

结果是:能连接上websphere服务器,但同时也出现一些警告,请问怎么处理才能消除这些警告,个人尝试过好多方法还是消除不了这些异常。

上面是在windows下运行的结果;

但我布署在linux平台下的时候,上面的代码运行不能通过,所以我觉得是上面的警告导致的,

在Linux下运行的错误如下:

 

2013-4-7 17:36:18 com.ibm.websphere.management.AdminClientFactory
警告: ADMC0046W
com.ibm.websphere.management.exception.ConnectorException: ADMC0016E: 系统无法创建 SOAP 连接器以连接到端口 8880 上的主机 192.168.1.129。
        at com.ibm.websphere.management.AdminClientFactory.createAdminClient(AdminClientFactory.java:479)
        at netgain.monitors.apps.websphere.WebsphereMonitor.getConnection(WebsphereMonitor.java:23)
        at netgain.monitors.apps.websphere.WebSphereJVM.monitorAction(WebSphereJVM.java:32)
        at netgain.monitor.MOMonitorImpl.action(SourceFile:139)
        at netgain.monitor.MonitorWorker.c(MonitorWorker.java:507)
        at netgain.monitor.MonitorWorker.b(MonitorWorker.java:244)
        at netgain.monitor.MonitorWorker.a(MonitorWorker.java:224)
        at netgain.monitor.MonitorWorker.run(MonitorWorker.java:194)
Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.GeneratedConstructorAccessor35.newInstance(Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
        at java.lang.reflect.Constructor.newInstance(Unknown Source)
        at com.ibm.websphere.management.AdminClientFactory.createAdminClient(AdminClientFactory.java:331)
        ... 7 more
Caused by: java.lang.UnsupportedClassVersionError: com/ibm/security/certclient/util/PkSsCertFactory (Unsupported major.minor version 49.0)
        at java.lang.ClassLoader.defineClass0(Native Method)
        at java.lang.ClassLoader.defineClass(Unknown Source)
        at java.security.SecureClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.access$100(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)
        at com.ibm.ws.ssl.config.CertificateManager.isKeyCertJarAvailable(CertificateManager.java:264)
        at com.ibm.ws.ssl.provider.AbstractJSSEProvider.addHandlers(AbstractJSSEProvider.java:1003)
        at com.ibm.ws.ssl.provider.AbstractJSSEProvider.initializeHandlers(AbstractJSSEProvider.java:89)
        at com.ibm.ws.ssl.provider.IBMJSSE2Provider.<init>(IBMJSSE2Provider.java:46)
        at com.ibm.ws.ssl.JSSEProviderFactory.getInstance(JSSEProviderFactory.java:215)
        at com.ibm.ws.ssl.JSSEProviderFactory.getInstance(JSSEProviderFactory.java:71)
        at com.ibm.ws.ssl.config.SSLConfigManager.<init>(SSLConfigManager.java:133)
        at com.ibm.ws.ssl.config.SSLConfigManager.getInstance(SSLConfigManager.java:140)
        at com.ibm.ws.management.connector.soap.SOAPConnectorClient.<init>(SOAPConnectorClient.java:170)

 

加载中
0
情天大圣
情天大圣

  1. 警告问题,缺少tmx4jTransform.jar这个包;
  2. linux下错误问题,检查你的网络和linux防火墙设置,telnet测试下linux是否通!

0
藍色的海
藍色的海

谢谢!

我之前在D:\websphere\etc目录下已经导入了tmx4jTransform.jar包,在项目构建路径中也导入了tmx4jTransform.jar包。

linux我之前用ping命令,也能通过。

0
JustForFly
JustForFly
看看linux下的websphere使用的JDK版本和你的工程的JDK版本是否一致。
0
y
yyfw
警告方面,可以重定向system.out 将其输入到某个文件,输出完后,之后再重定向回控制台输出,就ok了~linux下,估计是端口连接有问题~
返回顶部
顶部