Debuging OpenEJB’s TomEE with Eclipse WTP
This is just a short description on how to use OpenEJB with Tomcat to debug it within Eclipse.
The point is to be able to debug EJB applications from within Eclipse with a lightweight Tomcat container using OpenEJB.
What do you need:
- Apache TomEE - OpenEJB pre-bundled with Tomcat: http://openejb.apache.org/download.html
- Eclipse IDE for Java EE Developers or equivalent: http://eclipse.org/downloads/
Versions I used: Apache TomEE: tomee-6.0.29.314, Eclipse Helios SR1 (actually SpringSource Tool Suite 2.5.1).
There is no need for OpenEJB Ecilpse plugin, or anything else beyond the things from above.
The process…
Extract TomEE to some location, lets call this $TOMEE_HOME:
cd $TOMEE_HOME
tar xzf tomee-6.0.29.314.tar.gz
Create new Server Runtime:
Point the Tomcat installation directory to $TOMEE_HOME.
Create a new Apache Tomcat 6 (Server View -> New -> Server) based on the Runtime just created:
Just hit Finish.
You should see the new server in a Server View:
Double click it, to open the configuration editor:
Click on the Open launch configuration, to edit the JVM startup arguments, and select the Arguments tab:
Under VM arguments insert:
-javaagent: $TOMEE_HOME/lib/openejb-javaagent.jar
Where you shoud replace TOMEE_HOME with Tomee instalation form above. In my case it would be:
-javaagent:/opt/tomcat/tomee-6.0.29.314/lib/openejb-javaagent.jar
Java agent will enhance our EJB beans…
Now we need the openejb webapp front-end. So lets add that to our server instance. Open the Modules tab from the server configuration:

Select the openejb folder from $TOMEE_HOME/webapps:
Set path to /openejb
Now we should have something like this:
From this point on you can install (deploy) your very own (WAR) project and start to debug.
The OpenEJB console is accessible at: http://localhost:8080/openejb
№te: In case you just need to play with EJBs, take the OpenEJB eclipse plugin.
That’s it.