This sample demonstrates injection of an EJB into a servlet. The application consists of a servlet and stateless session bean. The servlet uses annotations to inject the stateless session bean, and then performs a call on the hello method of the bean.
This sample can be installed onto runtime versions 22.214.171.124 and later.
Online installation (requires 126.96.36.199 or later):
installUtility install EJBSample
Any missing features required by the server will be installed for you.
EJBSample.jarusing the download button at the top of the page and place it in the root of your server installation.
java -jar EJBSample.jar
Any missing features required by the server will need to be installed separately.
To run the EJBSample application:
bindirectory in the Liberty profile installation:
server run EJBSample
CWWKZ0001I: Application EJBSample started in XX.XX seconds.