• Post Reply Bookmark Topic Watch Topic
  • New Topic

Doubt in Narrowing  RSS feed

Sri Ram
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all

Im doing a look up for my home interface of the bean in my service locator in the following manner

InitialContext ic = new InitialContext(ht);
Object o = ic.lookUp("mybean");
MYHome home = (MYHome)PortableRemoteObject.narrow(obj,obj.getClass());//instead of using the class name of MYHome im using the getClass method

The problem is this code is working for me fine when im running it on weblogic server sp4 but the same gives an ClassCastException: Cannot narrow remote object to java.lang.class when run on weblogic sp3

im sure that the problem is not with the version

is it a wrong idea to use obj.getClass() to get the class object of the Homeobject instead of using MYHome.class

pls guide me, im really in a soup
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!