2016-01-25 31 views
3

我已經編寫了一個簡單的ejb瘦客戶端來查找部署在IBM WebSphere 8.5中的bean。無法查找在Websphere 8.5中是否啓用SSL

當SSL未在服務器上啓用時,我成功地能夠查找bean,但只要啓用SSL,我就開始獲得下面提到的異常。

這是我啓用了安全通管理控制檯:enter image description here

例外:

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 

代碼:

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

} 

當運行程序我也路過sas.client.props文件位置出現在我的本地文件sy中幹這裏提到。 1

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

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

可有人請幫助我如何與WebSphere應用服務器或什麼,我缺少我的客戶端或服務器端的配置上啓用SSL成功測試。

+1

在你的SSL配置要求當前已設置'客戶端證書authentication'。你真的想這麼做嗎?因爲在這種情況下,你必須設置雙向SSL。將WAS證書放入客戶端信任庫,並將客戶端證書放入WAS信任庫。如果您只想啓用SSL,請將客戶端證書設置爲從不,並確保您的客戶端信任庫中已有WAS證書。 – Gas

+0

將客戶端證書身份驗證設置爲「永不執行」後,該異常消失。 – saurav

回答

3

您還需要添加此屬性,以java命令:-Dcom.ibm.CORBA.ConfigURL =文件:///home/user1/sas.client.props

您可以複製ssl.client。 props文件(除了sas.client.props)從WebSphere Application Server安裝。您至少需要將ssl.client.props文件中的密鑰文件的位置更新爲您創建或複製密鑰文件的位置。例如,

-Dcom.ibm.ssl.keyStore = /家庭/用戶1的/ etc/key.p12 -Dcom.ibm.ssl.trustStore = /家庭/用戶1的/ etc/trust.p12

當您再次運行客戶端時,它應該會提示您將簽名者添加到信任存儲庫(如果它不存在)。

的更多細節:https://www-01.ibm.com/support/knowledgecenter/SSAW57_8.5.5/com.ibm.websphere.nd.doc/ae/tcli_ejbthinclient.html

+0

謝謝, - 根據Gas的評論和步驟進行更改後,我能夠成功查找啓用SSL的Bean。 由於這個問題得到解答,我的下一個擔心是確保握手使用SSL協議。我打算使用wireshark捕捉網絡流量。 如果我看到不同的東西,我會讓你知道。 – saurav

相關問題