It's fine to be posting here in the EJB forum! I am new student of EJB3 Technology. And have previously worked with EJB2 only; I understand the development for version 3 is simplified; And I have been trying to create a Simple client for an EJB3, but the problem is that in every example, the client is deployed as part of the same Enterprise Application. I want to know how Could I invoke a simple EJB3 (One Stateless with 1 method that outputs Hello for example) from a simple Java Class with a main method. But, to reiterate a class that belongs to an entirely different project; A stand-alone Java SE project.
I need to know the necessary steps to make a call to an EJB3 from a code like the preceding Snippet I just posted. In version 2 it was required to have the client Stubs Generated by the Server; Do I need Stubs here also? Please let me know what is the code to make the call also. (I'm assuming I still have to use a JNDI lookup)
I have similar problem. I am working with chapter 2 example code of "EJB3 in Action".
I am using eclipse IDE 3.4 and JBoss 4.2.2 server.
I could successfully do the ANT build. But I have no clue how to run the clients. There are aparently two clients built chapter2-sfsb-client.jar and chapter2-slsb-client.jar. My questions are
1. How do I configure Eclipse run environment to run any of these two clients?
2. How do I run any of them from command line?
3. I tried to run them using appclient from Sun App Server 8.1 I . The appclient complains that there is no application-client.xml in client META-INF folders. This is true. I noticed that ant build script is attempting to copy application-client.xml from /etc folder to META-INF. But the file is missing in /etc folder. ( I downloaded JBOSS version of the examples.)
I also have similar problem. From the code examples that Manning site, I notice that one important thing to invoke an EJB session bean completely from stand-alone client (not from app-client) is by using JNDI.
The JNDI name used for EJB's are currently specific to the container. You'll have to look at the container's documentation to know what the JNDI name would be. JNDI names are being standardized in EJB 3.1/Java EE 6. You do not need to know the JNDI name of the EJB for most real-world use cases.
As to IDE support for our example code, we currently do not have the bandwidth to do it. Most IDE documentation does tell you how to setup and run a EJB 3/Java EE 5 project. Once you look through the code examples and have read the book, it should not be all that difficult to do (in fact, a few people have done exactly this already).
If you have specific questions on our code examples, I'll be happy to answer them.
subject: How to invoke an EJB3 from a simple client