Hello everyone,
I am trying to learn EJB 3 and I am struggeling with very first "Hello world" program.
I have many (dumb) doubts regarding EJB concept itself which I hope some of you might be able to clear.
I am tyring to run one simple EJB program but I guess I am missing something.
I have one @remote interface :
One bean class which implements this interface :
[color=darkblue]
[/color]
I have application.xml file which looks something like this :
I am using JBoss 5 server and eclipse galilelo IDE for this.
I used wizard to create project (project name is ConverterBean) and eclipse has created 5 kind of projects for me.
A) ConverterBean -->> this project contains application.xml
b) ConverterBeanClient -->>
c) ConverterBeanEJB -->> my remote interface and implementer class
d) ConverterBeanWeb -->>
e) ConverterBeanConnector -->>
Can anyone please tell me why all this projects are getting created???
After implementing interface, I have successfully deployed the bean. (I can see the message printed on console).
Now, I have created client in "ConverterBeanCLient" .
Its main class is as follows :
I have added "ConverterBeanEJB" as dependeny in this "ConverterBeanCLient" project.
Now when I try to run the client, I get following error :
I googled for above error, and I found out that somewhere I have to keep "jndi.properties" file. I do not know where to keep this file and what is the purpose of this file.
I looked into many tutorials and none of the tutorial has mentioned this file nor what is the purpose of this file.
Even JEE 5 tutorial from sun also does not mention this file.
I have more questions :
1) Can anyone please tell me how to run client program?
2) Why jndi.properties file is needed? And why most of the tutorials do not mention this file?
3) What should be the file structure for EJB and its clients?
4) If we are importing the beans interface, then what is the need for EJB? We can import bean itself. (Sorry about my lack knowledge, but none of the book answered my this question.)
5) Does anyone knows some tutorial which gives step by step procedure for deploying EJB's and clients?
I will upload my more dumb questions in next post
Many thanks