Deploying in TomEE is quite simple.
You could deploy your application just like how you would deploy with Tomcat. For an example, tomee-and-eclipse shows how to use TomEE along with Eclipse.
Or you could simply package your application as a war and "drop it in" tomee/webapps folder or as an ear and "drop it in" tomee/apps folder.
On a related note, read on to learn about packaging EJBs in a WAR.
The basic idea of this approach is that your Servlets and EJBs are together in your WAR file as one app. -No classloader boundries between Servlets and EJBs -EJBs and Servlets can share all third-party libraries (like Spring!) - no EAR required. -Can put the web.xml and ejb-jar.xml in the same archive (the WAR file). -EJBs can see Servlet classes and vice versa.
This is very different than J2EE or Java EE 5 as there aren't several levels of separation and classloader hierarchy. This is going to take some getting used to and it should be understood that this style of packaging isn't J2EE compliant. Who would care tough as it is a feature of Java EE 6 we would've been waiting for so long.
-You cannot ever have EJBs and servlets in the same classloader.
-Three classloader minimum; a classloader for the ear, one for each ejb-jar, and one for each WAR file.
-Servlets can see EJBs, but EJBs cannot see servlets.
To pull that off, J2EE has to kill you on packaging: -You cannot have EJB classes and Servlet classes in the same archive.
-You need at least three archives to combine servlets and ejbs; 1 EAR containing 1 EJB jar and 1 servlet WAR.
-Shared libraries must go in the EAR and be included in a specially formatted 'Class-Path' entry in the EAR's MANIFEST file.
Critically speaking, forcing more than one classloader on an application is where J2EE "jumps the shark" for a large majority of people's needs.
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.