Problem in PortableRemoteObject

Hi i am getting this error while making Session bean.

I think its not getting a proper object in lookup.

java.lang.ClassCastException at com.sun.corba.se.internal.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:293)

Code is like this:

InitialContext ctx = new InitialContext();

Object ob = ctx.lookup("java:comp/env/ejb/CaliculatorBean");

CaliculatorHome home =

(CaliculatorHome) PortableRemoteObject.narrow(ob,CaliculatorHome.class);

//Initialize the enterprise bean

calc = home.create();

Help me out.................

Reply as sson as possible.........

Thanks in advance.....................

[687 byte] By [c.anejaa] at [2007-11-27 7:41:35]
# 1

This works for me:

try {

// new context obj

Context initialNamingContext = new InitialContext();

// CosNaming look up

TymeacInterface Ti = (TymeacInterface)

javax.rmi.PortableRemoteObject.narrow(

initialNamingContext.lookup("the name of your IIOP_name"),

TymeacInterface.class);

}

cooper6a at 2007-7-12 19:22:14 > top of Java-index,Core,Core APIs...