Geertjan's Blog

  • October 29, 2013

TomEE Integration in NetBeans Next

Geertjan Wielenga
Product Manager

At JavaOne 2013, there was a lot of buzz around the TomEE server, e.g., many Tweets, nice party, and a new TomEE consulting company. For those tracking TomEE developments, it's interesting to note that recently the NetBeans IDE development builds have had added to them... TomEE support.

Note: The TomEE support described here is not in NetBeans IDE 7.4, but in development builds for the next release of NetBeans IDE.

For example, with NetBeans IDE development builds you're able to:

  • register TomEE as a server in the Services window (TomEE has several distributions, e.g., one can use the "with JAX-RS" one, for example)
  • create a Java EE 6 web project (e.g., Maven based) against this server
  • create JPA entities from database
  • create JAX-RS classes from JPA entities
  • create JSF pages from JPA entities
  • the IDE lets you create a new data source for TomEE and deploy it to the server
  • the IDE figures out the components that are already packaged in TomEE, and the fact that (unlike with regular Tomcat), it does not need to package any components such as JSF implementation, persistence provider, or JAX-RS runtime, so that the resulting WAR file is very small
  • the IDE can also do "deploy on save" with TomEE, so that your development cycle is very fast

Adam Bien blogged about how he set up TomEE sometime ago, here. The official support in NetBeans IDE will be much more tightly integrated, simplifying the steps Adam describes. For example, the IDE does step 2 from Adam's blog for you, i.e., it sets up TomEE deployment roles. Moreover, it knows about all the technologies included in TomEE so that it can optimize the packaging; it knows about TomEE's persistence setup; it can work with TomEE data sources, etc.

Below you see a Maven-based Java EE 6 PrimeFaces application (all entities and JSF pages generated from a database) deployed to TomEE in NetBeans IDE:

And here's the management console for configuring and finetuning TomEE in NetBeans IDE:

When I tried out the NetBeans IDE development build and TomEE, to see how everything fits together, I was surprised at how fast TomEE started up. Not sure what they did to it, but seems like a server on steroids. And setting it up in NetBeans IDE was trivial. Add the simple set up of TomEE in NetBeans IDE to the many benefits that the widely praised out of the box NetBeans Maven tools make possible, together with the fact that not one single plugin had to be installed to get everything you see described here up and running... and you have a really powerful combination of dev tools, all for free.

Join the discussion

Comments ( 4 )
  • Mircea Tuesday, October 29, 2013

    Thanks for this tutorial. TomEE is indeed great and really fast.

    I've been using it for almost one year. TomEE + NetBeans rock!

    One thing missing from NetBeans and TomEE is that NetBeans doesn't recognize it as a full Java EE 6 app server. It can be set just as Web Profile, which is annoying, because TomEE offers the full Java EE 6 implementation as well.

  • Geertjan Tuesday, October 29, 2013

    You're saying that you've downloaded the NetBeans IDE development build and you've used the TomEE support in the NetBeans IDE development build? It doesn't sound like it.

  • guest Saturday, November 23, 2013

    Wow, Geertjan. I don't know how one of your blogs got by me but I just found this post. I have to say I'm THRILLED to have found this good bit of information!!!!!! What little I've worked with TomEE it is impressive... Thanks.

  • Carl J. Mosca Friday, December 13, 2013

    Very nice Geertjan. I was able to use the wizard to create some RESTful services from a database like others.

    I am curious about the datasource. I noticed resources.xml in WEB-INF.

    When an app is created using the wizard with Glassfish the datasource is created in the app server config.


Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.