EJB Deployment   «Prev  Next»

Lesson 1

Deploying EJBs

The first lessons in this module describe the initial steps in deploying an EJB in a container.
In these lessons you will create the XML deployment descriptor that describes the bean. Then you will package it in a jar file together with the interfaces and classes for the bean.

Deploying the beans

Once the beans are packaged, you will deploy them on the EJB platform. This process involves building the stubs, skeletons, and the Home and Remote objects, followed by the loading of the bean.

What are the steps to deploy an Enterprise JavaBeans 3.0 on Tomcat 10

  1. Ensure that Tomcat 10 is installed and configured properly.
  2. Create an EJB 3.0 compliant JAR file containing your enterprise beans and any required dependencies.
  3. Copy the JAR file to the Tomcat's "lib" directory.
  4. Add the following line to the Tomcat's "conf/catalina.properties" file: "org.apache.catalina.startup.ContextConfig.jarsToSkip=*.jar"
  5. Start or restart Tomcat and deploy your application as you normally would.
  6. Access your enterprise beans through JNDI or by injecting them into a web application or servlet.

Please note that this is a high level overview and there might be additional steps that needs to be done depending on the specific use case.

Working hands-on

During the exercises in this module you will download, install, and configure the J2EE reference implementation. Once that is complete, you will then deploy the Hello bean and execute the HelloClient program. The final lesson includes the first project exercise--you will write a Customer client that accesses a BankAccount bean that you deploy.
In the next lesson, you will review the principles of deployment and be introduced to the J2EE Reference Implementation.
Deployment descriptor: Information that describes both the structure of an Enterprise Java Bean, and the information required by it at runtime.

Jar file: A file created with the Java jar program which is similar to tar on the Unix platform.