JavaEE Lab 1 — Stateless and Stateful Beans
For this lab, we use the Glassfish JakartaEE reference implementation, provided by the Eclipse Foundation.
Check the installation of JAVA, Maven, net tools, and Eclipse
Before installing Glassfish, if not already done, check your installation of JAVA, Maven, net tools, and Eclipse in the installation page
Installation of Glassfish 6
Get glassfish 6. On a machine in B313 or 3A401, you can get it using a copy:
On your own machine, you can download it. Download glassfish-6.1.0.zip.
Add the following lines to your ~/.bashrc file.
Open a new terminal so that your environment variables get properly set allowing you to use glassfish.
Documentation on Glassfish
Verify installation and start the glassfish application server
Verify your installation with:
It should display information on the available administration command for glassfish.
If this is not the case, check that the environment configuration has been permanently added to your account. For this purpose, the configuration lines have to be added to your shell configuration file (e.g., $HOME/.bashrc for the bash shell). You also need to start a new session by opening a new terminal window or force a lecture of your configuration file with the command:
When the start up process has completed, many lines appear with the last one being as follows: "Command start-domain executed successfully."
Launching glassfish in verbose mode
Is glassfish running?
Stop the application server
Programming with Session Beans
Get the source code of the examples
Download the examples from examples-ejb.zip
Study the code of the examples
Read carefully the explanations on the different sample versions.
Once a component has been deployed, you can check it is currently available in the list of running components:
The implementation has to be done using only session beans on the server side.
Develop a complete working calculator solution following these steps:
- First write the interface and the implementation of the required EJB components.
- Then write the code of a client application.
- Test and validate the behavior of your application.
- Return your source code (in a zip archive) on Moodle as assignment 1.