aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes Call EJB from Application Client Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Call EJB from Application Client" Watch "Call EJB from Application Client" New topic
Author

Call EJB from Application Client

adrian salajan
Greenhorn

Joined: Apr 13, 2011
Posts: 1
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

Joined: Oct 18, 2007
Posts: 22
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



SCJP 5, SCWCD 5, SCBCD 5,
SCEA 5,
OCUP Fundamental,
OCUP Intermediate,
OCUP Advanced,
IBM Certified Solution Designer - Object Oriented Analysis and Design, vUML 2
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Call EJB from Application Client