SlideShare ist ein Scribd-Unternehmen logo
1 von 20
Downloaden Sie, um offline zu lesen
OSGi in Java EE servers: sneak peek inside
Krasimir Semerdzhiev (SAP AG)
EclipseCon Europe 2012
Pictures: Woodland Park Zoo
© 2011 SAP AG. All rights reserved. 2
Why care at all?
Most common application scenarios:
 Reuse open-source components:
more than 80% percent of enterprises embed open source components in software /Source: SonaType/
 Eclipse ones are (typically) OSGIfied
 Apache/GitHub/GoogleCode/SourceForge/etc mostly have no OSGi packaging
 Modularize/”OSGIfy” Java EE applications
 Getting rid of proprietary module systems in favor of standard one(s). Anyone?
 Software refactoring and evolution
© 2011 SAP AG. All rights reserved. 3
General approach – That’s our starting point!
© 2011 SAP AG. All rights reserved. 4
General approach – How to eat an elephant?
Java EE monolithic app
Java EE container
Libraries in:
lib
META-INFlib
WEB-INFlib
© 2011 SAP AG. All rights reserved. 5
General approach – Peter Kriens: One piece at a time!
Java EE monolithic app
Java EE container
Libraries in:
lib
WEB-INFlib
Java Web Bundle
Shared libraries
OSGi-enabled Java EE container
© 2011 SAP AG. All rights reserved. 6
General approach – Peter Kriens: One piece at a time!
Java EE monolithic app
Java EE container
Libraries in:
lib
WEB-INFlib
Java Web Bundle
Shared libraries
OSGi-enabled Java EE container
OSGi
bundle
OSGi
bundle
OSGi
bundle
OSGi
bundle
© 2011 SAP AG. All rights reserved. 7
General approach – Peter Kriens: One piece at a time!
Java EE monolithic app
Java EE container
Libraries in:
lib
WEB-INFlib
Java Web
Bundle
Shared Libraries
OSGi-enabled Java EE container
OSGi
bundle
OSGi
bundle
OSGi
bundle
OSGi
bundle
OSGi bundle
OSGi bundle
© 2011 SAP AG. All rights reserved. 8
General approach – Peter Kriens: One piece at a time!
Java EE monolithic app
Java EE container
Libraries in:
lib
WEB-INFlib
Web Bundle
Shared Libraries
OSGi-enabled Java EE container
OSGi
bundle
OSGi
bundle
OSGi
bundle
OSGi
bundle
OSGi bundle
OSGi bundle
OSGi bundle
OSGibundle
Projects typically
stop at that
state…
© 2011 SAP AG. All rights reserved. 9
General approach – Peter Kriens: One piece at a time!
Java EE monolithic app
Java Web Bundle
OSGi
bundle
OSGibundle
OSGi bundle
OSGi
bundle
OSGi bundle
OSGi bundle
Java EE container
Libraries in:
lib
WEB-INFlib
OSGi-enabled Java EE container
OSGi
bundle
OSGi
bundle
OSGi
bundle
OSGi
bundle
Very unlikely to
reach this state!
Don’t worry!
That’s OK!
© 2011 SAP AG. All rights reserved. 10
General approach – Keep the goal in sight!
Java Web Bundle
OSGi
bundle
OSGibundle
OSGi bundle
OSGi
bundle
OSGi bundle
OSGi bundle
OSGi-enabled Java EE container
OSGi
bundle
OSGi
bundle
OSGi
bundle
OSGi
bundle
It’s not for those reasons:
 Single bundle can’t be reliably stopped!
 Single bundle can’t be reliably updated!
 Reference caching further spoils the party!
 Random startup order as a surprise for non-
aware modules.
 Reference resolution for naïve package
imports without a version might become
tricky.
© 2011 SAP AG. All rights reserved. 11
We go for OSGi - which server to run on?
Java EE 6 compatibility page (23.Oct.2012)
Java EE 6 Web
profile
Java EE 6 Full profile
© 2011 SAP AG. All rights reserved. 12
Spring
Tested scenario: Granny’s address book
Granny’s
address
book
SpringSpring (14)
slf4j
log4j
javassist
hibernate
dom4j
Guava
Tomcat jdbc
Apache juli
cglib
aopalliance
asm
antlr
Source: Original sources + packaging on GitHub
© 2011 SAP AG. All rights reserved. 13
Apache TomEE 1.0
OSGi support
 None whatsoever
 Neither uses, nor provides any
 Modularity: none – stick to Tomcat webapps
 Libs can be put in [tomeelib] folder
 No activators/resolution. Works like classpath.
Overall experience
 Feels very lightweight even with a bigger WAR file.
 TomEE doesn’t currently support web.xml <resource-ref> definitions in web.xml.
To be fixed soon.
 Doing partial application update is not supported by the server. Requires 3-rd
party tools like LiveRebel for example.
© 2011 SAP AG. All rights reserved. 14
Caucho Resin 4.0.32 free
OSGi support
 None whatsoever (but Why OSGi is cool, but not for enterprise apps blog)
 Modularity: Own “pomegranate” module system, dependencies in pom.xml
 Additional JARs can be put in [resinext-lib] folder
 No activators/resolution. Works like classpath.
Overall experience
 Easy to handle
 No default datasource is bound in JNDI. Therefore app startup fails if not created
manually.
© 2011 SAP AG. All rights reserved. 15
JBoss Application Server 7(web)
OSGi support
 JBoss own OSGI impl.
 Tutorial available over here
 Additional bundles handling
 Transform the WAR as a Web Bundle Archive (WAB) JAR.
 Add the WAB + all related bundles in standalonedeployment “auto-deploy” folder
Overall experience
 Easy to use! A bit hard to find the application web alias…
 Both web console + CLI admin deploy only single archives. No batching.
 Deployment passes successfully although bundles can’t be resolved at that time.
 Startup fails silently afterwards.
© 2011 SAP AG. All rights reserved. 16
Glassfish 3.1.2.2 (web + full)
OSGi support
 HK2 is based on Apache Felix
 Additional bundles handling
 Deploy bundles one by one via asadmin CLI tool.
Overall experience
 Deploy fails correctly on failed resolution. Have to handy-pick all dependencies
one by one.
 Web console seems to cautiously ignore OSGi :-)
© 2011 SAP AG. All rights reserved. 17
Apache Geronimo 3.0
OSGi support
 Based on Apache Felix
 Additional bundles handling
 Deployment via the Eclipse development tools
Overall experience
 Build as both Web Profile and Full Profile, but never cared to certify against the
Web Profile
© 2011 SAP AG. All rights reserved. 18
Other projects to watch out for
WebSphere Application Server V8.5 Liberty Profile
Eclipse Virgo
© 2011 SAP AG. All rights reserved. 19
You still want to take the journey?
Take a look at @glynnormington “Is OSGi modularity always worth it?”
session.
Management is very susceptive to “costs” and “ROI” arguments.
Make the cost calculations carefully and use the numbers wisely!
Thank You!krasimir.semerdzhiev@sap.com
Pictures: Woo

Weitere ähnliche Inhalte

Was ist angesagt?

Adobe Experience Manager - 6th Edition by Cedric Huesler
Adobe Experience Manager - 6th Edition by Cedric HueslerAdobe Experience Manager - 6th Edition by Cedric Huesler
Adobe Experience Manager - 6th Edition by Cedric Huesler
AEM HUB
 
Front-End Modernization for Mortals
Front-End Modernization for MortalsFront-End Modernization for Mortals
Front-End Modernization for Mortals
cgack
 

Was ist angesagt? (20)

Automatic Functional Testing with Selenium and SauceLabs
Automatic Functional Testing with Selenium and SauceLabsAutomatic Functional Testing with Selenium and SauceLabs
Automatic Functional Testing with Selenium and SauceLabs
 
Just-in-time Java EE - provisioning runtimes for enterprise applications - Ja...
Just-in-time Java EE - provisioning runtimes for enterprise applications - Ja...Just-in-time Java EE - provisioning runtimes for enterprise applications - Ja...
Just-in-time Java EE - provisioning runtimes for enterprise applications - Ja...
 
JavaCro'14 - Vaadin web application integration for Enterprise systems – Pete...
JavaCro'14 - Vaadin web application integration for Enterprise systems – Pete...JavaCro'14 - Vaadin web application integration for Enterprise systems – Pete...
JavaCro'14 - Vaadin web application integration for Enterprise systems – Pete...
 
Cross-platform Mobile Development on Open Source
Cross-platform Mobile Development on Open SourceCross-platform Mobile Development on Open Source
Cross-platform Mobile Development on Open Source
 
Adobe Experience Manager - 6th Edition by Cedric Huesler
Adobe Experience Manager - 6th Edition by Cedric HueslerAdobe Experience Manager - 6th Edition by Cedric Huesler
Adobe Experience Manager - 6th Edition by Cedric Huesler
 
Iam New And Noteworthy
Iam New And NoteworthyIam New And Noteworthy
Iam New And Noteworthy
 
CollabSphere 2018 - Java in Domino After XPages
CollabSphere 2018 - Java in Domino After XPagesCollabSphere 2018 - Java in Domino After XPages
CollabSphere 2018 - Java in Domino After XPages
 
ColdFusion builder plugins
ColdFusion builder pluginsColdFusion builder plugins
ColdFusion builder plugins
 
Securing applications
Securing applicationsSecuring applications
Securing applications
 
Require js training
Require js trainingRequire js training
Require js training
 
Microservices - java ee vs spring boot and spring cloud
Microservices - java ee vs spring boot and spring cloudMicroservices - java ee vs spring boot and spring cloud
Microservices - java ee vs spring boot and spring cloud
 
Developer Insights for Application Upgrade to ColdFusion 2016
Developer Insights for Application Upgrade to ColdFusion 2016Developer Insights for Application Upgrade to ColdFusion 2016
Developer Insights for Application Upgrade to ColdFusion 2016
 
CamelOne 2013 Karaf A-MQ Camel CXF Security
CamelOne 2013 Karaf A-MQ Camel CXF SecurityCamelOne 2013 Karaf A-MQ Camel CXF Security
CamelOne 2013 Karaf A-MQ Camel CXF Security
 
Automated ui-testing
Automated ui-testingAutomated ui-testing
Automated ui-testing
 
Front-End Modernization for Mortals
Front-End Modernization for MortalsFront-End Modernization for Mortals
Front-End Modernization for Mortals
 
Zend con 2016 bdd with behat for beginners
Zend con 2016   bdd with behat for beginnersZend con 2016   bdd with behat for beginners
Zend con 2016 bdd with behat for beginners
 
Sling Dynamic Include
Sling Dynamic IncludeSling Dynamic Include
Sling Dynamic Include
 
Selenium
SeleniumSelenium
Selenium
 
Vagrant
VagrantVagrant
Vagrant
 
ASP.NET Core 2.1: The Future of Web Apps
ASP.NET Core 2.1: The Future of Web AppsASP.NET Core 2.1: The Future of Web Apps
ASP.NET Core 2.1: The Future of Web Apps
 

Ähnlich wie OSGi in Java EE Servers - Sneak Peek Under the Hood - Krasimir Semerdzhiev

A path to modularity with Eclipse Virgo
A path to modularity with Eclipse VirgoA path to modularity with Eclipse Virgo
A path to modularity with Eclipse Virgo
katya_todorova
 
Bytecode Weaving in OSGi – Enhance Your Classes, Not Your Dependency graph! ...
Bytecode Weaving in OSGi – Enhance Your Classes, Not Your Dependency graph!  ...Bytecode Weaving in OSGi – Enhance Your Classes, Not Your Dependency graph!  ...
Bytecode Weaving in OSGi – Enhance Your Classes, Not Your Dependency graph! ...
mfrancis
 
Hints and Tips for Modularizing Existing Enterprise Applications with OSGi - ...
Hints and Tips for Modularizing Existing Enterprise Applications with OSGi - ...Hints and Tips for Modularizing Existing Enterprise Applications with OSGi - ...
Hints and Tips for Modularizing Existing Enterprise Applications with OSGi - ...
mfrancis
 
OSGi made simple - Fuse Application Bundles
OSGi made simple - Fuse Application BundlesOSGi made simple - Fuse Application Bundles
OSGi made simple - Fuse Application Bundles
Rob Davies
 
Gemini WEB and Virgo
Gemini WEB and VirgoGemini WEB and Virgo
Gemini WEB and Virgo
Hristo Iliev
 
Creating an all-purpose REST API for Cloud services using OSGi and Sling - C ...
Creating an all-purpose REST API for Cloud services using OSGi and Sling - C ...Creating an all-purpose REST API for Cloud services using OSGi and Sling - C ...
Creating an all-purpose REST API for Cloud services using OSGi and Sling - C ...
mfrancis
 

Ähnlich wie OSGi in Java EE Servers - Sneak Peek Under the Hood - Krasimir Semerdzhiev (20)

OSGI in Java EE servers:Sneak peak
OSGI in Java EE servers:Sneak peakOSGI in Java EE servers:Sneak peak
OSGI in Java EE servers:Sneak peak
 
Migration of Existing Web Applications to OSGi at Eclipse Summit Europe 2010
Migration of Existing Web Applications to OSGi at Eclipse Summit Europe 2010Migration of Existing Web Applications to OSGi at Eclipse Summit Europe 2010
Migration of Existing Web Applications to OSGi at Eclipse Summit Europe 2010
 
A path to modularity with Eclipse Virgo
A path to modularity with Eclipse VirgoA path to modularity with Eclipse Virgo
A path to modularity with Eclipse Virgo
 
Concierge - Bringing OSGi (back) to Embedded Devices
Concierge - Bringing OSGi (back) to Embedded DevicesConcierge - Bringing OSGi (back) to Embedded Devices
Concierge - Bringing OSGi (back) to Embedded Devices
 
GlassFish OSGi - Java2days 2010
GlassFish OSGi - Java2days 2010GlassFish OSGi - Java2days 2010
GlassFish OSGi - Java2days 2010
 
Modular Java EE in the Cloud
Modular Java EE in the CloudModular Java EE in the Cloud
Modular Java EE in the Cloud
 
Adapting Apache UIMA to OSGi
Adapting Apache UIMA to OSGiAdapting Apache UIMA to OSGi
Adapting Apache UIMA to OSGi
 
Building Modular Enterprise Applications - C Ziegeler
Building Modular Enterprise Applications - C ZiegelerBuilding Modular Enterprise Applications - C Ziegeler
Building Modular Enterprise Applications - C Ziegeler
 
Bytecode Weaving in OSGi – Enhance Your Classes, Not Your Dependency graph! ...
Bytecode Weaving in OSGi – Enhance Your Classes, Not Your Dependency graph!  ...Bytecode Weaving in OSGi – Enhance Your Classes, Not Your Dependency graph!  ...
Bytecode Weaving in OSGi – Enhance Your Classes, Not Your Dependency graph! ...
 
Hints and Tips for Modularizing Existing Enterprise Applications with OSGi - ...
Hints and Tips for Modularizing Existing Enterprise Applications with OSGi - ...Hints and Tips for Modularizing Existing Enterprise Applications with OSGi - ...
Hints and Tips for Modularizing Existing Enterprise Applications with OSGi - ...
 
OSGi made simple - Fuse Application Bundles
OSGi made simple - Fuse Application BundlesOSGi made simple - Fuse Application Bundles
OSGi made simple - Fuse Application Bundles
 
OSGi summary
OSGi summaryOSGi summary
OSGi summary
 
Gemini WEB and Virgo
Gemini WEB and VirgoGemini WEB and Virgo
Gemini WEB and Virgo
 
Hints and Tips for Modularizing Existing Enterprise Applications (OSGi Commun...
Hints and Tips for Modularizing Existing Enterprise Applications (OSGi Commun...Hints and Tips for Modularizing Existing Enterprise Applications (OSGi Commun...
Hints and Tips for Modularizing Existing Enterprise Applications (OSGi Commun...
 
Scaling UI5 Projects via Standardized Project & Infrastructure Setup (Ui5Con ...
Scaling UI5 Projects via Standardized Project & Infrastructure Setup (Ui5Con ...Scaling UI5 Projects via Standardized Project & Infrastructure Setup (Ui5Con ...
Scaling UI5 Projects via Standardized Project & Infrastructure Setup (Ui5Con ...
 
Creating an all-purpose REST API for Cloud services using OSGi and Sling - C ...
Creating an all-purpose REST API for Cloud services using OSGi and Sling - C ...Creating an all-purpose REST API for Cloud services using OSGi and Sling - C ...
Creating an all-purpose REST API for Cloud services using OSGi and Sling - C ...
 
Tips and tricks in the OSGi Web Console
Tips and tricks in the OSGi Web ConsoleTips and tricks in the OSGi Web Console
Tips and tricks in the OSGi Web Console
 
AEM and Sling
AEM and SlingAEM and Sling
AEM and Sling
 
AEM and Sling
AEM and SlingAEM and Sling
AEM and Sling
 
modular-ejbs-for-enterprise-osgi developers
modular-ejbs-for-enterprise-osgi developersmodular-ejbs-for-enterprise-osgi developers
modular-ejbs-for-enterprise-osgi developers
 

Mehr von mfrancis

Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...
Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...
Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...
mfrancis
 
How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...
How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...
How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...
mfrancis
 
Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...
Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...
Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...
mfrancis
 
Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...
Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...
Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...
mfrancis
 

Mehr von mfrancis (20)

Eclipse Modeling Framework and plain OSGi the easy way - Mark Hoffman (Data I...
Eclipse Modeling Framework and plain OSGi the easy way - Mark Hoffman (Data I...Eclipse Modeling Framework and plain OSGi the easy way - Mark Hoffman (Data I...
Eclipse Modeling Framework and plain OSGi the easy way - Mark Hoffman (Data I...
 
OSGi and Java 9+ - BJ Hargrave (IBM)
OSGi and Java 9+ - BJ Hargrave (IBM)OSGi and Java 9+ - BJ Hargrave (IBM)
OSGi and Java 9+ - BJ Hargrave (IBM)
 
Simplify Web UX Coding using OSGi Modularity Magic - Paul Fraser (A2Z Living)
Simplify Web UX Coding using OSGi Modularity Magic - Paul Fraser (A2Z Living)Simplify Web UX Coding using OSGi Modularity Magic - Paul Fraser (A2Z Living)
Simplify Web UX Coding using OSGi Modularity Magic - Paul Fraser (A2Z Living)
 
OSGi for the data centre - Connecting OSGi to Kubernetes - Frank Lyaruu
OSGi for the data centre - Connecting OSGi to Kubernetes - Frank LyaruuOSGi for the data centre - Connecting OSGi to Kubernetes - Frank Lyaruu
OSGi for the data centre - Connecting OSGi to Kubernetes - Frank Lyaruu
 
Remote Management and Monitoring of Distributed OSGi Applications - Tim Verbe...
Remote Management and Monitoring of Distributed OSGi Applications - Tim Verbe...Remote Management and Monitoring of Distributed OSGi Applications - Tim Verbe...
Remote Management and Monitoring of Distributed OSGi Applications - Tim Verbe...
 
OSGi with Docker - a powerful way to develop Java systems - Udo Hafermann (So...
OSGi with Docker - a powerful way to develop Java systems - Udo Hafermann (So...OSGi with Docker - a powerful way to develop Java systems - Udo Hafermann (So...
OSGi with Docker - a powerful way to develop Java systems - Udo Hafermann (So...
 
A real world use case with OSGi R7 - Jurgen Albert (Data In Motion Consulting...
A real world use case with OSGi R7 - Jurgen Albert (Data In Motion Consulting...A real world use case with OSGi R7 - Jurgen Albert (Data In Motion Consulting...
A real world use case with OSGi R7 - Jurgen Albert (Data In Motion Consulting...
 
OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)
OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)
OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)
 
Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...
Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...
Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...
 
OSGi CDI Integration Specification - Ray Augé (Liferay)
OSGi CDI Integration Specification - Ray Augé (Liferay)OSGi CDI Integration Specification - Ray Augé (Liferay)
OSGi CDI Integration Specification - Ray Augé (Liferay)
 
How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...
How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...
How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...
 
Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...
Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...
Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...
 
It Was Twenty Years Ago Today - Building an OSGi based Smart Home System - Ch...
It Was Twenty Years Ago Today - Building an OSGi based Smart Home System - Ch...It Was Twenty Years Ago Today - Building an OSGi based Smart Home System - Ch...
It Was Twenty Years Ago Today - Building an OSGi based Smart Home System - Ch...
 
Popular patterns revisited on OSGi - Christian Schneider (Adobe)
Popular patterns revisited on OSGi - Christian Schneider (Adobe)Popular patterns revisited on OSGi - Christian Schneider (Adobe)
Popular patterns revisited on OSGi - Christian Schneider (Adobe)
 
Integrating SLF4J and the new OSGi LogService 1.4 - BJ Hargrave (IBM)
Integrating SLF4J and the new OSGi LogService 1.4 - BJ Hargrave (IBM)Integrating SLF4J and the new OSGi LogService 1.4 - BJ Hargrave (IBM)
Integrating SLF4J and the new OSGi LogService 1.4 - BJ Hargrave (IBM)
 
OSG(a)i: because AI needs a runtime - Tim Verbelen (imec)
OSG(a)i: because AI needs a runtime - Tim Verbelen (imec)OSG(a)i: because AI needs a runtime - Tim Verbelen (imec)
OSG(a)i: because AI needs a runtime - Tim Verbelen (imec)
 
Flying to Jupiter with OSGi - Tony Walsh (ESA) & Hristo Indzhov (Telespazio V...
Flying to Jupiter with OSGi - Tony Walsh (ESA) & Hristo Indzhov (Telespazio V...Flying to Jupiter with OSGi - Tony Walsh (ESA) & Hristo Indzhov (Telespazio V...
Flying to Jupiter with OSGi - Tony Walsh (ESA) & Hristo Indzhov (Telespazio V...
 
MicroProfile, OSGi was meant for this - Ray Auge (Liferay)
MicroProfile, OSGi was meant for this - Ray Auge (Liferay)MicroProfile, OSGi was meant for this - Ray Auge (Liferay)
MicroProfile, OSGi was meant for this - Ray Auge (Liferay)
 
Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...
Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...
Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...
 
How to connect your OSGi application - Dirk Fauth (Bosch)
How to connect your OSGi application - Dirk Fauth (Bosch)How to connect your OSGi application - Dirk Fauth (Bosch)
How to connect your OSGi application - Dirk Fauth (Bosch)
 

Kürzlich hochgeladen

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Kürzlich hochgeladen (20)

Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
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
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
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
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
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
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
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
 
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, ...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
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
 
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
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 

OSGi in Java EE Servers - Sneak Peek Under the Hood - Krasimir Semerdzhiev

  • 1. OSGi in Java EE servers: sneak peek inside Krasimir Semerdzhiev (SAP AG) EclipseCon Europe 2012 Pictures: Woodland Park Zoo
  • 2. © 2011 SAP AG. All rights reserved. 2 Why care at all? Most common application scenarios:  Reuse open-source components: more than 80% percent of enterprises embed open source components in software /Source: SonaType/  Eclipse ones are (typically) OSGIfied  Apache/GitHub/GoogleCode/SourceForge/etc mostly have no OSGi packaging  Modularize/”OSGIfy” Java EE applications  Getting rid of proprietary module systems in favor of standard one(s). Anyone?  Software refactoring and evolution
  • 3. © 2011 SAP AG. All rights reserved. 3 General approach – That’s our starting point!
  • 4. © 2011 SAP AG. All rights reserved. 4 General approach – How to eat an elephant? Java EE monolithic app Java EE container Libraries in: lib META-INFlib WEB-INFlib
  • 5. © 2011 SAP AG. All rights reserved. 5 General approach – Peter Kriens: One piece at a time! Java EE monolithic app Java EE container Libraries in: lib WEB-INFlib Java Web Bundle Shared libraries OSGi-enabled Java EE container
  • 6. © 2011 SAP AG. All rights reserved. 6 General approach – Peter Kriens: One piece at a time! Java EE monolithic app Java EE container Libraries in: lib WEB-INFlib Java Web Bundle Shared libraries OSGi-enabled Java EE container OSGi bundle OSGi bundle OSGi bundle OSGi bundle
  • 7. © 2011 SAP AG. All rights reserved. 7 General approach – Peter Kriens: One piece at a time! Java EE monolithic app Java EE container Libraries in: lib WEB-INFlib Java Web Bundle Shared Libraries OSGi-enabled Java EE container OSGi bundle OSGi bundle OSGi bundle OSGi bundle OSGi bundle OSGi bundle
  • 8. © 2011 SAP AG. All rights reserved. 8 General approach – Peter Kriens: One piece at a time! Java EE monolithic app Java EE container Libraries in: lib WEB-INFlib Web Bundle Shared Libraries OSGi-enabled Java EE container OSGi bundle OSGi bundle OSGi bundle OSGi bundle OSGi bundle OSGi bundle OSGi bundle OSGibundle Projects typically stop at that state…
  • 9. © 2011 SAP AG. All rights reserved. 9 General approach – Peter Kriens: One piece at a time! Java EE monolithic app Java Web Bundle OSGi bundle OSGibundle OSGi bundle OSGi bundle OSGi bundle OSGi bundle Java EE container Libraries in: lib WEB-INFlib OSGi-enabled Java EE container OSGi bundle OSGi bundle OSGi bundle OSGi bundle Very unlikely to reach this state! Don’t worry! That’s OK!
  • 10. © 2011 SAP AG. All rights reserved. 10 General approach – Keep the goal in sight! Java Web Bundle OSGi bundle OSGibundle OSGi bundle OSGi bundle OSGi bundle OSGi bundle OSGi-enabled Java EE container OSGi bundle OSGi bundle OSGi bundle OSGi bundle It’s not for those reasons:  Single bundle can’t be reliably stopped!  Single bundle can’t be reliably updated!  Reference caching further spoils the party!  Random startup order as a surprise for non- aware modules.  Reference resolution for naïve package imports without a version might become tricky.
  • 11. © 2011 SAP AG. All rights reserved. 11 We go for OSGi - which server to run on? Java EE 6 compatibility page (23.Oct.2012) Java EE 6 Web profile Java EE 6 Full profile
  • 12. © 2011 SAP AG. All rights reserved. 12 Spring Tested scenario: Granny’s address book Granny’s address book SpringSpring (14) slf4j log4j javassist hibernate dom4j Guava Tomcat jdbc Apache juli cglib aopalliance asm antlr Source: Original sources + packaging on GitHub
  • 13. © 2011 SAP AG. All rights reserved. 13 Apache TomEE 1.0 OSGi support  None whatsoever  Neither uses, nor provides any  Modularity: none – stick to Tomcat webapps  Libs can be put in [tomeelib] folder  No activators/resolution. Works like classpath. Overall experience  Feels very lightweight even with a bigger WAR file.  TomEE doesn’t currently support web.xml <resource-ref> definitions in web.xml. To be fixed soon.  Doing partial application update is not supported by the server. Requires 3-rd party tools like LiveRebel for example.
  • 14. © 2011 SAP AG. All rights reserved. 14 Caucho Resin 4.0.32 free OSGi support  None whatsoever (but Why OSGi is cool, but not for enterprise apps blog)  Modularity: Own “pomegranate” module system, dependencies in pom.xml  Additional JARs can be put in [resinext-lib] folder  No activators/resolution. Works like classpath. Overall experience  Easy to handle  No default datasource is bound in JNDI. Therefore app startup fails if not created manually.
  • 15. © 2011 SAP AG. All rights reserved. 15 JBoss Application Server 7(web) OSGi support  JBoss own OSGI impl.  Tutorial available over here  Additional bundles handling  Transform the WAR as a Web Bundle Archive (WAB) JAR.  Add the WAB + all related bundles in standalonedeployment “auto-deploy” folder Overall experience  Easy to use! A bit hard to find the application web alias…  Both web console + CLI admin deploy only single archives. No batching.  Deployment passes successfully although bundles can’t be resolved at that time.  Startup fails silently afterwards.
  • 16. © 2011 SAP AG. All rights reserved. 16 Glassfish 3.1.2.2 (web + full) OSGi support  HK2 is based on Apache Felix  Additional bundles handling  Deploy bundles one by one via asadmin CLI tool. Overall experience  Deploy fails correctly on failed resolution. Have to handy-pick all dependencies one by one.  Web console seems to cautiously ignore OSGi :-)
  • 17. © 2011 SAP AG. All rights reserved. 17 Apache Geronimo 3.0 OSGi support  Based on Apache Felix  Additional bundles handling  Deployment via the Eclipse development tools Overall experience  Build as both Web Profile and Full Profile, but never cared to certify against the Web Profile
  • 18. © 2011 SAP AG. All rights reserved. 18 Other projects to watch out for WebSphere Application Server V8.5 Liberty Profile Eclipse Virgo
  • 19. © 2011 SAP AG. All rights reserved. 19 You still want to take the journey? Take a look at @glynnormington “Is OSGi modularity always worth it?” session. Management is very susceptive to “costs” and “ROI” arguments. Make the cost calculations carefully and use the numbers wisely!