on 10-16-2013 1:25 PM
Dear Experts,
we have two EAR DCs
Both DCs are deployed correctly and have functioning webservices/EJBs, which I can call without a problem. I am trying to call an EJB from CAF EAR in BL EAR.
I looked up in SDN and found following code samples:
1)
String jndiname = "test.ch/pr_test_hc_amd_0~bl~caf~ear/" +
"ch.test.pr_test_hc_amd_0.bl.caf.modeled.bonode.lockobject.lockobject.LockObject";
LockObjectBean bean = (LockObjectBean )ctx.lookup(jndiname);
2)
String jndiname = "test.ch/pr_test_hc_amd_0~bl~caf~ear/" +
"ch.test.pr_test_hc_amd_0.bl.caf.modeled.bonode.lockobject.lockobject.LockObject";
LockObjectBean bean = (LockObjectBean ) javax.rmi.PortableRemoteObject.narrow(ctx.lookup(jndiname), LockObjectBean.class);
Both cases I get an Exception:
"Object not found in lookup of ch.insel.pr_insel_hc_amd_0.bl.caf.modeled.bonode.lockobject.lockobject.LockObject."
I read somewhere that I should try a JNDI name with LOCAL so when I try:
String jndiname = "test.ch/pr_test_hc_amd_0~bl~caf~ear/" +
"LOCAL/" +
"ch.test.pr_test_hc_amd_0.bl.caf.modeled.bonode.lockobject.lockobject.LockObject";
Then lookup works fine but I get an ClassCastException:
java.lang.ClassCastException: class com.sun.proxy.$Proxy3970:test.ch/pr_test_hc_amd_0~bl~caf~ear@com.sap.engine.boot.loader.ResourceMultiParentClassLoader@2770dd66@alive incompatible with class ch.test.pr_test_hc_amd_0.bl.caf.modeled.bonode.lockobject.lockobject.LockObjectBean:test.ch/pr_test_hc_amd_0~bl~caf~ear@com.sap.engine.boot.loader.ResourceMultiParentClassLoader@2770dd66@alive
at
Now I am stuck I would be happy about any hints.
Thanks a lot,
Koray
After a little bit more trial error I could make the call using following code:
String jndiname = "test.ch/pr_test_hc_amd_0~bl~caf~ear/LOCAL/" +
"ch.test.pr_test_hc_amd_0.bl.caf.modeled.bonode.lockobject.lockobject.LockObject/" +
"ch.test.pr_test_hc_amd_0.bl.caf.modeled.bonode.lockobject.lockobject.LockObjectServiceLocal";
Object o = ctx.lookup(jndiname);
LockObjectServiceLocal bean = (LockObjectServiceLocal) PortableRemoteObject.narrow(o, LockObjectServiceLocal.class);
I hope this helps someone having the same problem...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.