Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

To run this tutorial, as a minimum you will be required to have installed the following prerequisite software.

  1. Sun JDK 65.0+ (J2SE 1.6)
  2. Eclipse IDE for Java EE Developers, which is platform specific
  3. Apache Geronimo Eclipse Plugin 2.1.x
  4. Apache Geronimo Server 2.1.x
    Note

    Geronimo version 2.1.x, Java 1.5 runtime, and Eclipse Ganymede are used in this tutorial but other versions can be used instead (e.g., Geronimo version 2.2, Java 1.6, Eclipse EuropaGalileo)

Details on installing eclipse are provided in the Development environment section. This tutorial is organized in the following sections:

...

You should now have the following project structure.
Image Removed
Image Added

Note
titleError message

Don't worry about the error cvc-complex-type.2.4.b: The content of element 'application' is not complete... for now. We'll fix it in the next step when you define an ejb module (and webapp module afterwards).

...

You should now have the following project structure.
Image Removed
Image Added

Note
titleImportant

Remove ejbModule/META-INF/openejb-jar.xml file in the SampleEJB project as it causes deployment issues. See the file highlighted in the image above.

...

You should now have the following project structure.
Image Removed
Image Added

Create Stateless Session EJB

Every stateless session EJB has its own business interface. There are three types of business interfaces - @Remote, @Local and @WebService - and combinations of these three. EJB development starts from defining a business interface and implementing it in a bean implementation class. We do this in the next steps.

...

Now we need to add a business method and mark the interface as a remote one with @Remote annotation.

Code Block
java
java
borderStylesolid
titleRemoteBusinessInterface.java
package sampleear;

import javax.ejb.Remote;

@Remote
public interface RemoteBusinessInterface {
    public String sayHello(String name);
}

...

  1. Right click on the SampleEAR project and select Run As -> Run on Server. When Run On _Server popup window comes up, select the Always use this server when running this project checkbox. Leave the rest as is.



  2. Click Finish.
  3. The server's stopped so nothing happens (from a user's perspective at least). Open up the Servers tab and right click on Apache Geronimo v2.1 Server at localhost and select Start.

  4. After a few seconds, Geronimo will be up and running with the enterprise application published. Open up the browser of your choice and go to http://localhost:8080/SampleWARImage Removed.



  5. Type in any name you want, e.g. John Doe and press Press me! button.