2012/11/15

Devoxx2012 - Apache TomEE, JEE6 Web Profile on Tomcat - David Blevins

TomEE
  • Tomcat + Java EE
  • Java EE 6 Certified
  • young project: 1 year old (2011),
  • focus on
    • quality: testing
    • performance
    • low footprint (t1.micro linux image on amazon: 613 mb max)
    • tight integration of component's (no extra downloads etc)
TomEE exists in 3 flavors
  1. basic web profile (+ JavaMail) - certified
    • half of the JEE specs
    • missing in official web profile
      • corba, JAX-RPC
      • JAX-RS, JAX-WS
      • JMS, Connectors
  2. web profile + JAX-RS (new) - certified
  3. Plus: JAX-WS, Connectors & JMS - not certified
Integrates in Eclipse
  • dynamic web project
  • eclipse run as... run on server
  • embedded Debug adapter
Modern JEE6 demo's with TomEE
  • ejb:
    • @javax.ejb.Singleton:
    • @javax.ejb.EJB: inject
  • @javax./jws.WebService -> automatic wsdl / publishing.
  • @javax.ws.rs.... -> REST.
  • CDI:
    • bean.xml in WEB-INF
    • pojo + @javax.inject.Inject
Testing & certifcation:
  • very large TCK certification testsuite (+/- week)
  • test infrastructure on Amazon EC2 to speed up certification process
Attention points when choosing plain Tomcat instead of TomEE:
  • slower: lots of annotation scanning
  • bloated memory from duplicate classes
  • incomplete: OpenJPA, OpenWebBeans, JNDI
  • no extensive tests from JEE TCK
TomEE+Arquillian
  • arquillian
    • testing framework
    • junit based @RunWith("Arquillian")
    • create & deploy small war with selected classes to test functionality
    • distributed testing
  • adapters included
  • integrated debugging
Maven integration:
  • tomee-maven-plugin
  • configure servers
  • start/stop servers
  • deploy / undeploy
random TomEE stuff:
  • Jelastic: Cloud provider with upcomming TomEE support.
  • collects & reports multiple errors instead of stopping on the first problem
  • META-INF/resources.xml + @Resource (without spring) 
  • config:
    • tomee.xml:
      • hybrid xml+properties config for readability (cfr apache httpd config)
      • human readable durations
    • or xml alternative: properties: conf/system.properties (can be mixed)
Post a Comment