如果在Websphere 8.5中启用了SSL,则无法查找 [英] Unable to lookup if SSL is enabled in Websphere 8.5

查看:235
本文介绍了如果在Websphere 8.5中启用了SSL,则无法查找的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经编写了一个简单的ejb瘦客户端来查找部署在IBM WebSphere 8.5中的bean。



当服务器上没有启用SSL时,我成功地查找bean,但是一旦启用了SSL,我就开始得到下面提到的异常。



这是我通过管理控制台启用安全性的方式:



异常:

  javax.naming.NamingException:获取WsnNameService属性时出错[根异常是org.omg.CORBA.TRANSIENT:初始和转发IOR无法访问vmcid:IBM次要代码:E07已完成:否] 
com.ibm.ws.naming.util.WsnInitCtxFactory.mergeWsnNSProperties(WsnInitCtxFactory.java:1552)
在com.ibm.ws.naming.util.WsnInitCtxFactory.getRootContextFromServer(WsnInitCtxFactory.java:1042)
在com.ibm .ws.naming.util.WsnInitCtxFactory.getRootJndiContext(WsnInitCtxFactory.java:962)
在com.ibm.ws.naming.util.WsnInitCtxFactory.getInitialContextInternal(WsnInitCtxFactory.java:614)
在com.ibm .ws.naming.util.WsnInitCtx.getContext(WsnInitCtx.java:128)
在com.ibm.ws.naming.util.WsnInitCtx.getContextIfNull(WsnInitCtx.java:765)
在com.ibm .ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:164)
在com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:179)
在javax.naming .InitialContext.lookup(InitialContext.java:436)
at nh.indi.test.S2SCommTest.lookupServiceEJB(S2SCommTest.java:55)
at nh.indi.test.S2SCommTest.main(S2SCommTest.java :22)
导致:org.omg.CORBA.TRANSIENT:初始化和转发IOR无法访问vmcid:IBM次要代码:E07已完成:否
在com.ibm.rmi.corba.ClientDelegate.createRequest( ClientDelegate.java:1276)
在com.ibm.CORBA.iiop.ClientDelegate.createRequest(ClientDelegate.java:1342)
在com.ibm.rmi.corba.ClientDele gate.createRequest(ClientDelegate.java:1164)
at com.ibm.CORBA.iiop.ClientDelegate.createRequest(ClientDelegate.java:1308)
at com.ibm.rmi.corba.ClientDelegate.request( ClientDelegate.java:1886)
在com.ibm.CORBA.iiop.ClientDelegate.request(ClientDelegate.java:1264)
在org.omg.CORBA.portable.ObjectImpl._request(ObjectImpl.java: 458)
在com.ibm.WsnBootstrap._WsnNameServiceStub.getProperties(_WsnNameServiceStub.java:38)
在com.ibm.ws.naming.util.WsnInitCtxFactory.mergeWsnNSProperties(WsnInitCtxFactory.java:1549)
... 10更多

代码:

  public static void main(String args [])throws NamingException {

属性ejbProps = new Properties();
ejbProps.put(org.omg.CORBA.ORBClass,com.ibm.CORBA.iiop.ORB);
ejbProps.put(Context.INITIAL_CONTEXT_FACTORY,
com.ibm.websphere.naming.WsnInitialContextFactory);
ejbProps.put(Context.PROVIDER_URL,corbaloc:iiop:160.XX.XX.XX:2809);

InitialContext ffmContext = new InitialContext(ejbProps);
对象remoteObject = ffmContext
.lookup(ejb / MyAppEar-CLUSTER / MyAppEJB.jar / BatchIdTrackingBean#indi.nh.business.framework.bos.di.BatchIdTrackingBeanRemote);

BatchIdTrackingBeanRemote serviceTester =(BatchIdTrackingBeanRemote)PortableRemoteObject
.narrow(remoteObject,BatchIdTrackingBeanRemote.class);

System.out.println(serviceTester);

}

在运行程序的同时我也传递了sas.client .props文件位置存在于本地文件系统中,如这里所述。 1

  -Dcom.ibm.CORBA.ConfigURL = file:/// C:/Temp/docs/S2S_Docs/sas.client.props 

1 如何连接到websphere应用程序服务器8.5消息队列,而启用管理安全性



有人可以帮助我如何成功测试在websphere应用程序服务器上启用SSL或什么我的客户端或服务器端配置丢失。

解决方案

您还需要将此属性添加到java命令:-Dcom。 ibm.CORBA.ConfigURL = file:///home/user1/sas.client.props



您可以复制ssl.client.props文件(除了sas .client.props)从WebSph安装Application Server。您至少需要将ssl.client.props文件中的密钥文件的位置更新为创建或复制密钥文件的匹配项。例如,



-Dcom.ibm.ssl.keyStore = / home / user1 / etc / key.p12
-Dcom.ibm.ssl.trustStore = /home/user1/etc/trust.p12



当您再次运行客户端时,如果不存在,应该提示您将签名者添加到信任存储区。 / p>

详情请见: https://www-01.ibm.com/support/knowledgecenter/SSAW57_8.5.5/com.ibm.websphere.nd.doc/ae/tcli_ejbthinclient.html


I have written a simple ejb thin client to look up the bean deployed in IBM WebSphere 8.5.

When SSL was not enabled on the server I was successfully able to lookup the bean , but as soon as I enabled the SSL , I started getting the below mentioned exception.

This is how I enabled the security thru admin console :

Exception:

javax.naming.NamingException: Error getting WsnNameService properties [Root exception is org.omg.CORBA.TRANSIENT: initial and forwarded IOR inaccessible  vmcid: IBM  minor code: E07  completed: No]
at com.ibm.ws.naming.util.WsnInitCtxFactory.mergeWsnNSProperties(WsnInitCtxFactory.java:1552)
at com.ibm.ws.naming.util.WsnInitCtxFactory.getRootContextFromServer(WsnInitCtxFactory.java:1042)
at com.ibm.ws.naming.util.WsnInitCtxFactory.getRootJndiContext(WsnInitCtxFactory.java:962)
at com.ibm.ws.naming.util.WsnInitCtxFactory.getInitialContextInternal(WsnInitCtxFactory.java:614)
at com.ibm.ws.naming.util.WsnInitCtx.getContext(WsnInitCtx.java:128)
at com.ibm.ws.naming.util.WsnInitCtx.getContextIfNull(WsnInitCtx.java:765)
at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:164)
at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:179)
at javax.naming.InitialContext.lookup(InitialContext.java:436)
at nh.indi.test.S2SCommTest.lookupServiceEJB(S2SCommTest.java:55)
at nh.indi.test.S2SCommTest.main(S2SCommTest.java:22) 
Caused by: org.omg.CORBA.TRANSIENT: initial and forwarded IOR inaccessible  vmcid: IBM  minor code: E07  completed: No
at com.ibm.rmi.corba.ClientDelegate.createRequest(ClientDelegate.java:1276)
at com.ibm.CORBA.iiop.ClientDelegate.createRequest(ClientDelegate.java:1342)
at com.ibm.rmi.corba.ClientDelegate.createRequest(ClientDelegate.java:1164)
at com.ibm.CORBA.iiop.ClientDelegate.createRequest(ClientDelegate.java:1308)
at com.ibm.rmi.corba.ClientDelegate.request(ClientDelegate.java:1886)
at com.ibm.CORBA.iiop.ClientDelegate.request(ClientDelegate.java:1264)
at org.omg.CORBA.portable.ObjectImpl._request(ObjectImpl.java:458)
at com.ibm.WsnBootstrap._WsnNameServiceStub.getProperties(_WsnNameServiceStub.java:38)
at com.ibm.ws.naming.util.WsnInitCtxFactory.mergeWsnNSProperties(WsnInitCtxFactory.java:1549)
... 10 more

Code :

public static void main(String args[]) throws NamingException {

    Properties ejbProps = new Properties();
    ejbProps.put("org.omg.CORBA.ORBClass", "com.ibm.CORBA.iiop.ORB");
    ejbProps.put(Context.INITIAL_CONTEXT_FACTORY,
            "com.ibm.websphere.naming.WsnInitialContextFactory");
    ejbProps.put(Context.PROVIDER_URL, "corbaloc:iiop:160.XX.XX.XX:2809");

    InitialContext ffmContext = new InitialContext(ejbProps);
    Object remoteObject = ffmContext
            .lookup("ejb/MyAppEar-CLUSTER/MyAppEJB.jar/BatchIdTrackingBean#indi.nh.business.framework.bos.di.BatchIdTrackingBeanRemote");

    BatchIdTrackingBeanRemote serviceTester = (BatchIdTrackingBeanRemote) PortableRemoteObject
            .narrow(remoteObject, BatchIdTrackingBeanRemote.class);

    System.out.println(serviceTester);

}

While running the program I am also passing the sas.client.props file location present in my local file system as mentioned here. 1

-Dcom.ibm.CORBA.ConfigURL=file:///C:/Temp/docs/S2S_Docs/sas.client.props

1 : How to connect to a websphere Application Server 8.5 Message Queue while Administrative Security is enabled

Can anybody please help me how to test it successfully with SSL enabled on the websphere app server or what i am missing in my client side or server side configuration.

解决方案

You also need to add this property to java command: -Dcom.ibm.CORBA.ConfigURL=file:///home/user1/sas.client.props

You can copy the ssl.client.props file (in addition to sas.client.props) from the WebSphere Application Server installation. You need to at least update the location of the key files in the ssl.client.props file to the match where you created or copied the key files. For example,

-Dcom.ibm.ssl.keyStore=/home/user1/etc/key.p12 -Dcom.ibm.ssl.trustStore=/home/user1/etc/trust.p12

When you run the client again, it should prompt you to add signer to the trust store if it is not there.

More details at: https://www-01.ibm.com/support/knowledgecenter/SSAW57_8.5.5/com.ibm.websphere.nd.doc/ae/tcli_ejbthinclient.html

这篇关于如果在Websphere 8.5中启用了SSL,则无法查找的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆