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.
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.