Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Call EJB from Application Client

 
adrian salajan
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to make an Java Enterprise Application containing an EJB Module and an Application Client. (school project)

Problem is: the main() method from the application client is not executed

application.xml


Also, is it ok to use @EJB to inject an EJB in Main in my application client?



I am deploying on Glasshfish 3.

server.log


 
Anand Kumar Singh
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can not use @EJB annotation outside of EJB container, it will work only inside container in deplorable classes (Like Other EJB class , Servlet if deployed in same container)

If you want to call EJB from outside container , you need to lookup EJB, Try below code

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic