Thanks for replying, David Basically what I want to do is to learn how Application Client and EJB communicate with each other (and Web after that), and how to package them into an EAR (so when I run the EAR, the App Client will run and call EJB functions). So yes, this is just a demo.
I coded an App Client and an EJB. The App Client should be able to talk with the EJB. I have created 2 projects in Eclipse, one is HRManager-Client (via Application Client project wizard), one is HRManager-EJB (via EJB project wizard). I can deploy and publish the EJB module into the Geronimo server. However, I am not able to do so with the Client as there is an error (in two cases, as a separate module and as a module inside an EAR together with the EJB). Therefore, I found a way to run it by "Run as Java Application" in Eclipse. In this case, the Client can retrieve the EJB by setting up the InitialContext and call lookup(), but not so with @EJB. What I am confused right now is: 1. Does running the Client by right-click->run as java app put the client into the app client server, because for @EJB injection to succeed, the client must be managed by a client server. If it does not, then there is no way to use @EJB in this case. 2. Please help me with the error when deploying the Client module into Geronimo. After that, I can try creating an EAR on the server and run the whole thing, in that case there is the possibility the @EJB will take effect, as the Client will be deployed in the server. 3. I really doubt about the validity of the .xml files in my project, can you please take a look at it. Do I have to add something so that @EJB can work? I attach to source code of the 2 projects here for reference. Thank you for your help. http://apache-geronimo.328035.n3.nabble.com/file/n3985266/sample.zip sample.zip -- View this message in context: http://apache-geronimo.328035.n3.nabble.com/Using-EJB-annotation-instead-of-looking-up-for-EJB-tp3985253p3985266.html Sent from the Users mailing list archive at Nabble.com.