Problem binding remote objects in JBoss JNDI

O

Ofer Belinsky

The big picture:
I have 2 WARs deployed on the same J2EE server, each with a single servlet.
I want them to communicate with each other, by storing a remote object in
the JNDI tree in one app, getting it from the other app and using the remote
interface.

So I have:
- IProxy (extends remote) in both WARs
- CProxy (extends UnicastRemoteObject implements IProxy) in the "server" WAR

On the "server" Servlet I say:
IProxy proxy = new CProxy();
InitialContext ctx = new InitialContext();
ctx.rebind("proxy", proxy);

And on the "client" Servlet I say:
InitialContext ctx = new InitialContext();
Object obj = ctx.lookup("proxy");
boolean b = obj instanceof IProxy;

This works well enough on Weblogic, but fails on JBoss (b == false)
Note that if I print the interfaces that "obj" implements (using
getClass().getInterfaces()) I see that it DOES implement "IProxy" but
somehow it is as if it's not the same one (?!?!)

Any help would be appreciated !
Ofer.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,817
Latest member
DicWeils

Latest Threads

Top