CHAPTER 2 Starting a project Installing the EJB container Go to http://jboss.com/products/ejb3, download the modular embeddable server, and unzip the downloaded archive. Copy all libraries that come with the server into your project s WORKDIR/lib directory, and copy all included configuration files to your WORKDIR/src directory. You should now have the following directory layout: WORKDIR +etc default.persistence.properties ejb3-interceptors-aop.xml embedded-jboss-beans.xml jndi.properties log4j.properties +META-INF helloworld-beans.xml persistence.xml +lib +src +hello HelloWorld.java Message.java The JBoss embeddable server relies on Hibernate for Java Persistence, so the default.persistence.properties file contains default settings for Hibernate that are needed for all deployments (such as JTA integration settings). The ejb3-interceptors- aop.xml and embedded-jboss-beans.xml configuration files contain the services configuration of the server you can look at these files, but you don t need to modify them now. By default, at the time of writing, the enabled services are JNDI, JCA, JTA, and the EJB 3.0 container exactly what you need. To migrate the Hello World application, you need a managed datasource, which is a database connection that is handled by the embeddable server. The easiest way to configure a managed datasource is to add a configuration file that deploys the datasource as a managed service. Create the file in listing 2.14 as WORKDIR/etc/META-INF/helloworld-beans.xml. Listing 2.14 Datasource configuration file for the JBoss server Visit our web design programs services for an affordable and reliable webhost to suit all your needs.