First, let's create a new J2EE5 project.
Select the NEW icon and choose Project. The New Project Wizard appears and you should select Enterprise Application Project.
Call the project libraryEAR, select Java EE 5.0 for the J2EE Specification Level and opt to have the wizard create new web and ejb module projects. Edit the defaulted names for our modules so we have libraryWeb with a context root URL of /library. Also, name the Enterprise Java Beans module, libraryEJB.
The wizard then offers to define JPA Persistence which will generate a file called persistence.xml that our EJBs will use to communicate with the datasource. Select devDB as the name and java:devDS as the JNDI Data Source and uncheck the Specify JPA Datasource details check box as we are not going to use this functionality in this tutorial.
|