Using TomEE in Eclipse is pretty simple since it uses the existing Tomcat 7 server adaptor that comes
with Eclipse.
Quick Start
An excellent instructional video with step-by-step instructions on how to install Eclipse, TomEE
and create/deploy your first project is available on YouTube here: Getting Started with Apache TomEE (Remember to select the 'Generate web.xml descriptor' checkbox during project setup. Otherwise the ejb does not get injected and you will get an error.).
Download and install both Apache TomEE and Eclipse.
Start Eclipse and from the main menu go to File - New - Dynamic Web Project
Enter a new project name
In the Target Runtime section click on the New Runtime button.
Pick Apache Tomcat v7.0 and click Next
Change the Name field to TomEE to indicate that this is a TomEE server rather than a Tomcat server.
Set the Tomcat installation directory by clicking the Browse button and selecting the folder
where you extracted TomEE
Click Finish to return to the New Project dialog
Click Finish to complete creating your new Project
When you're ready to deploy your project, right-click your project and select Run As - Run On Server
Make sure that the TomEE environment is selected in the Server runtime environment
On the Run on Server dialog, click the Always use this server when running this project checkbox
Click Finish - Eclipse will start TomEE and deploy your project
Advanced installation
In Eclipse, click on the Servers tab, right click and select New - Server.
Select Apache - Tomcat v7.0 Server and click Next
Set the Tomcat installation directory by clicking the Browse button and selecting the folder
where you extracted TomEE
Add your webapp to the server. Click Finish.
In the Servers tab, double click on your server to open up the Overview page.
Click on the Modules tab
Click Add External Web Module. In the Add Web Module dialog, for document base, browse
to <TomEE>/webapps/tomee. Set Path: to /tomee. Uncheck Auto reloading enabled. Click OK.
Return to the Overview tab for the server.
Deselect the Modules auto reload by default checkbox.
If you do not want Eclipse to take control of your TomEE installation, select Use Workspace Metadata
under Server Locations. Please review the Workspace Metadata Installation section below for additional steps
in this scenario. Otherwise, select Use Tomcat Installation
Click the Save button in Eclipse so the server configuration gets saved.
Click on your webapp project, then select Project - clean. Hit OK. This will cause
Eclipse to clean and rebuild
In the Servers tab, right click on the server and select Publish.
Start the server.
Workspace Metadata Installation
If you used Use Workspace Metadata in the Server Locations definition of the TomEE server,
you will have to add TomEE specific configuration files to your Servers project in your workspace
in case you need to change system properties or add containers / resources and have those reflected in the
server running under Eclipse.
Locate your TomEE server configuration in Workspace / Servers
Right-click the server project and select Import
Select General - File System and click Next
Browse to your <TomEE>/conf folder
Select the following files for import: logging.properties, system.properties and tomee.xml
Click Finish to import the files.
In the Servers tab, right-click the TomEE server and select Publish to publish the files to the
Eclipse metadata folder
If you need to modify system properties or change your TomEE resources, containers, etc., you now need to make
those changes in the Workspace / Servers / <Your Server> location and publish them to the server for
the changes to take effect.
JSP Hot Deployment
If jsp changes are not being hot deployed then this is because the jsp servlet is set to development=false in the web.xml file. To allow jsp hot deployment alter this value to true and restart Tomee.
It seems that WTP doesn't manage correctly Tomcat logging configuration (which needs to be done through
system properties). A quick workaround is to add these properties manually:
Any help with the documentation is greatly appreciated.
All edits are reviewed before going live, so feel free to do much more than fix typos or links. If you see a page that could benefit from an entire rewrite, we'd be thrilled to review it. Don't be surprised if we like it so much we ask you for help with other pages :)
NOTICE: unless indicated otherwise on the pages in question, all editable content available from apache.org is presumed to be licensed under the Apache License (AL) version 2.0 and hence all submissions to apache.org treated as formal Contributions under the license terms.