sdonepudi (1) [Avatar] Offline
#1
1. Install Jboss.
2. Install Eclipse.
3. Install JBoss tools using Eclipse
4. Create new Eclipse EJB Project
i. Select New | Other | EJB | EJB Project
ii. Enter Project Name & EJB Module Version should be 3.0 and Select Finish
5. When you click finish, Eclipse will suggest you to move to Java EE Prespective. Accept it.
6. Go to File | New | Other. Select EJB3 Session Bean option from EJB Folder. New Sessio Bean wizard will appear. Choose your package "com.ejb3inaction.actionbazaar" as bean package and bean name as "your bean class".
7. Click Finish
8. Implement your bean code.
9. Deploying Application. Switch to Jboss server View. go to Window | Open | Perspective | Other. No you will see Servers window at the bottom of Eclipse. Now right click on Jboss Server label and select Add and remove projects. A wizard will appear and shows your application Move your application in to your JBoss Server. Click finish.
8. Now expand JBoss label and it shows your application as bean. Right click and select Full Publish.
9. Now Right Click JBoss 5.0 Server and choose Start. This will start your server.

Creating a Client:
1. Add your Client class to the same project and choose "com.ejb3inaction.actionbazaar.client" package.
2. Implement your client in the created class.
3. Create New folder "client-config" to your project.
4. Add New file jndi.properties in the client-config directory.
5. Add the following properties to jndi.properties file
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.provider.url=jnp://localhost:1099
java.naming.factory.url.pkgs=org.jnp.interfaces
6. Append the folder to the class path. Right click on your project and select Properties.
7. Select Java Build Path and select Libraries
8. Now select Class Folder and select newly created client-config directory and click ok.
9. Now your client knows how to reach classes or files.
10. Now right click on your client and Run As java application.