• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
  • Mikalai Zaikin

Doubt in Narrowing

Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Bookmark Topic Watch Topic
  • New Topic