Are you looking up from an EJB? if so do you have a reference in the ejb-jar for that bean to the bean you are looking up? like: <ejb-ref> <ejb-ref-name>ejb/ItemHome</ejb-ref-name> <ejb-ref-type>Entity</ejb-ref-type> <home>beans.ItemHome</home> <remote>beans.Item</remote> <ejb-link>ItemBean</ejb-link> </ejb-ref>
I have the above and get a the reference like: static private String Item_ref = "ejb/ItemHome"; Context initial = new InitialContext(); Object objref = initial.lookup("java:comp/env/"+Item_ref); ItemHome itemHome = (ItemHome)PortableRemoteObject.narrow(objref, ItemHome.class); oh btw im not quite sure about the <ejb-link> tag. It does not seem to be necesary, but is was created by a tool, so i have just let it be. cheers Jesper -----Oprindelig meddelelse----- Fra: Ken Cooper [mailto:[EMAIL PROTECTED]] Sendt: 17. april 2002 05:26 Til: Orion-Interest Cc: [EMAIL PROTECTED] Emne: JNDI Reference to home of EJB failing? Attempting to get a reference to the home of a bean. Context is setup as follows: Hashtable env = new Hashtable(); env.put(Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.rmi.RMIInitialContextFactory"); env.put(Context.SECURITY_PRINCIPAL, "admin"); env.put(Context.SECURITY_CREDENTIALS, "admin"); env.put(Context.PROVIDER_URL, "ormi://kecooper-lap:23792/Stateless1"); Context ctx = new InitialContext(env); Doing a lookup as per the following: Stateless1Home stateless1Home = (Stateless1Home)ctx.lookup("Stateless1"); All works well - no issues. Problem is converting above lookup to a lookup of the following type: Object homeObject = ctx.lookup("java:comp/env/Stateless1"); The subsequent step would be to narrow the homeObject reference. However I cannot get the reference. Using Oracles JDeveloper9i I get the following error message: javax.naming.NameNotFoundException: java:comp/env/Stateless1 not found Need some help in determining hyow to fix this problem. I have modified several xml files, in particular ejb-jar.xml and orion-ejb-jar.xml to no avail. PLEASE let me know a possible solution as soon as possible. THANKS - Ken Cooper ------------------------------------------------------ Kenneth Cooper, Jr. [EMAIL PROTECTED] ------------------------------------------------------ _________________________________________________________________ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx