Hi,
I have done remote lookup using the RMIInitialContextFactory from a Thread program.
I am able to get the JNDI object(Object obj=context.lookup("abc");), but unable to type cast it to the home object type. When i type cast using PortableRemoteObject.narrow() it throws a ClassCastException.
Can anyone pls help me out for this problem.
Thanx in advance
Easwar
-
ClassCastException trying to access an EJB in Oracle9I (4 messages)
- Posted by: Thandaveswaran Venkatraman
- Posted on: August 18 2003 02:39 EDT
Threaded Messages (4)
- ClassCastException trying to access an EJB in Oracle9I by Paul Strack on August 18 2003 10:38 EDT
- ClassCastException trying to access an EJB in Oracle9I by Thandaveswaran Venkatraman on August 19 2003 02:12 EDT
-
ClassCastException trying to access an EJB in Oracle9I by Paul Strack on August 19 2003 10:46 EDT
- ClassCastException trying to access an EJB in Oracle9I by Thandaveswaran Venkatraman on August 20 2003 12:05 EDT
-
ClassCastException trying to access an EJB in Oracle9I by Paul Strack on August 19 2003 10:46 EDT
- ClassCastException trying to access an EJB in Oracle9I by Thandaveswaran Venkatraman on August 19 2003 02:12 EDT
-
ClassCastException trying to access an EJB in Oracle9I[ Go to top ]
- Posted by: Paul Strack
- Posted on: August 18 2003 10:38 EDT
- in response to Thandaveswaran Venkatraman
Try printing out what the actual class is:
System.out.println(obj.getClass().getName()); -
ClassCastException trying to access an EJB in Oracle9I[ Go to top ]
- Posted by: Thandaveswaran Venkatraman
- Posted on: August 19 2003 02:12 EDT
- in response to Paul Strack
Hi,
My actual Home interface is ABCHome but what it returns from the PortableRemoteObject.narrow is ABCJndiEJBHome.
Any clue for this one. -
ClassCastException trying to access an EJB in Oracle9I[ Go to top ]
- Posted by: Paul Strack
- Posted on: August 19 2003 10:46 EDT
- in response to Thandaveswaran Venkatraman
If sounds like you are getting the auto-generated stub for your home interface (which should be correct). Here are some more debugging ideas:
1. Try printing out the interfaces of the ABCJndiEJBHome so make sure that in fact it implements your ABCHome interface.
Class[] interfaces = obj.getClass().getInterfaces();
for (int i=0; i<interfaces.length, i++) {
System.out.println(interfaces[i].getName());
}
2. Double check your configuration information in your ejb-jar.xml file to make sure you are specifying the home interface correctly.
Beyond that, I have not got a clue. -
ClassCastException trying to access an EJB in Oracle9I[ Go to top ]
- Posted by: Thandaveswaran Venkatraman
- Posted on: August 20 2003 00:05 EDT
- in response to Paul Strack
Hi,
The same code when i try to use it in an Application Client works fine for me.
I use ApplicationInitialContextFactory instead of RMIInitialContextFactory.
This works fine and i am able to handle with the EJB.