| Author |
HF - Chapter 1 Bean
|
Andree Charfen
Ranch Hand
Joined: Mar 24, 2004
Posts: 32
|
|
HI. I have the HF book. In chapter 1 there is an example called the Advice Guy. I got it compiling and everything but at runtime the JNDI cannot find the bean (when the context does the lookup). The server is running as well as the Bean. And I did set the right bean JNDI name. But it just wont do it. I dont have the excact error with me, but I do know it was that the JNDI couldnt find the Bean. What else could I be missing? Thank you for your help. [ May 12, 2005: Message edited by: Andree Charfen ]
|
yeeeehhhhaaaaaa<br />(riding the JVM)
|
 |
Andree Charfen
Ranch Hand
Joined: Mar 24, 2004
Posts: 32
|
|
hummmmm..... I was doing a little research and I found an example that does a lookup and it includes the whole path, like this: "java:comp/env/com/app/beanjndi" humm.... I thought you did have to do that. The HF book doesnt show the whole path.
|
 |
sawan parihar
Ranch Hand
Joined: Aug 24, 2004
Posts: 250
|
|
Which app server you are using. You can check the JNDI tree that the name of the bean is registered there . cheers.
|
Sawan<br />SCJP,SCWCD,SCBCD<br /> <br />Every exit is an entry somewhere.
|
 |
Andree Charfen
Ranch Hand
Joined: Mar 24, 2004
Posts: 32
|
|
Oh I would really like to chech that tree. Now for the App Server that I am using well here is what I am doing (I am new at EJB): I am using the newst J2EE server (1.4). I know that b/c I downloaded it a few days ago. I am using the deploytool to start my EJB and its JNDI name. The client I am coding it in Eclipse (I dont think that matters anyways). In the deploytool it does show that my ejb is running. But what else can I do?
|
 |
Andree Charfen
Ranch Hand
Joined: Mar 24, 2004
Posts: 32
|
|
Here is the exception: javax.naming.NoInitialContextException Here is the code line: Object o = ic.lookup("java:comp/env/Advisor"); I have tried also: Object o = ic.lookup("Advisor"); and yes Advisor is the JNDI name for the EJB Object. Any ideas :roll: OH and I start the server from the J2EE 1.4 SDK start menu where it says start default server. Is that correct? AH! [ May 13, 2005: Message edited by: Andree Charfen ]
|
 |
 |
|
|
subject: HF - Chapter 1 Bean
|
|
|