Apache TomEE is a JavaEE 6 application server.
This RefCard tries to sum up basic things to know.
| TomEE Philosophy |
|---|
Apache TomEE, pronounced "Tommy", is an all-Apache Java EE 6 Web Profile certified stack where Tomcat is top dog. Apache TomEE is assembled from a vanilla Apache Tomcat zip file. We start with Tomcat, add our jars and zip up the rest. The result is Tomcat with added EE features - TomEE. Its core values are:
|
| TomEE Links |
|---|
|
| TomEE ClassLoading |
|---|
Classloading configuration (properties):
|
| TomEE Basic Operation | |
|---|---|
Start and wait Ctrl+C |
|
Start and forget |
|
Stop |
|
Deploy manually a webapp |
|
Redeploy manually a webapp |
|
| TomEE Distributions |
|---|
|
| TomEE Directory Layout | |
|---|---|
|
contains script to manage (start/stop/…) TomEE |
|
server global configuration |
|
override JVM API because too old for JavaEE |
|
server libraries |
|
logs directory (using default configuration) |
|
default tmp directory |
|
default folder which aims to contain webapps |
|
folder used by Tomcat to store "work" binaries (compiled jsp…) |
| Scanning/Loader configuration, conf/catalina.properties |
|---|
|
| TomEE system properties, conf/system.properties |
|---|
|
| Logging configuration, conf/logging.properties |
|---|
|
| Daemons configuration, conf/conf.d/*.properties |
|---|
OpenEJB and TomEE rely on daemons for extensibility. Typically JAXWS and JAXRS uses this feature to be added to the server. Each daemon can get configuration. It is configurable through:
All daemons have a property |
| Server configuration, conf/server.xml |
|---|
|
| JAXWS WS Security configuration |
|---|
It basically relies on openejb-jar.xml (in META-INF or WEB-INF): A complete example can be found within TomEE examples:
|
| Scanning configuration |
|---|
Scanning is used to find EE classes (EJB, CDI beans…). It is common to not scan utility libraries like commons-lang for instance. TomEE/OpenEJB support two main configurations regarding the scanning:
|
| TomEE application configuration, WEB-INF/resources.xml |
|---|
|
| JAXRS configuration | ||
|---|---|---|
It basically relies on openejb-jar.xml (in META-INF or WEB-INF):
Values are either a class which will be instantiated (through
Here is the full list of available properties configurable in
|
| TomEE main configuration, conf/tomee.xml |
|---|
|
| Activating JAAS | ||
|---|---|---|
Basic JAAS configuration needs:
Here is a sample JAAS config file using PropertiesLoginModule:
This login module needs 2 properties files, one for group and one for users. Here is a
Here is a
To integrate JAAS with Tomcat just add/replace the default tomcat realm with:
|
| OpenEJB dependencies |
|---|
|
| TomEE dependencies |
|---|
|
| TomEE Embedded dependencies |
|---|
|
| TomEE maven plugin configuration | ||
|---|---|---|
|
| TomEE maven plugin information | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Compatibility matrix:
Main goals:
|
| OpenEJB embedded adapter configuration |
|---|
|
| TomEE Arquillian Adapters |
|---|
TomEE arquillian adapters support the system property This way you can run your test against several OpenEJB/TomEE adapters in the same build (no need of any maven profile). A complete sample can be found here: http://svn.apache.org/repos/asf/tomee/tomee/trunk/examples/multiple-arquillian-adapters/). |
| Simple Arquillian test |
|---|
|
| TomEE embedded adapter configuration |
|---|
|
| TomEE remote adapter configuration |
|---|
|
| Multiple TomEE with Arquillian |
|---|
Then in java just declare "as usual" multiple deployments and match them in your test methods:
|