Apache TomEE Documentation

repository·main·Indexed 19 days ago

https://github.com/apache/tomee

A lightweight JakartaEE and Microprofile compliant application server built on top of Apache Tomcat. This documentation covers installation, CLI usage, and configuration for Apache OpenEJB, including system properties, JDBC DataSources, ActiveMQResourceAdapter setup, and session clustering using Tomcat or Hazelcast.

Tokens
258.8K
Snippets
688
Records
954
Agent score
65%

What's inside Apache TomEE

  1. Overview of iTest Util

    main
    The itest-util module is designed to be a lightweight, self-contained utility module for integration tests. To prevent dependency bloat, it avoids pulling in external libraries. Developers are encouraged to add code here only if it is self-contained or if they need to replicate specific logic from org.apache.openejb.util without introducing new dependencies.
  2. Overview of OpenEJB 3.0 Configuration Files

    main

    When OpenEJB starts for the first time, it automatically generates several configuration files in the conf/ directory. These files manage the container system, security, and network sockets.

    Generated Files

    Main Configuration

    • conf/openejb.xml: The primary configuration file for the container system (transactions, security, data sources, etc.).

    Security and Users

    • login.config: JAAS configuration file.
    • users.properties: Defines users allowed to log in.
    • groups.properties: Defines user groups.

    Network and Service Sockets

    • admin.properties: Network socket for administration.
    • ejbd.properties: Network socket for EJB invocations.
    • hsql.properties: Network socket for HSQL client access.
    • httpejbd.properties: Network socket for EJB invocations over HTTP.
    • telnet.properties: Network socket for the telnet "server".

    If you make errors in configuration, you can delete or move a file, and OpenEJB will automatically recreate it with default values upon the next start.

  3. Overview of Apache TomEE

    main
    Apache TomEE is a lightweight, powerful JakartaEE (formerly JavaEE) and Microprofile compliant application server. It is essentially the Java Enterprise Edition version of Apache Tomcat (Tomcat + JakartaEE = TomEE). It is designed to deploy Jakarta EE, Microprofile, and Java EE compliant applications.
  4. Overview of the OpenEJB Eclipse Plugin

    main

    The OpenEJB plugin for Eclipse enables developers to manage OpenEJB environments directly within the IDE. Key capabilities include:

    • Standalone Server Management: Run an OpenEJB standalone server from within Eclipse.
    • Direct Deployment: Deploy projects to the server using Eclipse Web Tools Project (WTP) functionality.
    • EJB 3 Annotation Generation: Automatically add EJB 3 annotations to your Java code by reading ejb-jar.xml (and optionally openejb-jar.xml) descriptor files.
  5. Use the Arquillian Persistence Extension with TomEE and JakartaEE 9

    main

    The Arquillian Persistence Extension is a sample implementation demonstrating how to integrate TomEE, Arquillian, and the Arquillian Persistence Extension within a JakartaEE 9 environment.

    Important Requirement: This setup only functions when using an embedded TomEE container (tomee-embedded).

  6. OpenEJB Compatibility and Requirements

    main

    Spec Support

    • EJB Versions: Supports Enterprise JavaBeans 3.0 and previous versions 2.1, 2.0, and 1.1.
    • CMP Engine: The Container-Managed Persistence (CMP) engine is a layer over JPA, utilizing OpenJPA for persistence work. CMP mappings use standard JPA mapping files and annotations.

    Runtime Requirements

    • Java Version: Requires Java 5 or 6 (Java 1.5 or 1.6).
    • JVM Vendors: Tested on Sun, Mac, and IBM VMs, but should work on any standard JVM.
    • Build Tools: Does not require Apache Maven; it can be used as a plain library in Maven, Ant, IntelliJ, Eclipse, NetBeans, JUnit, or TestNG projects.
  7. Supported IDEs for TomEE development

    main

    TomEE development is compatible with the major Java Integrated Development Environments (IDEs). You can use any of the following to build, debug, and manage your TomEE applications:

    • Eclipse: A widely used Java IDE with an extensible plug-in system.
    • IntelliJ IDEA: Available in both Apache 2 Licensed Community and proprietary Commercial editions.
    • NetBeans: A modular Java IDE that runs on Windows, macOS, Linux, and Solaris.
  8. Navigate the OpenEJB Standalone Server directory layout

    main

    When you unpack the standalone OpenEJB distribution, the following directory structure is created. Understanding these locations is essential for managing deployments, configurations, and logs:

    • apps/: Deployment directory for EJB JAR files.
    • bin/: Contains server control scripts (start/stop/deploy/undeploy).
    • conf/: Configuration files for the server.
    • data/: Server data storage.
    • lib/: Library JAR files required for the runtime and EJB development.
    • logs/: Server log files.
    • LICENSE, NOTICE, README.txt: Documentation and legal files.
    apache-openejb-[version]
    ├── apps/
    ├── bin/
    ├── conf/
    ├── data/
    ├── lib/
    ├── logs/
    ├── LICENSE
    ├── NOTICE
    └── README.txt
  9. Understand the TomEE Directory Structure

    main

    TomEE follows a standard directory layout for managing applications, configurations, binaries, and logs. Understanding this structure is essential for deploying applications, configuring the server, and troubleshooting issues.

    Core Directories

    • apps/: An optional folder for applications (.war, .ear, .jar). Note: This folder is not active by default; you must activate it in tomee.xml to use it.
    • bin/: Contains executable and boot-related files (e.g., startup.sh/.bat, shutdown.sh/.bat, and utility scripts like tomee.sh/.bat).
    • conf/: The central configuration directory. Key files include:
      • tomee.xml: The primary TomEE configuration file (uses a hybrid XML/Properties syntax).
      • server.xml: Configures the Tomcat engine (Hosts, Contexts, etc.).
      • system.properties: Global TomEE configuration.
      • logging.properties: Server and application logging configuration.
      • tomcat-users.xml: User management.
      • web.xml: Default web application configuration.
    • lib/: Contains the Tomcat and TomEE library JAR files.
    • logs/: The default location for all log files, including container logs (catalina.$day.log), host logs, and application-specific logs.
    • webapps/: The default deployment directory for web applications. TomEE will automatically explode .war or .ear files into directories next to the original file unless configured otherwise.
    • work/: A working directory used by Tomcat and TomEE for temporary processing, such as storing compiled JSP source and binaries.
    • temp/: The redirected Java temporary directory used by the instance.
  10. Use the OpenEJB Eclipse Plugin for EJB development

    main
    The OpenEJB Eclipse Plugin provides a suite of tools within the Eclipse IDE to simplify EJB development. By leveraging Eclipse WebTools, the plugin allows OpenEJB to function as an available container/runtime directly within the Eclipse environment. This integration enables full debugging capabilities and seamless Eclipse project integration.
  11. Available TomEE Maven Plugins

    main

    TomEE provides several Maven plugins depending on your deployment and application architecture requirements:

    • Standalone TomEE plugin: Used for managing and interacting with a standalone TomEE server instance.
    • TomEE embedded plugin: Used for running TomEE embedded within your application (typically for integration testing or lightweight execution).
    • Application Composer plugin: Specifically designed for applications built using the Application Composer framework.

    Note: While an EJBContainer plugin exists, it is generally recommended to use one of the plugins above instead.