remote interface lookup issue(StatefulProxyFactory) [message #444615] |
Fri, 17 February 2006 20:45 |
Robert Messages: 45 Registered: July 2009 |
Member |
|
|
Hi everyone,
I have an RCP application that is trying to connect to a EJB3 backend.
Now i have no trouble performing the context lookup and getting an
object returned however, the object that is returned is not able to be
cast to my remote interface object.
Code:
ClassLoader orig = Thread.currentThread().getContextClassLoader();
Context ctx= null;
try{
Thread.currentThread().setContextClassLoader(RCPappPlugin.cl ass.getClassLoader());
ClassLoader curr =Thread.currentThread().getContextClassLoader();
ctx = new InitialContext();
Object referenceObject = ctx.lookup(MyInterface.class.getName());
MyInterface mi = (MyInterface)referenceObject;
....
This throws a classCastException on the last line.
When i inspect the returned object it says that its contents are
package.MyInterfaceStatefulProxyFactory. which can not be cast to
MyInterface.
When i run this in a command line application things work fine and the
object returned is a: package.MyInterfaceBean
please help as im not sure what im missing.
Thanks
Robert.
|
|
|
Powered by
FUDForum. Page generated in 0.06173 seconds