dcsimg
BInding of Objects in rmi-iiop in Visual Age environment
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Tuesday, June 12, 2001 03:29 AM

My SampleRmiServerClass extends PortableRemoteObject and implements a remote interface. I am using VisualAge , WebSphere Test environment to run the naming server.So I define the context factory as Context.INITIAL_CONTEXT_FACTORY=com.ibm.ejs.ns.jndi.CNInitialContextFactory; I put this plus the url provider Context.PROVIDER_URL=iiop://localhost:900 into a hashtable and created the initalCOntext using this hash table. Now I am trying to bind the instance of my RMIServer class object using the following code ctx.rebind("Hello",new SampleRmiServer()); At this point I am getting exception - javax.naming.NamingException: Hello. Root exception is java.lang.ClassCastException java.lang.Throwable() java.lang.Exception()    More>>

My SampleRmiServerClass extends PortableRemoteObject and implements a remote interface.
I am using VisualAge , WebSphere Test environment to run the naming server.So I define the context factory as Context.INITIAL_CONTEXT_FACTORY=com.ibm.ejs.ns.jndi.CNInitialContextFactory;
I put this plus the url provider Context.PROVIDER_URL=iiop://localhost:900 into a hashtable and created the initalCOntext using this hash table. Now I am trying to bind the instance of my RMIServer class object using the following code ctx.rebind("Hello",new SampleRmiServer());
At this point I am getting exception - javax.naming.NamingException: Hello. Root exception is java.lang.ClassCastException
java.lang.Throwable()
java.lang.Exception()
java.lang.RuntimeException()
java.lang.ClassCastException()
org.omg.CORBA.Object com.ibm.ejs.ns.jndi.CNContextImpl.connectRemoteCORBA(java.lang.Object)
org.omg.CORBA.Object com.ibm.ejs.ns.jndi.CNContextImpl.connectRemoteCORBA(java.lang.Object)
void com.ibm.ejs.ns.jndi.CNContextImpl.doRebind(org.omg.CosNaming.NameComponent [], java.lang.Object)
void com.ibm.ejs.ns.jndi.CNContextImpl.rebind(java.lang.String, java.lang.Object)
void javax.naming.InitialContext.rebind(java.lang.String, java.lang.Object)

But I can successfully bind to the initialContext any simple objects like String,Integer etc.
I would appreciate if any body can help me to identify the problem

   <<Less
About | Sitemap | Contact