Remote EJB Look Up Fail
[nobr]Hi,
I was trying to invoke a remote EJB and generated the following exception:
java.lang.IncompatibleClassChangeError: com.ibm.CORBA.iiop.ORB method
createObjectURL(Ljava/lang/String;)Lcom/ibm/CORBA/iiop/ObjectURL;at
com.ibm.ws.naming.util.WsnInitCtxFactory.parseIiopUrl(WsnInitCtxFactory.java
:1668)at
com.ibm.ws.naming.util.WsnInitCtxFactory.parseBootstrapURL(WsnInitCtxFactory
.java:1427)at
com.ibm.ws.naming.util.WsnInitCtxFactory.getInitialContextInternal(WsnInitCt
xFactory.java:368)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).
The code I've written is as follows
PrintWriter out=resp.getWriter();
try{
Properties p=new Properties();
p.put(Context.INITIAL_CONTEXT_FACTORY,"com.ibm.websphere.naming.WsnInitialCo
ntextFactory");
p.put(Context.PROVIDER_URL,"rmi://mirdev58.mircity.com:2089");
InitialContext ic=new InitialContext(p);
/*this will give the services available in the context */
Enumeration en=ic.list("/ejb/com/miracle");
while(en.hasMoreElements())
{
out.println(en.nextElement()+"<br>");
}
/*this will lookup all the objects and services that are available in that
context*/
Object home=ic.lookup("/ejb/com/miracle/HelloHome");
//the jndi name for the home interface
HelloHome
lh=(HelloHome)PortableRemoteObject.narrow(obj,HelloHome.class);
HelloLocal bean=lh.create();
pw.println(" "+bean.sayHello());}
catch(Exception e)
{out.println("problem............."+e);}
This works fine when invoking a bean located on the same server.
I've double checked the host name, port, JNDI name and things are perfect.
I'm using IBM WebSphere App. Server and WebSphere Studio Developer. Any suggestions is appreciated.
Thanks[/nobr]

