怎樣在websphere環境外的客戶端呼叫webshphere的ejb?
我試圖在非websphere的客戶端環境中呼叫websphere5.0中的ejb,
但是呼叫總是不成功。
語句如下:
System.setProperty("java.naming.factory.initial","com.ibm.websphere.naming.WsnInitalContextFactory");
System.setProperty("java.naming.provider.url","iiop://localhost/2809");
Properties props = System.getProperties();
Context ctx = new InitialContext(props);
CountHome home = (CountHome)
javax.rmi.PortableRemoteObject.narrow(
ctx.lookup("examples/CountHome"), CountHome.class);
程式執行到第五句時,就出錯,出錯資訊如下:
Unable to read required resource: implfactory.properties
java.lang.NullPointerException
at java.io.Reader.<init>(Reader.java(Inlined Compiled Code))
at java.io.InputStreamReader.<init>(InputStreamReader.java(Inlined Compiled Code))
at java.io.InputStreamReader.<init>(InputStreamReader.java(Inlined Compiled Code))
at java.util.Properties.load(Properties.java(Compiled Code))
at com.ibm.ws.util.ImplFactory$1.run(ImplFactory.java:38)
at java.security.AccessController.doPrivileged(Native Method)
at com.ibm.ws.util.ImplFactory.<clinit>(ImplFactory.java:33)
at com.ibm.ejs.jts.jts.CurrentFactory.<clinit>(CurrentFactory.java:56)
at com.ibm.ws.wlm.client.affinity.TransactionAffinityModule.<init>(TransactionAffinityModule.java:168)
at java.lang.reflect.Constructor.newInstance(Native Method)
at com.ibm.ws.wlm.client.affinity.AffinityManager.<init>(AffinityManager.java:109)
at com.ibm.ws.wlm.client.WLMClient.init(WLMClient.java:146)
at com.ibm.rmi.corba.PluginRegistry.loadPlugins(PluginRegistry.java:276)
at com.ibm.rmi.corba.ORB.initializePlugins(ORB.java:345)
at com.ibm.CORBA.iiop.ORB.initializePlugins(ORB.java:845)
at com.ibm.rmi.corba.ORB.orbParameters(ORB.java:1168)
at com.ibm.CORBA.iiop.ORB.orbParameters(ORB.java:1102)
at com.ibm.rmi.corba.ORB.set_parameters(ORB.java:1101)
at com.ibm.CORBA.iiop.ORB.set_parameters(ORB.java:1639)
at org.omg.CORBA.ORB.init(ORB.java:406)
at com.ibm.ws.orb.GlobalORBFactory.init(GlobalORBFactory.java:77)
at com.ibm.ejs.oa.EJSORBImpl.initializeORB(EJSORBImpl.java:189)
at com.ibm.ejs.oa.EJSClientORBImpl.<init>(EJSClientORBImpl.java:98)
at com.ibm.ejs.oa.EJSClientORBImpl.<init>(EJSClientORBImpl.java:74)
at com.ibm.ejs.oa.EJSORB.init(EJSORB.java:367)
at java.lang.reflect.Method.invoke(Native Method)
at com.ibm.ws.naming.util.Helpers.getOrb(Helpers.java:313)
at com.ibm.ws.naming.util.WsnInitCtxFactory.getInitialContextInternal(WsnInitCtxFactory.java:363)
at com.ibm.ws.naming.util.WsnInitCtx.getContext(WsnInitCtx.java:102)
at com.ibm.ws.naming.util.WsnInitCtx.getContextIfNull(WsnInitCtx.java:408)
at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:131)
at javax.naming.InitialContext.lookup(InitialContext.java:359)
at examples.CountClient.main(CountClient.java:48)
javax.naming.ServiceUnavailableException: A communication failure occurred while attempting to obtain an initial context using the provider url: "iiop://localhost/2809". Make sure that the host and port information is correct and that the server identified by the provider url is a running name server. If no port number is specified, the default port number 2809 is used. Other possible causes include the network environment or workstation network configuration. Root exception is org.omg.CORBA.UNKNOWN: minor code: 0 completed: Maybe
at com.ibm.CORBA.iiop.ClientDelegate.intercept(ClientDelegate.java:966)
at com.ibm.CORBA.iiop.ClientDelegate.invoke(ClientDelegate.java:528)
at com.ibm.CORBA.iiop.ClientDelegate.invoke(ClientDelegate.java:713)
at org.omg.CORBA.portable.ObjectImpl._invoke(ObjectImpl.java:258)
at com.ibm.WsnBootstrap._WsnNameServiceStub.getProperties(_WsnNameServiceStub.java:38)
at com.ibm.ws.naming.util.WsnInitCtxFactory.mergeWsnNSProperties(WsnInitCtxFactory.java:1090)
at com.ibm.ws.naming.util.WsnInitCtxFactory.getRootContextFromServer(WsnInitCtxFactory.java:676)
at com.ibm.ws.naming.util.WsnInitCtxFactory.getRootJndiContext(WsnInitCtxFactory.java:604)
at com.ibm.ws.naming.util.WsnInitCtxFactory.getInitialContextInternal(WsnInitCtxFactory.java:478)
at com.ibm.ws.naming.util.WsnInitCtx.getContext(WsnInitCtx.java:102)
at com.ibm.ws.naming.util.WsnInitCtx.getContextIfNull(WsnInitCtx.java:408)
at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:131)
at javax.naming.InitialContext.lookup(InitialContext.java:359)
at examples.CountClient.main(CountClient.java:48)
急等高人的值點?
但是呼叫總是不成功。
語句如下:
System.setProperty("java.naming.factory.initial","com.ibm.websphere.naming.WsnInitalContextFactory");
System.setProperty("java.naming.provider.url","iiop://localhost/2809");
Properties props = System.getProperties();
Context ctx = new InitialContext(props);
CountHome home = (CountHome)
javax.rmi.PortableRemoteObject.narrow(
ctx.lookup("examples/CountHome"), CountHome.class);
程式執行到第五句時,就出錯,出錯資訊如下:
Unable to read required resource: implfactory.properties
java.lang.NullPointerException
at java.io.Reader.<init>(Reader.java(Inlined Compiled Code))
at java.io.InputStreamReader.<init>(InputStreamReader.java(Inlined Compiled Code))
at java.io.InputStreamReader.<init>(InputStreamReader.java(Inlined Compiled Code))
at java.util.Properties.load(Properties.java(Compiled Code))
at com.ibm.ws.util.ImplFactory$1.run(ImplFactory.java:38)
at java.security.AccessController.doPrivileged(Native Method)
at com.ibm.ws.util.ImplFactory.<clinit>(ImplFactory.java:33)
at com.ibm.ejs.jts.jts.CurrentFactory.<clinit>(CurrentFactory.java:56)
at com.ibm.ws.wlm.client.affinity.TransactionAffinityModule.<init>(TransactionAffinityModule.java:168)
at java.lang.reflect.Constructor.newInstance(Native Method)
at com.ibm.ws.wlm.client.affinity.AffinityManager.<init>(AffinityManager.java:109)
at com.ibm.ws.wlm.client.WLMClient.init(WLMClient.java:146)
at com.ibm.rmi.corba.PluginRegistry.loadPlugins(PluginRegistry.java:276)
at com.ibm.rmi.corba.ORB.initializePlugins(ORB.java:345)
at com.ibm.CORBA.iiop.ORB.initializePlugins(ORB.java:845)
at com.ibm.rmi.corba.ORB.orbParameters(ORB.java:1168)
at com.ibm.CORBA.iiop.ORB.orbParameters(ORB.java:1102)
at com.ibm.rmi.corba.ORB.set_parameters(ORB.java:1101)
at com.ibm.CORBA.iiop.ORB.set_parameters(ORB.java:1639)
at org.omg.CORBA.ORB.init(ORB.java:406)
at com.ibm.ws.orb.GlobalORBFactory.init(GlobalORBFactory.java:77)
at com.ibm.ejs.oa.EJSORBImpl.initializeORB(EJSORBImpl.java:189)
at com.ibm.ejs.oa.EJSClientORBImpl.<init>(EJSClientORBImpl.java:98)
at com.ibm.ejs.oa.EJSClientORBImpl.<init>(EJSClientORBImpl.java:74)
at com.ibm.ejs.oa.EJSORB.init(EJSORB.java:367)
at java.lang.reflect.Method.invoke(Native Method)
at com.ibm.ws.naming.util.Helpers.getOrb(Helpers.java:313)
at com.ibm.ws.naming.util.WsnInitCtxFactory.getInitialContextInternal(WsnInitCtxFactory.java:363)
at com.ibm.ws.naming.util.WsnInitCtx.getContext(WsnInitCtx.java:102)
at com.ibm.ws.naming.util.WsnInitCtx.getContextIfNull(WsnInitCtx.java:408)
at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:131)
at javax.naming.InitialContext.lookup(InitialContext.java:359)
at examples.CountClient.main(CountClient.java:48)
javax.naming.ServiceUnavailableException: A communication failure occurred while attempting to obtain an initial context using the provider url: "iiop://localhost/2809". Make sure that the host and port information is correct and that the server identified by the provider url is a running name server. If no port number is specified, the default port number 2809 is used. Other possible causes include the network environment or workstation network configuration. Root exception is org.omg.CORBA.UNKNOWN: minor code: 0 completed: Maybe
at com.ibm.CORBA.iiop.ClientDelegate.intercept(ClientDelegate.java:966)
at com.ibm.CORBA.iiop.ClientDelegate.invoke(ClientDelegate.java:528)
at com.ibm.CORBA.iiop.ClientDelegate.invoke(ClientDelegate.java:713)
at org.omg.CORBA.portable.ObjectImpl._invoke(ObjectImpl.java:258)
at com.ibm.WsnBootstrap._WsnNameServiceStub.getProperties(_WsnNameServiceStub.java:38)
at com.ibm.ws.naming.util.WsnInitCtxFactory.mergeWsnNSProperties(WsnInitCtxFactory.java:1090)
at com.ibm.ws.naming.util.WsnInitCtxFactory.getRootContextFromServer(WsnInitCtxFactory.java:676)
at com.ibm.ws.naming.util.WsnInitCtxFactory.getRootJndiContext(WsnInitCtxFactory.java:604)
at com.ibm.ws.naming.util.WsnInitCtxFactory.getInitialContextInternal(WsnInitCtxFactory.java:478)
at com.ibm.ws.naming.util.WsnInitCtx.getContext(WsnInitCtx.java:102)
at com.ibm.ws.naming.util.WsnInitCtx.getContextIfNull(WsnInitCtx.java:408)
at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:131)
at javax.naming.InitialContext.lookup(InitialContext.java:359)
at examples.CountClient.main(CountClient.java:48)
急等高人的值點?
相關文章
- 在客戶端儲存對EJB的遠端呼叫是否可行?客戶端
- EJB客戶端如何不用任何client jar去動態呼叫遠端伺服器的EJB?客戶端clientJAR伺服器
- 在指令碼中呼叫cassandra客戶端命令指令碼客戶端
- WebSphere客戶端遷移的一般問題Web客戶端
- 以 Laravel 的方式呼叫 ai 客戶端LaravelAI客戶端
- xfire 客戶端呼叫webservice的問題客戶端Web
- 來幫我看看這個簡單的遠端客戶端呼叫EJB出錯的例子,謝謝了客戶端
- 幫忙看看我得ejb客戶端客戶端
- 在網頁如何呼叫客戶端的可執行檔案網頁客戶端
- 怎麼跨App 遠端呼叫EJBAPP
- 在客戶端呼叫程式碼中,最好出現DCI中的Data ?客戶端
- WebSphere客戶端遷移的常見問題解決二Web客戶端
- Jaeger的客戶端取樣配置(Java版)客戶端Java
- 誰知道怎樣使客戶端的ActiveX不出安全提示 (轉)客戶端
- webService 客戶端呼叫 axis2Web客戶端
- .net客戶端呼叫activeMQ程式碼客戶端MQ
- 環信3.0iOS客戶端的整合iOS客戶端
- 《java實用系統開發指南》 關於胖客戶端呼叫EJB一章Java客戶端
- ClearCase遠端客戶端軟體在網路環境下的配置應用客戶端
- 環信3.0ios客戶端的整合(四)iOS客戶端
- CouchBase C 客戶端介面呼叫例項客戶端
- 【知識積累】伺服器端獲取客戶端的IP地址(當客戶端呼叫由Axis開發的WebService)伺服器客戶端Web
- struts工程呼叫遠端EJB元件時怎麼部署元件
- ftp客戶端,ftp客戶端軟體具體怎麼使用?FTP客戶端
- 遠端application client 怎樣訪問EJBAPPclient
- .Net Remoting服務端與客戶端呼叫示例REM服務端客戶端
- C# 客戶端程式呼叫外部程式的三種實現C#客戶端
- .NET環境構建CAS客戶端客戶端
- MQTTJava客戶端的使用MQQTJava客戶端
- redis客戶端的使用Redis客戶端
- 《samba搭建win客戶端和linux客戶端的區別》Samba客戶端Linux
- spring mina整合(客戶端進行呼叫)Spring客戶端
- IE客戶客戶端程式開發的利器Bindows客戶端
- WebSphere Adapter 客戶定製的錯誤繫結WebAPT
- 環信即時通訊——整合客戶端客戶端
- Elasticsearch的PHP客戶端操作ElasticsearchPHP客戶端
- Python socket的客戶端Python客戶端
- zookeeper的Java客戶端APIJava客戶端API