This tutorial describes how
to use the EJB 3.0 specification to
create, deploy and run a simple EJB 3.0 application that increments
a counter.
This
tutorial might require some optionally installable components.
If you encounter errors or cannot find user interface options when
you run
the sample, ensure that you installed the appropriate optional components:
- IBM® WebSphere® Application
Server, version 7.0 installed
To use this sample, you must
have an application server installed and
configured. To verify that a server runtime environment is available,
click
Window > Preferences, expand Server, and then click Installed Runtimes.
You
can use this pane to add, remove, or edit installed server runtime
definitions.
You can also download and install support for a new server.
This
tutorial
is divided into several exercises that must be completed in sequence
for the
tutorial to work properly. This tutorial teaches you how to use the
EJB 3.0
specification to create an EJB project that includes an EJB bean,
remote and
local interfaces, as well as a Servlet and a Faces JSP to deploy the
application
on the server. While completing the exercises, you will:
- Use
the EJB 3.0 specification to create, deploy and run a simple EJB 3.0
application that increments a counter.
- Create a Java™ project, EJBCounterSample with
an EJB 3.0 stateless session bean (with both interface and implementation
classes), StatelessCounterBean.java, and a JPA 1.0
entity
class JPACounterEntity.java.
- Create Web project
(EJBCounterWeb), and with a Java ServerPages
(JSP) page and a utility Java class
- Create EAR application, EJBCounterSampleEAR,
containing
the EJB and Web projects.
Time required
This tutorial should take
approximately
30 minutes to finish. If you explore other concepts related to this
tutorial,
it could take longer to complete.
Skill
level
Experienced
Audience
This
tutorial is intended for users who
are familiar with Enterprise JavaBeans™,
EJB 3.0 in particular, and Java EE
5 technology.
System requirements
To
complete this tutorial,
you need to have the following tools and components installed:
- The WebSphere Application
Server v. 7.0 installed.
- A clean workspace.
Prerequisites
In order to complete this
tutorial
end to end, you should be familiar with:
- Java EE
5 and Java programming
- Basic Enterprise JavaBeans (EJB) and EJB 3.0 concepts