SlideShare une entreprise Scribd logo
1  sur  20
Télécharger pour lire hors ligne
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

Contenu connexe

Tendances

Presentation about Overthere for J-Fall 2011
Presentation about Overthere for J-Fall 2011Presentation about Overthere for J-Fall 2011
Presentation about Overthere for J-Fall 2011
Vincent Partington
 
UCLUG TorqueBox - 03/08/2011
UCLUG TorqueBox - 03/08/2011UCLUG TorqueBox - 03/08/2011
UCLUG TorqueBox - 03/08/2011
tobiascrawley
 
Introduction to Web Application Clustering
Introduction to Web Application ClusteringIntroduction to Web Application Clustering
Introduction to Web Application Clustering
Piyush Katariya
 
Conquistando el Servidor con Node.JS
Conquistando el Servidor con Node.JSConquistando el Servidor con Node.JS
Conquistando el Servidor con Node.JS
Caridy Patino
 

Tendances (20)

Social Connections 2015 CrossWorlds and Domino
Social Connections 2015 CrossWorlds and DominoSocial Connections 2015 CrossWorlds and Domino
Social Connections 2015 CrossWorlds and Domino
 
Presentation about Overthere for J-Fall 2011
Presentation about Overthere for J-Fall 2011Presentation about Overthere for J-Fall 2011
Presentation about Overthere for J-Fall 2011
 
UCLUG TorqueBox - 03/08/2011
UCLUG TorqueBox - 03/08/2011UCLUG TorqueBox - 03/08/2011
UCLUG TorqueBox - 03/08/2011
 
Introduction to Web Application Clustering
Introduction to Web Application ClusteringIntroduction to Web Application Clustering
Introduction to Web Application Clustering
 
ColdFusion builder plugins
ColdFusion builder pluginsColdFusion builder plugins
ColdFusion builder plugins
 
Eureka Moment UKLUG
Eureka Moment UKLUGEureka Moment UKLUG
Eureka Moment UKLUG
 
CollabSphere SC 103 : Domino on the Web : Yes, It's (Probably) Hackable
CollabSphere SC 103 : Domino on the Web : Yes, It's (Probably) HackableCollabSphere SC 103 : Domino on the Web : Yes, It's (Probably) Hackable
CollabSphere SC 103 : Domino on the Web : Yes, It's (Probably) Hackable
 
Asynchronous Web Programming with HTML5 WebSockets and Java
Asynchronous Web Programming with HTML5 WebSockets and JavaAsynchronous Web Programming with HTML5 WebSockets and Java
Asynchronous Web Programming with HTML5 WebSockets and Java
 
AtoM's Command Line Tasks - An Introduction
AtoM's Command Line Tasks - An IntroductionAtoM's Command Line Tasks - An Introduction
AtoM's Command Line Tasks - An Introduction
 
Ansible v2 and Beyond (Ansible Hawai'i Meetup)
Ansible v2 and Beyond (Ansible Hawai'i Meetup)Ansible v2 and Beyond (Ansible Hawai'i Meetup)
Ansible v2 and Beyond (Ansible Hawai'i Meetup)
 
“Bootify your app - from zero to hero
“Bootify  your app - from zero to hero“Bootify  your app - from zero to hero
“Bootify your app - from zero to hero
 
Laravel Webcon 2015
Laravel Webcon 2015Laravel Webcon 2015
Laravel Webcon 2015
 
Docker presentasjon java bin
Docker presentasjon java binDocker presentasjon java bin
Docker presentasjon java bin
 
Exceptable
ExceptableExceptable
Exceptable
 
Java servlet technology
Java servlet technologyJava servlet technology
Java servlet technology
 
Eureka moment
Eureka momentEureka moment
Eureka moment
 
10 common cf server challenges
10 common cf server challenges10 common cf server challenges
10 common cf server challenges
 
BP204 It's Not Infernal: Dante's Nine Circles of XPages Heaven
BP204 It's Not Infernal: Dante's Nine Circles of XPages HeavenBP204 It's Not Infernal: Dante's Nine Circles of XPages Heaven
BP204 It's Not Infernal: Dante's Nine Circles of XPages Heaven
 
Conquistando el Servidor con Node.JS
Conquistando el Servidor con Node.JSConquistando el Servidor con Node.JS
Conquistando el Servidor con Node.JS
 
Creating custom themes in AtoM
Creating custom themes in AtoMCreating custom themes in AtoM
Creating custom themes in AtoM
 

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

Apache Tomcat + Java EE = Apache TomEE
Apache Tomcat + Java EE = Apache TomEEApache Tomcat + Java EE = Apache TomEE
Apache Tomcat + Java EE = Apache TomEE
Jacek Laskowski
 
PHPUnit & Continuous Integration: An Introduction
PHPUnit & Continuous Integration: An IntroductionPHPUnit & Continuous Integration: An Introduction
PHPUnit & Continuous Integration: An Introduction
alexmace
 
Testing Rapidly Changing Applications With Self-Testing Object-Oriented Selen...
Testing Rapidly Changing Applications With Self-Testing Object-Oriented Selen...Testing Rapidly Changing Applications With Self-Testing Object-Oriented Selen...
Testing Rapidly Changing Applications With Self-Testing Object-Oriented Selen...
seleniumconf
 
2011 JavaOne Fun with EJB 3.1 and OpenEJB
2011 JavaOne Fun with EJB 3.1 and OpenEJB2011 JavaOne Fun with EJB 3.1 and OpenEJB
2011 JavaOne Fun with EJB 3.1 and OpenEJB
David Blevins
 

Similaire à Java EE | Apache TomEE - Java EE Web Profile on Tomcat | Jonathan Gallimore (20)

AVA - a futuristic test runner
AVA - a futuristic test runnerAVA - a futuristic test runner
AVA - a futuristic test runner
 
Apache Tomcat + Java EE = Apache TomEE
Apache Tomcat + Java EE = Apache TomEEApache Tomcat + Java EE = Apache TomEE
Apache Tomcat + Java EE = Apache TomEE
 
eZ Publish nextgen
eZ Publish nextgeneZ Publish nextgen
eZ Publish nextgen
 
PHPUnit & Continuous Integration: An Introduction
PHPUnit & Continuous Integration: An IntroductionPHPUnit & Continuous Integration: An Introduction
PHPUnit & Continuous Integration: An Introduction
 
AppScale Talk at SBonRails
AppScale Talk at SBonRailsAppScale Talk at SBonRails
AppScale Talk at SBonRails
 
Fastest Servlets in the West
Fastest Servlets in the WestFastest Servlets in the West
Fastest Servlets in the West
 
EUC2015 - Load testing XMPP servers with Plain Old Erlang
EUC2015 - Load testing XMPP servers with Plain Old ErlangEUC2015 - Load testing XMPP servers with Plain Old Erlang
EUC2015 - Load testing XMPP servers with Plain Old Erlang
 
Ruby and Distributed Storage Systems
Ruby and Distributed Storage SystemsRuby and Distributed Storage Systems
Ruby and Distributed Storage Systems
 
Introducing Apricot, The Eclipse Content Management Platform
Introducing Apricot, The Eclipse Content Management PlatformIntroducing Apricot, The Eclipse Content Management Platform
Introducing Apricot, The Eclipse Content Management Platform
 
RunDeck
RunDeckRunDeck
RunDeck
 
Securing Docker Containers via Osquery and Kubernetes
Securing Docker Containers via Osquery and KubernetesSecuring Docker Containers via Osquery and Kubernetes
Securing Docker Containers via Osquery and Kubernetes
 
Testing Rapidly Changing Applications With Self-Testing Object-Oriented Selen...
Testing Rapidly Changing Applications With Self-Testing Object-Oriented Selen...Testing Rapidly Changing Applications With Self-Testing Object-Oriented Selen...
Testing Rapidly Changing Applications With Self-Testing Object-Oriented Selen...
 
How to stuff a 900 pound gorilla into a smartphone
How to stuff a 900 pound gorilla into a smartphoneHow to stuff a 900 pound gorilla into a smartphone
How to stuff a 900 pound gorilla into a smartphone
 
Container Security
Container SecurityContainer Security
Container Security
 
Apache TomEE - Tomcat with a kick
Apache TomEE  - Tomcat with a kickApache TomEE  - Tomcat with a kick
Apache TomEE - Tomcat with a kick
 
Eclipse Apricot
Eclipse ApricotEclipse Apricot
Eclipse Apricot
 
C# Async/Await Explained
C# Async/Await ExplainedC# Async/Await Explained
C# Async/Await Explained
 
2011 JavaOne Fun with EJB 3.1 and OpenEJB
2011 JavaOne Fun with EJB 3.1 and OpenEJB2011 JavaOne Fun with EJB 3.1 and OpenEJB
2011 JavaOne Fun with EJB 3.1 and OpenEJB
 
Scaling and Managing Selenium Grid
Scaling and Managing Selenium GridScaling and Managing Selenium Grid
Scaling and Managing Selenium Grid
 
Writing Well Abstracted Automation on Foundations of Jello
Writing Well Abstracted Automation on Foundations of JelloWriting Well Abstracted Automation on Foundations of Jello
Writing Well Abstracted Automation on Foundations of Jello
 

Plus de 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 GierkeSpring 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 GovernorKeynote | 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 JiangJava Tech & Tools | OSGi Best Practices | Emily Jiang
Java Tech & Tools | OSGi Best Practices | Emily Jiang
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...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 | Deploying Java & Play Framework Apps to the Cloud | Sande...
Java Tech & Tools | Deploying Java & Play Framework Apps to the Cloud | Sande...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
 

Plus de 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...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...
 
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...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...
 
Keynote | Middleware Everywhere - Ready for Mobile and Cloud | Dr. Mark Little
Keynote | Middleware Everywhere - Ready for Mobile and Cloud | Dr. Mark LittleKeynote | Middleware Everywhere - Ready for Mobile and Cloud | Dr. Mark Little
Keynote | Middleware Everywhere - Ready for Mobile and Cloud | Dr. Mark Little
 
Spring Day | WaveMaker - Spring Roo - SpringSource Tool Suite: Choosing the R...
Spring Day | WaveMaker - Spring Roo - SpringSource Tool Suite: Choosing the R...Spring Day | WaveMaker - Spring Roo - SpringSource Tool Suite: Choosing the R...
Spring Day | WaveMaker - Spring Roo - SpringSource Tool Suite: Choosing the R...
 
Spring Day | Behind the Scenes at Spring Batch | Dave Syer
Spring Day | Behind the Scenes at Spring Batch | Dave SyerSpring Day | Behind the Scenes at Spring Batch | Dave Syer
Spring Day | Behind the Scenes at Spring Batch | Dave Syer
 
Spring Day | Spring 3.1 in a Nutshell | Sam Brannen
Spring Day | Spring 3.1 in a Nutshell | Sam BrannenSpring Day | Spring 3.1 in a Nutshell | Sam Brannen
Spring Day | Spring 3.1 in a Nutshell | Sam Brannen
 
Spring Day | Identity Management with Spring Security | Dave Syer
Spring Day | Identity Management with Spring Security | Dave SyerSpring Day | Identity Management with Spring Security | Dave Syer
Spring Day | Identity Management with Spring Security | Dave Syer
 
Spring Day | Spring and Scala | Eberhard Wolff
Spring Day | Spring and Scala | Eberhard WolffSpring Day | Spring and Scala | Eberhard Wolff
Spring Day | Spring and Scala | Eberhard Wolff
 
Spring Day | Data Access 2.0? Please Welcome Spring Data! | Oliver Gierke
Spring Day | Data Access 2.0? Please Welcome Spring Data! | Oliver GierkeSpring Day | Data Access 2.0? Please Welcome Spring Data! | Oliver Gierke
Spring Day | Data Access 2.0? Please Welcome Spring Data! | Oliver Gierke
 
Keynote | The Rise and Fall and Rise of Java | James Governor
Keynote | The Rise and Fall and Rise of Java | James GovernorKeynote | The Rise and Fall and Rise of Java | James Governor
Keynote | The Rise and Fall and Rise of Java | James Governor
 
Java Tech & Tools | OSGi Best Practices | Emily Jiang
Java Tech & Tools | OSGi Best Practices | Emily JiangJava Tech & Tools | OSGi Best Practices | Emily Jiang
Java Tech & Tools | OSGi Best Practices | Emily Jiang
 
Java Tech & Tools | Beyond the Data Grid: Coherence, Normalisation, Joins and...
Java Tech & Tools | Beyond the Data Grid: Coherence, Normalisation, Joins and...Java Tech & Tools | Beyond the Data Grid: Coherence, Normalisation, Joins and...
Java Tech & Tools | Beyond the Data Grid: Coherence, Normalisation, Joins and...
 
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...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...
 
Java Tech & Tools | Social Media in Programming in Java | Khanderao Kand
Java Tech & Tools | Social Media in Programming in Java | Khanderao KandJava Tech & Tools | Social Media in Programming in Java | Khanderao Kand
Java Tech & Tools | Social Media in Programming in Java | Khanderao Kand
 
Java Tech & Tools | Just Keep Passing the Message | Russel Winder
Java Tech & Tools | Just Keep Passing the Message | Russel WinderJava Tech & Tools | Just Keep Passing the Message | Russel Winder
Java Tech & Tools | Just Keep Passing the Message | Russel Winder
 
Java Tech & Tools | Grails in the Java Enterprise | Peter Ledbrook
Java Tech & Tools | Grails in the Java Enterprise | Peter LedbrookJava Tech & Tools | Grails in the Java Enterprise | Peter Ledbrook
Java Tech & Tools | Grails in the Java Enterprise | Peter Ledbrook
 
Java Tech & Tools | Deploying Java & Play Framework Apps to the Cloud | Sande...
Java Tech & Tools | Deploying Java & Play Framework Apps to the Cloud | Sande...Java Tech & Tools | Deploying Java & Play Framework Apps to the Cloud | Sande...
Java Tech & Tools | Deploying Java & Play Framework Apps to the Cloud | Sande...
 
Java EE | Modular EJBs for Enterprise OSGi | Tim Ward
Java EE | Modular EJBs for Enterprise OSGi | Tim WardJava EE | Modular EJBs for Enterprise OSGi | Tim Ward
Java EE | Modular EJBs for Enterprise OSGi | Tim Ward
 
Java Core | Understanding the Disruptor: a Beginner's Guide to Hardcore Concu...
Java Core | Understanding the Disruptor: a Beginner's Guide to Hardcore Concu...Java Core | Understanding the Disruptor: a Beginner's Guide to Hardcore Concu...
Java Core | Understanding the Disruptor: a Beginner's Guide to Hardcore Concu...
 
Java Core | Java 8 and OSGi Modularisation | Tim Ellison & Neil Bartlett
Java Core | Java 8 and OSGi Modularisation | Tim Ellison & Neil BartlettJava Core | Java 8 and OSGi Modularisation | Tim Ellison & Neil Bartlett
Java Core | Java 8 and OSGi Modularisation | Tim Ellison & Neil Bartlett
 

Dernier

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 

Dernier (20)

Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 

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 users@openejb.apache.org dev@openejb.apache.org @ApacheTomEE #TomEE Monday, 31 October 11