SlideShare a Scribd company logo
Jonathan Gallimore @jongallimore #TomEE


        Apache TomEE //
        JavaEE Web Profile on
        Tomcat
Monday, 31 October 11
What is Apache TomEE

          •   Tomcat + Java EE = TomEE
          •   Complete Tomcat with nothing taken away
          •   Java EE 6 Web profile certified stack
          •   All Apache components
               • MyFaces
               • OpenEJB
               • OpenWebBeans
               • OpenJPA


                                                        2

Monday, 31 October 11
Philosophy

          • Be small, be certified, be Tomcat
          • Integrate OpenEJB into Tomcat, not the other way
            around
          • Get more, don’t give up anything
          • Leverage existing Tomcat features (JNDI, Security)
          • Lightweight
              • just 24MB
              • no extra memory requirement
          • No need to learn new server environment
          • Use existing IDE tools
                                                          3

Monday, 31 October 11
Flavours of TomEE

          • Apache TomEE Web Profile (Java EE 6 certified)
             • OpenEJB
             • OpenWebBeans
             • OpenJPA
             • Bean validation
             • MyFaces
          • Apache TomEE Plus (not Java EE 6 certified)
             • CXF
             • ActiveMQ
             • Geronimo connector
          • Embedded Apache TomEE
                                                             4

Monday, 31 October 11
Stats

          • Size: the entire Web Profile is only 24Mb
          • Memory usage: very little required, passed the TCK
            without changing any default JVM memory settings
          • Agility: the server can go through a start/deploy/test/
            undeploy/stop cycle in 2-3 seconds, when run in
            embedded mode




                                                             5

Monday, 31 October 11
Certification

          •   Certified on Amazon EC2
          •   t1.micro linux images, lot’s of them
          •   100 spot instances going at once (sometimes more)!
          •   Each has 613MB memory max
          •   Use default JVM memory settings
          •   Current certified OSs
                • Amazon Linux AMI 2011.09, EBS boot, 32-bit EC2 t1.micro
                • Amazon Linux AMI 2011.09, EBS boot, 32-bit EC2 m1.small
                • Amazon Linux AMI 2011.09, EBS boot, 32-bit EC2 c1.medium



                                                                       6

Monday, 31 October 11
Getting started

          •   Unzip
          •   Start with usual Catalina scripts or services
          •   Deploy application .war or .ear in webapps
          •   Console application at http://localhost:8080/openejb

          • Or deploy openejb.war in any standard Tomcat 7
            installation




                                                             7

Monday, 31 October 11
Demo

          • Moviefun sample - demonstrates:
             • Servlets
             • CDI
             • JSF
             • EJBs
             • JPA
          • Available in OpenEJB source code repository
          • Over 50 different examples available for various Java
            EE features

                                                           8

Monday, 31 October 11
Why not just use Tomcat?

          • Plain Tomcat doesn’t have support for:
             • Transactions
             • Transaction aware connection pooling
             • @Resource
             • @PersistenceUnit
             • @Inject
             • @EJB
             • Global JNDI (java:module, java:app, java:global)
          • Are you adding libraries to provide EE features (e.g.
            persistence or CDI)?
                                                            9

Monday, 31 October 11
Configuration

          • Resources configured in conf/openejb.xml
          • Simple XML + properties format
          • Tags match Annotation names
                • <Resource id="moviesDatabase" type="DataSource">
          • Can be injected using this code
                • @Resource DataSource moviesDatabase




                                                            10

Monday, 31 October 11
Transactions

          • Connection pooling is Transaction aware
          • Everyone in same transaction, shares same
            connection
          • Servlets, ManagedBeans, etc. can start transactions
          • @Resource UserTransaction transaction;
          • No need for EJBs to use transactions




                                                         11

Monday, 31 October 11
Persistence

          • All persistence.xml files found and deployed
          • Connection persistence.xml values filled in
            automatically
          • Servlets, ManagedBeans, Session Beans, etc now use
             • @PersistenceUnit EntityManagerFactory emf;
             • @PersistenceContext EntityManager em;
          • OpenJPA included, easy to remove
          • Hibernate used in many Apache TomEE installs



                                                      12

Monday, 31 October 11
EJBs

          • EJBs can be added directly to webapp
          • Servlets, Managed beans can use @EJB
          • EJB 3.1 provides no-interface view
          • HTTP can be used for EJB remote communication
            (http://localhost:8080/openejb/ejb)
          • User/Pass supplied with InitialContext params
          • HTTP or HTTPS




                                                     13

Monday, 31 October 11
What next?

          • How small can we get?
             • Below 20MB download?
             • 6000 classes loaded, can we get to 2000?
          • Optimisations
          • Certify more parts
             • Connector
             • JAX-WS
             • JAX-RS


                                                          14

Monday, 31 October 11
Testing - Embedded TomEE

          • Very straightforward to use, very little config needed
          • Maven users can add tomee-embedded dependency,
            or add all-in-one jar to classpath
          • Could be used with frameworks like HtmlUnit or
            Selenium to test your application

              Properties p = new Properties();
              p.setProperty(EJBContainer.APP_NAME, "moviefun");
              p.setProperty(EJBContainer.PROVIDER, "tomee-embedded"); // need web feature
              p.setProperty(EJBContainer.MODULES, webApp.getAbsolutePath());
              p.setProperty(EmbeddedTomEEContainer.TOMEE_EJBCONTAINER_HTTP_PORT, "9999");
              container = EJBContainer.createEJBContainer(p);




                                                                                            15

Monday, 31 October 11
Arquillian tests

          • Test harness from JBoss (http://www.jboss.org/
            arquillian)
          • Allows you to run your test in any supported container
          • Adapters available for a number of servers
          • Skip the build
          • Run tests straight from the IDE




                                                           16

Monday, 31 October 11
TomEE Arquillian Adapters

          • Embedded
             • Boots TomEE embedded directly in the test
          • Remote
             • Can connect to a running instance of TomEE
             • OR download and start TomEE bundle
             • OR any version of Tomcat/OpenEJB
             • Configured in arquillian.xml




                                                        17

Monday, 31 October 11
Anatomy of an Arquillian Test

          • Deployment
             • Build an archive using the ShrinkWrap API
             • Choose parts of your application to test
             • Build archive with test settings

          • Test logic
             • Exercise your application
             • HtmlUnit
             • Selenium

                                                           18

Monday, 31 October 11
Questions?




Monday, 31 October 11
Thanks!

                    http://openejb.apache.org
                   users@openejb.apache.org
                    dev@openejb.apache.org

                        @ApacheTomEE
                           #TomEE

Monday, 31 October 11
Ad

Recommended

From Tomcat to Java EE, making the transition with TomEE
From Tomcat to Java EE, making the transition with TomEE
jaxconf
 
2011 JavaOne Apache TomEE Java EE 6 Web Profile
2011 JavaOne Apache TomEE Java EE 6 Web Profile
David Blevins
 
Apache TomEE, Java EE 6 Web Profile {and more} on Tomcat
Apache TomEE, Java EE 6 Web Profile {and more} on Tomcat
Tomitribe
 
JavaOne 2013 - Apache TomEE, Java EE Web Profile {and more} on Tomcat
JavaOne 2013 - Apache TomEE, Java EE Web Profile {and more} on Tomcat
David Blevins
 
Java EE 7, what's in it for me?
Java EE 7, what's in it for me?
Alex Soto
 
Apache TomEE, Java EE 6 Web Profile on Tomcat - David Blevins
Apache TomEE, Java EE 6 Web Profile on Tomcat - David Blevins
jaxconf
 
The Fast, The Slow and the Lazy
The Fast, The Slow and the Lazy
Maurício Linhares
 
Handling 10k requests per second with Symfony and Varnish - SymfonyCon Berlin...
Handling 10k requests per second with Symfony and Varnish - SymfonyCon Berlin...
Alexander Lisachenko
 
Social Connections 2015 CrossWorlds and Domino
Social Connections 2015 CrossWorlds and Domino
Paul Withers
 
Presentation about Overthere for J-Fall 2011
Presentation about Overthere for J-Fall 2011
Vincent Partington
 
UCLUG TorqueBox - 03/08/2011
UCLUG TorqueBox - 03/08/2011
tobiascrawley
 
Introduction to Web Application Clustering
Introduction to Web Application Clustering
Piyush Katariya
 
ColdFusion builder plugins
ColdFusion builder plugins
ColdFusionConference
 
Eureka Moment UKLUG
Eureka Moment UKLUG
Paul Withers
 
CollabSphere SC 103 : Domino on the Web : Yes, It's (Probably) Hackable
CollabSphere SC 103 : Domino on the Web : Yes, It's (Probably) Hackable
Darren Duke
 
Asynchronous Web Programming with HTML5 WebSockets and Java
Asynchronous Web Programming with HTML5 WebSockets and Java
James Falkner
 
AtoM's Command Line Tasks - An Introduction
AtoM's Command Line Tasks - An Introduction
Artefactual Systems - AtoM
 
Ansible v2 and Beyond (Ansible Hawai'i Meetup)
Ansible v2 and Beyond (Ansible Hawai'i Meetup)
Timothy Appnel
 
“Bootify your app - from zero to hero
“Bootify your app - from zero to hero
Izzet Mustafaiev
 
Laravel Webcon 2015
Laravel Webcon 2015
Tim Bracken
 
Docker presentasjon java bin
Docker presentasjon java bin
Olve Hansen
 
Exceptable
Exceptable
Aurynn Shaw
 
Java servlet technology
Java servlet technology
Minal Maniar
 
Eureka moment
Eureka moment
Paul Withers
 
10 common cf server challenges
10 common cf server challenges
ColdFusionConference
 
BP204 It's Not Infernal: Dante's Nine Circles of XPages Heaven
BP204 It's Not Infernal: Dante's Nine Circles of XPages Heaven
Michael McGarel
 
Conquistando el Servidor con Node.JS
Conquistando el Servidor con Node.JS
Caridy Patino
 
Creating custom themes in AtoM
Creating custom themes in AtoM
Artefactual Systems - AtoM
 
Apache TomEE - Tomcat with a kick
Apache TomEE - Tomcat with a kick
Vishwanath Krishnamurthi
 
Apache Tomcat + Java EE = Apache TomEE
Apache Tomcat + Java EE = Apache TomEE
Jacek Laskowski
 

More Related Content

What's hot (20)

Social Connections 2015 CrossWorlds and Domino
Social Connections 2015 CrossWorlds and Domino
Paul Withers
 
Presentation about Overthere for J-Fall 2011
Presentation about Overthere for J-Fall 2011
Vincent Partington
 
UCLUG TorqueBox - 03/08/2011
UCLUG TorqueBox - 03/08/2011
tobiascrawley
 
Introduction to Web Application Clustering
Introduction to Web Application Clustering
Piyush Katariya
 
ColdFusion builder plugins
ColdFusion builder plugins
ColdFusionConference
 
Eureka Moment UKLUG
Eureka Moment UKLUG
Paul Withers
 
CollabSphere SC 103 : Domino on the Web : Yes, It's (Probably) Hackable
CollabSphere SC 103 : Domino on the Web : Yes, It's (Probably) Hackable
Darren Duke
 
Asynchronous Web Programming with HTML5 WebSockets and Java
Asynchronous Web Programming with HTML5 WebSockets and Java
James Falkner
 
AtoM's Command Line Tasks - An Introduction
AtoM's Command Line Tasks - An Introduction
Artefactual Systems - AtoM
 
Ansible v2 and Beyond (Ansible Hawai'i Meetup)
Ansible v2 and Beyond (Ansible Hawai'i Meetup)
Timothy Appnel
 
“Bootify your app - from zero to hero
“Bootify your app - from zero to hero
Izzet Mustafaiev
 
Laravel Webcon 2015
Laravel Webcon 2015
Tim Bracken
 
Docker presentasjon java bin
Docker presentasjon java bin
Olve Hansen
 
Exceptable
Exceptable
Aurynn Shaw
 
Java servlet technology
Java servlet technology
Minal Maniar
 
Eureka moment
Eureka moment
Paul Withers
 
10 common cf server challenges
10 common cf server challenges
ColdFusionConference
 
BP204 It's Not Infernal: Dante's Nine Circles of XPages Heaven
BP204 It's Not Infernal: Dante's Nine Circles of XPages Heaven
Michael McGarel
 
Conquistando el Servidor con Node.JS
Conquistando el Servidor con Node.JS
Caridy Patino
 
Creating custom themes in AtoM
Creating custom themes in AtoM
Artefactual Systems - AtoM
 
Social Connections 2015 CrossWorlds and Domino
Social Connections 2015 CrossWorlds and Domino
Paul Withers
 
Presentation about Overthere for J-Fall 2011
Presentation about Overthere for J-Fall 2011
Vincent Partington
 
UCLUG TorqueBox - 03/08/2011
UCLUG TorqueBox - 03/08/2011
tobiascrawley
 
Introduction to Web Application Clustering
Introduction to Web Application Clustering
Piyush Katariya
 
Eureka Moment UKLUG
Eureka Moment UKLUG
Paul Withers
 
CollabSphere SC 103 : Domino on the Web : Yes, It's (Probably) Hackable
CollabSphere SC 103 : Domino on the Web : Yes, It's (Probably) Hackable
Darren Duke
 
Asynchronous Web Programming with HTML5 WebSockets and Java
Asynchronous Web Programming with HTML5 WebSockets and Java
James Falkner
 
Ansible v2 and Beyond (Ansible Hawai'i Meetup)
Ansible v2 and Beyond (Ansible Hawai'i Meetup)
Timothy Appnel
 
“Bootify your app - from zero to hero
“Bootify your app - from zero to hero
Izzet Mustafaiev
 
Laravel Webcon 2015
Laravel Webcon 2015
Tim Bracken
 
Docker presentasjon java bin
Docker presentasjon java bin
Olve Hansen
 
Java servlet technology
Java servlet technology
Minal Maniar
 
BP204 It's Not Infernal: Dante's Nine Circles of XPages Heaven
BP204 It's Not Infernal: Dante's Nine Circles of XPages Heaven
Michael McGarel
 
Conquistando el Servidor con Node.JS
Conquistando el Servidor con Node.JS
Caridy Patino
 

Similar to Java EE | Apache TomEE - Java EE Web Profile on Tomcat | Jonathan Gallimore (20)

Apache TomEE - Tomcat with a kick
Apache TomEE - Tomcat with a kick
Vishwanath Krishnamurthi
 
Apache Tomcat + Java EE = Apache TomEE
Apache Tomcat + Java EE = Apache TomEE
Jacek Laskowski
 
Java EE 6 & GlassFish v3 @ DevNexus
Java EE 6 & GlassFish v3 @ DevNexus
Arun Gupta
 
Java EE 6 & GlassFish v3: Paving the path for the future - Tech Days 2010 India
Java EE 6 & GlassFish v3: Paving the path for the future - Tech Days 2010 India
Arun Gupta
 
Java EE 6 : Paving The Path For The Future
Java EE 6 : Paving The Path For The Future
IndicThreads
 
Arun Gupta: London Java Community: Java EE 6 and GlassFish 3
Arun Gupta: London Java Community: Java EE 6 and GlassFish 3
Skills Matter
 
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ JAX London ...
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ JAX London ...
Arun Gupta
 
Pp w tomee
Pp w tomee
Felix Gomez del Alamo
 
Java EE 6 & GlassFish v3: Paving the path for the future - Spark IT 2010
Java EE 6 & GlassFish v3: Paving the path for the future - Spark IT 2010
Arun Gupta
 
Java EE 7: the Voyage of the Cloud Treader
Java EE 7: the Voyage of the Cloud Treader
Saltmarch Media
 
web component_development
web component_development
bachector
 
Java EE 6 & GlassFish v3 at Vancouver JUG, Jan 26, 2010
Java EE 6 & GlassFish v3 at Vancouver JUG, Jan 26, 2010
Arun Gupta
 
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ Silicon Val...
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ Silicon Val...
Arun Gupta
 
jRecruiter - The AJUG Job Posting Service
jRecruiter - The AJUG Job Posting Service
Gunnar Hillert
 
Java EE 6 & GlassFish = Less Code + More Power @ DevIgnition
Java EE 6 & GlassFish = Less Code + More Power @ DevIgnition
Arun Gupta
 
Java EE 6 = Less Code + More Power
Java EE 6 = Less Code + More Power
Arun Gupta
 
Java EE 6 & GlassFish = Less Code + More Power at CEJUG
Java EE 6 & GlassFish = Less Code + More Power at CEJUG
Arun Gupta
 
Java EE 6 workshop at Dallas Tech Fest 2011
Java EE 6 workshop at Dallas Tech Fest 2011
Arun Gupta
 
Boston 2011 OTN Developer Days - Java EE 6
Boston 2011 OTN Developer Days - Java EE 6
Arun Gupta
 
JBoss AS 7 from a user perspective
JBoss AS 7 from a user perspective
Max Andersen
 
Apache Tomcat + Java EE = Apache TomEE
Apache Tomcat + Java EE = Apache TomEE
Jacek Laskowski
 
Java EE 6 & GlassFish v3 @ DevNexus
Java EE 6 & GlassFish v3 @ DevNexus
Arun Gupta
 
Java EE 6 & GlassFish v3: Paving the path for the future - Tech Days 2010 India
Java EE 6 & GlassFish v3: Paving the path for the future - Tech Days 2010 India
Arun Gupta
 
Java EE 6 : Paving The Path For The Future
Java EE 6 : Paving The Path For The Future
IndicThreads
 
Arun Gupta: London Java Community: Java EE 6 and GlassFish 3
Arun Gupta: London Java Community: Java EE 6 and GlassFish 3
Skills Matter
 
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ JAX London ...
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ JAX London ...
Arun Gupta
 
Java EE 6 & GlassFish v3: Paving the path for the future - Spark IT 2010
Java EE 6 & GlassFish v3: Paving the path for the future - Spark IT 2010
Arun Gupta
 
Java EE 7: the Voyage of the Cloud Treader
Java EE 7: the Voyage of the Cloud Treader
Saltmarch Media
 
web component_development
web component_development
bachector
 
Java EE 6 & GlassFish v3 at Vancouver JUG, Jan 26, 2010
Java EE 6 & GlassFish v3 at Vancouver JUG, Jan 26, 2010
Arun Gupta
 
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ Silicon Val...
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ Silicon Val...
Arun Gupta
 
jRecruiter - The AJUG Job Posting Service
jRecruiter - The AJUG Job Posting Service
Gunnar Hillert
 
Java EE 6 & GlassFish = Less Code + More Power @ DevIgnition
Java EE 6 & GlassFish = Less Code + More Power @ DevIgnition
Arun Gupta
 
Java EE 6 = Less Code + More Power
Java EE 6 = Less Code + More Power
Arun Gupta
 
Java EE 6 & GlassFish = Less Code + More Power at CEJUG
Java EE 6 & GlassFish = Less Code + More Power at CEJUG
Arun Gupta
 
Java EE 6 workshop at Dallas Tech Fest 2011
Java EE 6 workshop at Dallas Tech Fest 2011
Arun Gupta
 
Boston 2011 OTN Developer Days - Java EE 6
Boston 2011 OTN Developer Days - Java EE 6
Arun Gupta
 
JBoss AS 7 from a user perspective
JBoss AS 7 from a user perspective
Max Andersen
 
Ad

More from JAX London (20)

Java Tech & Tools | Continuous Delivery - the Writing is on the Wall | John S...
Java Tech & Tools | Continuous Delivery - the Writing is on the Wall | John S...
JAX London
 
Java Tech & Tools | Mapping, GIS and Geolocating Data in Java | Joachim Van d...
Java Tech & Tools | Mapping, GIS and Geolocating Data in Java | Joachim Van d...
JAX London
 
Keynote | Middleware Everywhere - Ready for Mobile and Cloud | Dr. Mark Little
Keynote | Middleware Everywhere - Ready for Mobile and Cloud | Dr. Mark Little
JAX London
 
Spring Day | WaveMaker - Spring Roo - SpringSource Tool Suite: Choosing the R...
Spring Day | WaveMaker - Spring Roo - SpringSource Tool Suite: Choosing the R...
JAX London
 
Spring Day | Behind the Scenes at Spring Batch | Dave Syer
Spring Day | Behind the Scenes at Spring Batch | Dave Syer
JAX London
 
Spring Day | Spring 3.1 in a Nutshell | Sam Brannen
Spring Day | Spring 3.1 in a Nutshell | Sam Brannen
JAX London
 
Spring Day | Identity Management with Spring Security | Dave Syer
Spring Day | Identity Management with Spring Security | Dave Syer
JAX London
 
Spring Day | Spring and Scala | Eberhard Wolff
Spring Day | Spring and Scala | Eberhard Wolff
JAX London
 
Spring Day | Data Access 2.0? Please Welcome Spring Data! | Oliver Gierke
Spring Day | Data Access 2.0? Please Welcome Spring Data! | Oliver Gierke
JAX London
 
Keynote | The Rise and Fall and Rise of Java | James Governor
Keynote | The Rise and Fall and Rise of Java | James Governor
JAX London
 
Java Tech & Tools | OSGi Best Practices | Emily Jiang
Java Tech & Tools | OSGi Best Practices | Emily Jiang
JAX London
 
Java Tech & Tools | Beyond the Data Grid: Coherence, Normalisation, Joins and...
Java Tech & Tools | Beyond the Data Grid: Coherence, Normalisation, Joins and...
JAX London
 
Java Tech & Tools | Big Blobs: Moving Big Data In and Out of the Cloud | Adri...
Java Tech & Tools | Big Blobs: Moving Big Data In and Out of the Cloud | Adri...
JAX London
 
Java Tech & Tools | Social Media in Programming in Java | Khanderao Kand
Java Tech & Tools | Social Media in Programming in Java | Khanderao Kand
JAX London
 
Java Tech & Tools | Just Keep Passing the Message | Russel Winder
Java Tech & Tools | Just Keep Passing the Message | Russel Winder
JAX London
 
Java Tech & Tools | Grails in the Java Enterprise | Peter Ledbrook
Java Tech & Tools | Grails in the Java Enterprise | Peter Ledbrook
JAX London
 
Java Tech & Tools | Deploying Java & Play Framework Apps to the Cloud | Sande...
Java Tech & Tools | Deploying Java & Play Framework Apps to the Cloud | Sande...
JAX London
 
Java EE | Modular EJBs for Enterprise OSGi | Tim Ward
Java EE | Modular EJBs for Enterprise OSGi | Tim Ward
JAX London
 
Java Core | Understanding the Disruptor: a Beginner's Guide to Hardcore Concu...
Java Core | Understanding the Disruptor: a Beginner's Guide to Hardcore Concu...
JAX London
 
Java Core | Java 8 and OSGi Modularisation | Tim Ellison & Neil Bartlett
Java Core | Java 8 and OSGi Modularisation | Tim Ellison & Neil Bartlett
JAX London
 
Java Tech & Tools | Continuous Delivery - the Writing is on the Wall | John S...
Java Tech & Tools | Continuous Delivery - the Writing is on the Wall | John S...
JAX London
 
Java Tech & Tools | Mapping, GIS and Geolocating Data in Java | Joachim Van d...
Java Tech & Tools | Mapping, GIS and Geolocating Data in Java | Joachim Van d...
JAX London
 
Keynote | Middleware Everywhere - Ready for Mobile and Cloud | Dr. Mark Little
Keynote | Middleware Everywhere - Ready for Mobile and Cloud | Dr. Mark Little
JAX London
 
Spring Day | WaveMaker - Spring Roo - SpringSource Tool Suite: Choosing the R...
Spring Day | WaveMaker - Spring Roo - SpringSource Tool Suite: Choosing the R...
JAX London
 
Spring Day | Behind the Scenes at Spring Batch | Dave Syer
Spring Day | Behind the Scenes at Spring Batch | Dave Syer
JAX London
 
Spring Day | Spring 3.1 in a Nutshell | Sam Brannen
Spring Day | Spring 3.1 in a Nutshell | Sam Brannen
JAX London
 
Spring Day | Identity Management with Spring Security | Dave Syer
Spring Day | Identity Management with Spring Security | Dave Syer
JAX London
 
Spring Day | Spring and Scala | Eberhard Wolff
Spring Day | Spring and Scala | Eberhard Wolff
JAX London
 
Spring Day | Data Access 2.0? Please Welcome Spring Data! | Oliver Gierke
Spring Day | Data Access 2.0? Please Welcome Spring Data! | Oliver Gierke
JAX London
 
Keynote | The Rise and Fall and Rise of Java | James Governor
Keynote | The Rise and Fall and Rise of Java | James Governor
JAX London
 
Java Tech & Tools | OSGi Best Practices | Emily Jiang
Java Tech & Tools | OSGi Best Practices | Emily Jiang
JAX London
 
Java Tech & Tools | Beyond the Data Grid: Coherence, Normalisation, Joins and...
Java Tech & Tools | Beyond the Data Grid: Coherence, Normalisation, Joins and...
JAX London
 
Java Tech & Tools | Big Blobs: Moving Big Data In and Out of the Cloud | Adri...
Java Tech & Tools | Big Blobs: Moving Big Data In and Out of the Cloud | Adri...
JAX London
 
Java Tech & Tools | Social Media in Programming in Java | Khanderao Kand
Java Tech & Tools | Social Media in Programming in Java | Khanderao Kand
JAX London
 
Java Tech & Tools | Just Keep Passing the Message | Russel Winder
Java Tech & Tools | Just Keep Passing the Message | Russel Winder
JAX London
 
Java Tech & Tools | Grails in the Java Enterprise | Peter Ledbrook
Java Tech & Tools | Grails in the Java Enterprise | Peter Ledbrook
JAX London
 
Java Tech & Tools | Deploying Java & Play Framework Apps to the Cloud | Sande...
Java Tech & Tools | Deploying Java & Play Framework Apps to the Cloud | Sande...
JAX London
 
Java EE | Modular EJBs for Enterprise OSGi | Tim Ward
Java EE | Modular EJBs for Enterprise OSGi | Tim Ward
JAX London
 
Java Core | Understanding the Disruptor: a Beginner's Guide to Hardcore Concu...
Java Core | Understanding the Disruptor: a Beginner's Guide to Hardcore Concu...
JAX London
 
Java Core | Java 8 and OSGi Modularisation | Tim Ellison & Neil Bartlett
Java Core | Java 8 and OSGi Modularisation | Tim Ellison & Neil Bartlett
JAX London
 
Ad

Recently uploaded (20)

Using the SQLExecutor for Data Quality Management: aka One man's love for the...
Using the SQLExecutor for Data Quality Management: aka One man's love for the...
Safe Software
 
Daily Lesson Log MATATAG ICT TEchnology 8
Daily Lesson Log MATATAG ICT TEchnology 8
LOIDAALMAZAN3
 
ReSTIR [DI]: Spatiotemporal reservoir resampling for real-time ray tracing ...
ReSTIR [DI]: Spatiotemporal reservoir resampling for real-time ray tracing ...
revolcs10
 
Database Benchmarking for Performance Masterclass: Session 2 - Data Modeling ...
Database Benchmarking for Performance Masterclass: Session 2 - Data Modeling ...
ScyllaDB
 
Python Conference Singapore - 19 Jun 2025
Python Conference Singapore - 19 Jun 2025
ninefyi
 
WebdriverIO & JavaScript: The Perfect Duo for Web Automation
WebdriverIO & JavaScript: The Perfect Duo for Web Automation
digitaljignect
 
The Growing Value and Application of FME & GenAI
The Growing Value and Application of FME & GenAI
Safe Software
 
Wenn alles versagt - IBM Tape schützt, was zählt! Und besonders mit dem neust...
Wenn alles versagt - IBM Tape schützt, was zählt! Und besonders mit dem neust...
Josef Weingand
 
Hyderabad MuleSoft In-Person Meetup (June 21, 2025) Slides
Hyderabad MuleSoft In-Person Meetup (June 21, 2025) Slides
Ravi Tamada
 
AI vs Human Writing: Can You Tell the Difference?
AI vs Human Writing: Can You Tell the Difference?
Shashi Sathyanarayana, Ph.D
 
GenAI Opportunities and Challenges - Where 370 Enterprises Are Focusing Now.pdf
GenAI Opportunities and Challenges - Where 370 Enterprises Are Focusing Now.pdf
Priyanka Aash
 
9-1-1 Addressing: End-to-End Automation Using FME
9-1-1 Addressing: End-to-End Automation Using FME
Safe Software
 
“MPU+: A Transformative Solution for Next-Gen AI at the Edge,” a Presentation...
“MPU+: A Transformative Solution for Next-Gen AI at the Edge,” a Presentation...
Edge AI and Vision Alliance
 
" How to survive with 1 billion vectors and not sell a kidney: our low-cost c...
" How to survive with 1 billion vectors and not sell a kidney: our low-cost c...
Fwdays
 
Connecting Data and Intelligence: The Role of FME in Machine Learning
Connecting Data and Intelligence: The Role of FME in Machine Learning
Safe Software
 
Raman Bhaumik - Passionate Tech Enthusiast
Raman Bhaumik - Passionate Tech Enthusiast
Raman Bhaumik
 
Techniques for Automatic Device Identification and Network Assignment.pdf
Techniques for Automatic Device Identification and Network Assignment.pdf
Priyanka Aash
 
cnc-processing-centers-centateq-p-110-en.pdf
cnc-processing-centers-centateq-p-110-en.pdf
AmirStern2
 
EIS-Webinar-Engineering-Retail-Infrastructure-06-16-2025.pdf
EIS-Webinar-Engineering-Retail-Infrastructure-06-16-2025.pdf
Earley Information Science
 
Lessons Learned from Developing Secure AI Workflows.pdf
Lessons Learned from Developing Secure AI Workflows.pdf
Priyanka Aash
 
Using the SQLExecutor for Data Quality Management: aka One man's love for the...
Using the SQLExecutor for Data Quality Management: aka One man's love for the...
Safe Software
 
Daily Lesson Log MATATAG ICT TEchnology 8
Daily Lesson Log MATATAG ICT TEchnology 8
LOIDAALMAZAN3
 
ReSTIR [DI]: Spatiotemporal reservoir resampling for real-time ray tracing ...
ReSTIR [DI]: Spatiotemporal reservoir resampling for real-time ray tracing ...
revolcs10
 
Database Benchmarking for Performance Masterclass: Session 2 - Data Modeling ...
Database Benchmarking for Performance Masterclass: Session 2 - Data Modeling ...
ScyllaDB
 
Python Conference Singapore - 19 Jun 2025
Python Conference Singapore - 19 Jun 2025
ninefyi
 
WebdriverIO & JavaScript: The Perfect Duo for Web Automation
WebdriverIO & JavaScript: The Perfect Duo for Web Automation
digitaljignect
 
The Growing Value and Application of FME & GenAI
The Growing Value and Application of FME & GenAI
Safe Software
 
Wenn alles versagt - IBM Tape schützt, was zählt! Und besonders mit dem neust...
Wenn alles versagt - IBM Tape schützt, was zählt! Und besonders mit dem neust...
Josef Weingand
 
Hyderabad MuleSoft In-Person Meetup (June 21, 2025) Slides
Hyderabad MuleSoft In-Person Meetup (June 21, 2025) Slides
Ravi Tamada
 
AI vs Human Writing: Can You Tell the Difference?
AI vs Human Writing: Can You Tell the Difference?
Shashi Sathyanarayana, Ph.D
 
GenAI Opportunities and Challenges - Where 370 Enterprises Are Focusing Now.pdf
GenAI Opportunities and Challenges - Where 370 Enterprises Are Focusing Now.pdf
Priyanka Aash
 
9-1-1 Addressing: End-to-End Automation Using FME
9-1-1 Addressing: End-to-End Automation Using FME
Safe Software
 
“MPU+: A Transformative Solution for Next-Gen AI at the Edge,” a Presentation...
“MPU+: A Transformative Solution for Next-Gen AI at the Edge,” a Presentation...
Edge AI and Vision Alliance
 
" How to survive with 1 billion vectors and not sell a kidney: our low-cost c...
" How to survive with 1 billion vectors and not sell a kidney: our low-cost c...
Fwdays
 
Connecting Data and Intelligence: The Role of FME in Machine Learning
Connecting Data and Intelligence: The Role of FME in Machine Learning
Safe Software
 
Raman Bhaumik - Passionate Tech Enthusiast
Raman Bhaumik - Passionate Tech Enthusiast
Raman Bhaumik
 
Techniques for Automatic Device Identification and Network Assignment.pdf
Techniques for Automatic Device Identification and Network Assignment.pdf
Priyanka Aash
 
cnc-processing-centers-centateq-p-110-en.pdf
cnc-processing-centers-centateq-p-110-en.pdf
AmirStern2
 
EIS-Webinar-Engineering-Retail-Infrastructure-06-16-2025.pdf
EIS-Webinar-Engineering-Retail-Infrastructure-06-16-2025.pdf
Earley Information Science
 
Lessons Learned from Developing Secure AI Workflows.pdf
Lessons Learned from Developing Secure AI Workflows.pdf
Priyanka Aash
 

Java EE | Apache TomEE - Java EE Web Profile on Tomcat | Jonathan Gallimore

  • 1. Jonathan Gallimore @jongallimore #TomEE Apache TomEE // JavaEE Web Profile on Tomcat Monday, 31 October 11
  • 2. What is Apache TomEE • Tomcat + Java EE = TomEE • Complete Tomcat with nothing taken away • Java EE 6 Web profile certified stack • All Apache components • MyFaces • OpenEJB • OpenWebBeans • OpenJPA 2 Monday, 31 October 11
  • 3. Philosophy • Be small, be certified, be Tomcat • Integrate OpenEJB into Tomcat, not the other way around • Get more, don’t give up anything • Leverage existing Tomcat features (JNDI, Security) • Lightweight • just 24MB • no extra memory requirement • No need to learn new server environment • Use existing IDE tools 3 Monday, 31 October 11
  • 4. Flavours of TomEE • Apache TomEE Web Profile (Java EE 6 certified) • OpenEJB • OpenWebBeans • OpenJPA • Bean validation • MyFaces • Apache TomEE Plus (not Java EE 6 certified) • CXF • ActiveMQ • Geronimo connector • Embedded Apache TomEE 4 Monday, 31 October 11
  • 5. Stats • Size: the entire Web Profile is only 24Mb • Memory usage: very little required, passed the TCK without changing any default JVM memory settings • Agility: the server can go through a start/deploy/test/ undeploy/stop cycle in 2-3 seconds, when run in embedded mode 5 Monday, 31 October 11
  • 6. Certification • Certified on Amazon EC2 • t1.micro linux images, lot’s of them • 100 spot instances going at once (sometimes more)! • Each has 613MB memory max • Use default JVM memory settings • Current certified OSs • Amazon Linux AMI 2011.09, EBS boot, 32-bit EC2 t1.micro • Amazon Linux AMI 2011.09, EBS boot, 32-bit EC2 m1.small • Amazon Linux AMI 2011.09, EBS boot, 32-bit EC2 c1.medium 6 Monday, 31 October 11
  • 7. Getting started • Unzip • Start with usual Catalina scripts or services • Deploy application .war or .ear in webapps • Console application at http://localhost:8080/openejb • Or deploy openejb.war in any standard Tomcat 7 installation 7 Monday, 31 October 11
  • 8. Demo • Moviefun sample - demonstrates: • Servlets • CDI • JSF • EJBs • JPA • Available in OpenEJB source code repository • Over 50 different examples available for various Java EE features 8 Monday, 31 October 11
  • 9. Why not just use Tomcat? • Plain Tomcat doesn’t have support for: • Transactions • Transaction aware connection pooling • @Resource • @PersistenceUnit • @Inject • @EJB • Global JNDI (java:module, java:app, java:global) • Are you adding libraries to provide EE features (e.g. persistence or CDI)? 9 Monday, 31 October 11
  • 10. Configuration • Resources configured in conf/openejb.xml • Simple XML + properties format • Tags match Annotation names • <Resource id="moviesDatabase" type="DataSource"> • Can be injected using this code • @Resource DataSource moviesDatabase 10 Monday, 31 October 11
  • 11. Transactions • Connection pooling is Transaction aware • Everyone in same transaction, shares same connection • Servlets, ManagedBeans, etc. can start transactions • @Resource UserTransaction transaction; • No need for EJBs to use transactions 11 Monday, 31 October 11
  • 12. Persistence • All persistence.xml files found and deployed • Connection persistence.xml values filled in automatically • Servlets, ManagedBeans, Session Beans, etc now use • @PersistenceUnit EntityManagerFactory emf; • @PersistenceContext EntityManager em; • OpenJPA included, easy to remove • Hibernate used in many Apache TomEE installs 12 Monday, 31 October 11
  • 13. EJBs • EJBs can be added directly to webapp • Servlets, Managed beans can use @EJB • EJB 3.1 provides no-interface view • HTTP can be used for EJB remote communication (http://localhost:8080/openejb/ejb) • User/Pass supplied with InitialContext params • HTTP or HTTPS 13 Monday, 31 October 11
  • 14. What next? • How small can we get? • Below 20MB download? • 6000 classes loaded, can we get to 2000? • Optimisations • Certify more parts • Connector • JAX-WS • JAX-RS 14 Monday, 31 October 11
  • 15. Testing - Embedded TomEE • Very straightforward to use, very little config needed • Maven users can add tomee-embedded dependency, or add all-in-one jar to classpath • Could be used with frameworks like HtmlUnit or Selenium to test your application Properties p = new Properties(); p.setProperty(EJBContainer.APP_NAME, "moviefun"); p.setProperty(EJBContainer.PROVIDER, "tomee-embedded"); // need web feature p.setProperty(EJBContainer.MODULES, webApp.getAbsolutePath()); p.setProperty(EmbeddedTomEEContainer.TOMEE_EJBCONTAINER_HTTP_PORT, "9999"); container = EJBContainer.createEJBContainer(p); 15 Monday, 31 October 11
  • 16. Arquillian tests • Test harness from JBoss (http://www.jboss.org/ arquillian) • Allows you to run your test in any supported container • Adapters available for a number of servers • Skip the build • Run tests straight from the IDE 16 Monday, 31 October 11
  • 17. TomEE Arquillian Adapters • Embedded • Boots TomEE embedded directly in the test • Remote • Can connect to a running instance of TomEE • OR download and start TomEE bundle • OR any version of Tomcat/OpenEJB • Configured in arquillian.xml 17 Monday, 31 October 11
  • 18. Anatomy of an Arquillian Test • Deployment • Build an archive using the ShrinkWrap API • Choose parts of your application to test • Build archive with test settings • Test logic • Exercise your application • HtmlUnit • Selenium 18 Monday, 31 October 11
  • 20. Thanks! http://openejb.apache.org [email protected] [email protected] @ApacheTomEE #TomEE Monday, 31 October 11