Creating EJB project

In this recipe, we will see how to create an EJB project using the wizards provided by NetBeans.

Getting ready

It is required to have NetBeans with Java EE support installed to continue with this recipe.

If this particular NetBeans version is not available in your machine, then you can download it from http://download.netbeans.org.

There are two application servers in this installation package, Apache Tomcat or GlassFish, and either one can be chosen, but at least one is necessary.

In this recipe, we will use the GlassFish version that comes together with NetBeans 7.0 installation package.

How to do it...

  1. Lets create a new project by either clicking File and then New Project, or by pressing Ctrl+Shift+N.
  2. In the New Project window, in the categories side, choose Java Web and in Projects side, select WebApplication, then click Next.
  3. In Name and Location, under Project Name, enter EJBApplication.
  4. Tick the Use Dedicated Folder for Storing Libraries option box.
  5. Now either type the folder path or select one by clicking on browse.
  6. After choosing the folder, we can proceed by clicking Next.
  7. In Server and Settings, under Server, choose GlassFish Server 3.1.
  8. Tick Enable Contexts and Dependency Injection.
  9. Leave the other values with their default values and click Finish.

The new project structure is created.

How it works...

NetBeans creates a complete file structure for our project.

It automatically configures the compiler and test libraries and creates the GlassFish deployment descriptor.

The deployment descriptor filename specific for the GlassFish web server is glassfish-web.xml.

How it works...
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.220.108.111