Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to deploy and run EJB 3 and its client??

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
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
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Please do not post the same question in multiple forums. Let's continue this discussion in your other thread here https://coderanch.com/t/464252/JBoss/deploy-run-EJB-Both
    Bookmark Topic Watch Topic
  • New Topic