This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I think I should rephrase my question.It's not really the JNDI I need help with...it's understanding how to deploy the Ejb-jar.What I have done is create a new EAR project.Then I right clicked the EAR and said->New EJB project.Then I right clicked the EAR and clicked import Ejb-jar(I didn't select the option to create a client jar)But once it's done importing the jar,there are redc crosses indicating errors next to to the ejb-jar.xml.It tells me an ejb module must contain one or more enterprise beans.My ejb-jar.xml seems to be right though(it is an example from Mastering EJB 3rd Edition anyway).I think it might be the manner in which I created the jar.Let me illustrate what I did:
As you can see I created a META-INF folder(physically,in windows) and put my ejb-jar.xml inside it.'examples' is a package that contains all the bean interfaces and the bean class.
I issued the following command jar -cf HelloWorld.jar META-INF\ejb-jar.xml.It created a jar succesfully.Viewing the jar produced the following: