wood burning stoves 2.0*
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 Android Security Essentials Live Lessons this week in the Android 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
 
Similar Threads
GlassFish wouldn't start on Red Hat Linux server
cant load the admin console in glassfish v3
The module has not been deployed. BUILD FAILED error problem
GlassFish v3 and localhost in Windows7
a blank glassFish admin console @ netbeans 6.8