Ejb3EclipseProjectSetupAndConfiguration

Create the Project

 * 1) Pull down the **File** menu and select **new:project**
 * 2) Select **Java Project**
 * 3) Click **Next**
 * 4) Enter ** **
 * 5) Under Project Layout select **create separate source and output folders**
 * 6) Click **Finish**
 * 7) Select ** **, right-click and select **new:Source Folder**
 * 8) Enter **conf** for the name
 * 9) Click on **Finish**
 * 10) Select ** **, right-click and select **new:Source Folder**
 * 11) Enter **test** for the name
 * 12) Click on **Finish**

Edit your project properties
Now that we have created a user library, we can add that user library to our project:
 * 1) Select ** **, and press alt-enter or right-click and select properties.
 * 2) Select **Java Build Path**
 * 3) Select the **Libraries** tab
 * 4) Click on **Add Library**
 * 5) Select **User Library** and click **Next**
 * 6) Click on the box next to **EJB3_EMBEDDABLE** and click **Finish**
 * 7) Click **Add Library**
 * 8) Select **JUnit** and click **Next**
 * 9) In the pull-down list, select **JUnit 4** and click **Finish**
 * 10) Click on **OK** to make the change to your project's classpath

Setup the configuration files
The JBoss Embeddable container looks for several files in the classpath. To keep all of these in one place, we'll add another source directory to our project and then import several files into that directory.
 * 1) Select the **conf** folder under ** **
 * 2) Pull down the **File** menu and select **Import**
 * 3) Expand **General**
 * 4) Select **File System** and click on **Next**
 * 5) Click on **Browse** and go to the following directory: **C:/libs/jboss-EJB-3.0_Embeddable_ALPHA_9/conf**
 * 6) Click on **OK**
 * 7) You'll see **conf** in the left pane, select it
 * 8) Verify that the **Into folder:** lists ** /conf** (if not, just enter it or browse to it)
 * 9) Click **Finish**
 * 10) Expand the **conf** directory and verify that the files are now there

Add Resource Adapter Archive(RAR)
The Java Connector system defines Resource Adapter Archive files (RAR files). We need to add a few RAR files into the class path. We will import two more files into the **conf** directory:
 * 1) Select the **conf** folder
 * 2) Pull down the **File** menu and select **Import**
 * 3) Expand **General**
 * 4) Select **File System** and click on **Next**
 * 5) Click on **Browse** and go to the following directory: **C:/libs/jboss-EJB-3.0_Embeddable_ALPHA_9/lib**
 * 6) Select **jcainflow.rar** and **jms-ra.rar**
 * 7) Click **Finish**

Create a jndi.properties file
Note, depending on the version of the embeddable container you download, you might already have a file called **jndi.properties**. If you do, skip to the next section. code format="xml" java.naming.factory.initial=org.jnp.interfaces.LocalOnlyContextFactory java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces code
 * 1) Select the **conf** directory, right-click and select **new** then select **File**
 * 2) Enter the name **jndi.properties** and click **finish**
 * 3) Enter the following 2 lines then save and close the file:

Create a persistence.xml
This example presents a utility class we'll be using later. The container needs a **persistence.xml** file to operate. This file must be found under a META-INF directory somewhere in the classpath or the embeddable container will not start. The file's name is **persistence.xml** with a lower-case 'p'. On a Unix system, this will make a difference. On a PC, this won't make a difference and it is one of those things that might work on your machine but not on the linux build box.


 * 1) Select your **src** directory
 * 2) Right-click, select **New:Folder**
 * 3) Enter **META-INF**
 * 4) Click **OK**
 * 5) Select **META-INF**
 * 6) Right-lick, select **New:File**
 * 7) Enter **persistence.xml**
 * 8) Click **Finish**
 * 9) Copy the following example into your new file then save it by pressing ctrl-s

code format="xml"   java:/DefaultDS   code
 * persistence.xml**