怎樣在websphere環境外的客戶端呼叫webshphere的ejb?

hay1234發表於2004-09-09
我試圖在非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)

急等高人的值點?

相關文章