As already pointed out,
A) if you're calling the ejb from a stand-alone client outside the jee container, then there are two things wrong with your approach:
- the ejb needs to be remote
- you cannot use resource injection ("@EJB"). you have to use jndi lookup instead.
B) If on the other hand you're using your jee server application client container to run the client you may use injection but the ejb still needs to be remote (check this link :
http://docs.sun.com/app/docs/doc/820-4336/beakv?a=view)
To access an ejb locally, the client app needs to be part of the same deployed application, whether it is a servlet, an ejb or simply a pojo.
Even inside the container, injection only works inside ejbs(3.0) and servlets (since 2.5, if I'm not mistaken), not POJOs. For the later, you do have to use jndi lookup.
You may use the "java:comp/env/<BeanName>" jndi name if you're in case B and do define a reference to the ejb in your app-client dd. This is necessary for the container to create a reference to the ejb in that jndi tree.
If you're in case A, you have to use the global jndi name to lookup your ejb, which you can get by checking your container's jndi browser.