...
To run this tutorial, as a minimum you will be required to have installed the following prerequisite software.
- Sun JDK 65.0+ (J2SE 1.6)
- Eclipse IDE for Java EE Developers, which is platform specific
- Apache Geronimo Eclipse Plugin 2.1.x
- 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:
...
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 | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
package sampleear; import javax.ejb.Remote; @Remote public interface RemoteBusinessInterface { public String sayHello(String name); } |
...
- 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.
- Click Finish.
- 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.
- 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/SampleWAR.
- Type in any name you want, e.g.
John Doe
and press Press me! button.