EJB lookup in WebLogic fails for some reason. Please can you clarify?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Gena_Lungu
Posted On:   Wednesday, December 11, 2002 12:11 AM

The InitialContext seems to be created alright. But NameNotFoundException is thrown from lookup() method. Yet the EJB is deployed under the very JNDI name that I'm looking it up under. Can somebody suggest what can be wrong? Here is what I do: public static void main(String[] args) { ... Context ctx = getInitialContext(); DemoHome dhome = (DemoHome)ctx.lookup("DemoBean"); ... } static String user = "XXX"; static String password = "XXX"; static String url = "t3://localhost:7001"; static public Context getInitialContext() throws Exception { Properties p = new Properties(); p.put(Context.INI   More>>

The InitialContext seems to be created alright. But NameNotFoundException is thrown from lookup() method. Yet the EJB is deployed under the very JNDI name that I'm looking it up under. Can somebody suggest what can be wrong?

Here is what I do:


			
public static void main(String[] args) {
...
Context ctx = getInitialContext();
DemoHome dhome = (DemoHome)ctx.lookup("DemoBean");
...
}

static String user = "XXX";
static String password = "XXX";
static String url = "t3://localhost:7001";

static public Context getInitialContext() throws Exception {
Properties p = new Properties();
p.put(Context.INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory");
p.put(Context.PROVIDER_URL, url);
p.put(Context.SECURITY_PRINCIPAL, user);
p.put(Context.SECURITY_CREDENTIALS, password);
return new InitialContext(p);
}
   <<Less

Re: EJB lookup in WebLogic fails for some reason. Please can you clarify?

Posted By:   Bozidar_Dangubic  
Posted On:   Wednesday, December 11, 2002 10:16 AM

try DemoHome dhome = (DemoHome)ctx.lookup("java:comp/env/DemoBean");
About | Sitemap | Contact