Java: InitialContext.lookup(String) - what should the value o the parametr be?
- by bguiz
To instantiate a Stateful Session Bean inside of a JSP/ servlet, I am using:
InitialContext ic = new InitialContext();
SomeStateful state = (SomeStateful) ic.lookup("java:comp/env/SomeStatefulBean");
Trial and error had me prefix the name of my EJB with java:comp/env/, so the above works (on Glassfish 2.1). However I want to know what the proper way to obtain this prefix is.
Is there a CLI tool or function somewhere in the admin panel that will allow we to examine/ alter this?
Is this platform/ application server dependant?
Is there a setting within my ear, EJB-jar or war which I can examine or alter for this?
(Forgive the beginner question)
Thanks!