SlideShare ist ein Scribd-Unternehmen logo
1 von 39
Downloaden Sie, um offline zu lesen
S314613:
OSGI Migration
headaches




Krasimir Semerdzhiev
SAP Labs Bulgaria
Development Architect


Peter Peshev
SAP Labs Bulgaria
Development Architect
Agenda




OSGI intro
Headaches
Painkiller options
Q&A
Modularity
Alternative implementations




                              VW Golf
                               91-97
Good architecture and interchangeable



       minilang      party        pos.           product          workeffort     workflow         …

      accounting   assetmaint    content            bi              ebay        ecommerce     googlebase

       guiapp      hhfacility   manufact.       marketing          minerva        oagis          order


                                             Application layer

       common       catalina      base           datafile           entity        widget          …


       resolver      rome       serializer       servlets          tomcat          xalan          bsf

         mail        mx4j        naming            jetty             poi          wsdl4j          bsh

        jenks       jpos18       jython           looks            lucene         xerces        velocity

       jakarta         jcl        json            jdbm              jdom          xmlapis     ws-commons

        log4j      barcode4j      axis             batik          commons         xmlrpc       geronimo

       httpunit    freemarker   ezmorph            fop              derby       xmlgraphics    Libs..

                                                 Java VM

          rt          jce         jsse            plugin         sunjce_prov.     dnsns            ..
Problem: CLASSPATH



         Java VM         party      common       resolver     axis        xerces

Begin       rt

            jce
                      assetmaint

                       hhfacility
                                     catalina

                                      base
                                                   mail

                                                  jenks
                                                             ezmorph

                                                             servlets
                                                                          xmlapis

                                                                          xmlrpc
Here       jsse          pos.        datafile     jakarta     jetty     xmlgraphics

          plugin       content        entity      log4j       looks
        sunjce_prov   manufact.      widget      httpunit     jdbm
             .
          dnsns        product          …          mx4j        bsf

             ..           bi          rome        batik        bsh       Class
         marketing     workflow      jpos18        fop        velocity

        workeffort    ecommerce        jcl        tomcat    ws-commons
                                                                          Not
           ebay          oagis      barcode4j      poi       geronimo   Found
         minerva          …         freemarker    lucene         ..
                                                                       Exception
         minilang     googlebase    serializer    jdom        json
        accounting       order       naming      commons      xalan

          guiapp         ofbiz        jython      derby      wsdl4j
The OSGi Alliance




    Started March 1999 as an initiative from ERICSSON, SUN and IBM
    Today: A stable Alliance with almost 100 members
    Now practically all of the Java Server vendors are represented there
    A standardization body…
OSGi Framework Layers




 Staircase
    Applications can make use
     of different layers directly
    Module Layer defines
     packaging , deployment
     dependancies among
     modules
    Lifecycle Layer controls
     lifecycyle operations of a
     bundle
Module Layer: Bundles



Bundles
 Are   JAR files

 Contain   classes, other resources like HTML, images, specific metadata

 Contain
        manifest file (META-INF/MANIFEST.MF) with OSGI specific
 headers used to manage the bundle
   Describes the content of the JAR file
   Export  Import package
   Require-Bundle
Module Layer: Runtime class loading


load class com.foo.classA
Class Loading Architecture: Class Space
Class Loading Architecture: Delegation



Basic properties
 Parent delegation
 Wire importers and exporters
 There can be fragment bundles
 Class loading traversal based on importers and their wires
Lifecycle Layer


Runtime representation of bundles
 Forevery bundle, the framework creates a Bundle java object
 Bundles are identified by Bundle ID, Bundle Symbolic Name and
  Bundle Location
 Bundle has a runtime state:
What is the story?


                                               Web          Web Module   bundle
                   Web Module
  Web Modules                                 Modules         (war)
                     (war)                                               bundle

                                                      Web Modules        bundle
         Web Modules
                                                            State 2
                                                                         bundle
 Lib   Lib   Lib   Lib EAR file
                         EAR file                                 OSGi framework

        Java EE compliant runtime
                                    bundle   bundle      bundle

                                    bundle   bundle      bundle

                                    bundle   bundle      bundle

                                    bundle   bundle      bundle

                                    bundle   bundle      bundle
                                             OSGi framework
What do we aim to get from OSGi?


■   Standardized execution environment
■   Java-based modularization
■   Well defined module contract
■   Strict dependency management at build and run time
■   Manifest as a single point of truth
■   Deterministic declarative runtime resolution




or in other words…

■ Evolve from JARs/modules to “interchangeable/reusable parts”
Agenda




OSGI intro
Headaches
Painkiller options
Q&A
Step 1: Choose an OSGi runtime
Step 2: How to create bundles?


Manifest-Version: 1.0
Bundle-Name: My First Bundle
Bundle-SymbolicName: com.acme.myfirstbundle
Bundle-Version: 1.0.0
Bundle-Description: Small Bundle
Bundle-Vendor: ACME
Bundle-Activator: com.acme.myfirstbundle.impl.Activator
Bundle-Category: example
Import-Package: org.osgi.framework
Export-Package: com.acme.myfirstbundle.api



    Export-Package ::= export(‘,’ export)*
      export ::= package-names(‘;’ parameter)*
      package-names ::= package-name(‘;’ package-name)*
    Import-Package ::= import(‘,’ import)*
      import ::= package-names(‘;’ parameter)*
      package-names ::= package-name(‘;’ package-name)*
    Require-Bundle ::= bundle-description ( ',' bundle-description )*
      bundle-description ::= symbolic-name (';' parameter )*
Step 2: How to create bundles?


Let‘s take one example – Apache Derby
org.apache.derby.*
     authentication            iapi.services.timer              impl.jdbc.authentication         impl.store.access.sort
     catalog                   iapi.services.uuid               impl.load                        impl.store.raw
     catalog.types             iapi.sql                         impl.services                    impl.store.raw.data
     database                  iapi.sql.compile                 impl.services.bytecode           impl.store.raw.log
     diag                      iapi.sql.conn                    impl.services.cache              impl.store.raw.xact
     iapi                      iapi.sql.depend                  impl.services.daemon             impl.store.replication
     iapi.db                   iapi.sql.dictionary              impl.services.jce                impl.store.replication.buffer
     iapi.error                iapi.sql.execute                 impl.services.jmx                impl.store.replication.master
     iapi.jdbc                 iapi.store                       impl.services.jmxnone            impl.store.replication.net
     iapi.security             iapi.store.access                impl.services.locks              impl.store.replication.slave
     iapi.services             iapi.store.access.conglomerate   impl.services.monitor            impl.tools
     iapi.services.cache       iapi.store.access.xa             impl.services.reflect            impl.tools.sysinfo
     iapi.services.classfile   iapi.store.raw                   impl.services.stream             info
     iapi.services.compiler    iapi.store.raw.data              impl.services.timer              io
     iapi.services.context     iapi.store.raw.log               impl.services.uuid               jdbc
     iapi.services.crypto      iapi.store.raw.xact              impl.sql                         loc
     iapi.services.daemon      iapi.store.replication           impl.sql.catalog                 mbeans
     iapi.services.diag        iapi.store.replication.master    impl.sql.compile                 osgi
     iapi.services.i18n        iapi.store.replication.slave     impl.sql.conn                    security
     iapi.services.info        iapi.tools                       impl.sql.depend                  shared
     iapi.services.io          iapi.tools.i18n                  impl.sql.execute                 shared.common
     iapi.services.jmx         iapi.types                       impl.sql.execute.rts             shared.common.error
     iapi.services.loader      iapi.util                        impl.store                       shared.common.sanity
     iapi.services.locks       impl                             impl.store.access                tools
     iapi.services.memory      impl.db                          impl.store.access.btree          vti
     iapi.services.monitor     impl.io                          impl.store.access.btree.index
     iapi.services.property    impl.io.vfmem                    impl.store.access.conglomerate
     iapi.services.stream      impl.jdbc                        impl.store.access.heap
Step 2: How to create bundles?


Apache Derby – impl.* gone
org.apache.derby.*
     authentication            iapi.services.timer              osgi
     catalog                   iapi.services.uuid               security
     catalog.types             iapi.sql                         shared
     database                  iapi.sql.compile                 shared.common
     diag                      iapi.sql.conn                    shared.common.error
     iapi                      iapi.sql.depend                  shared.common.sanity
     iapi.db                   iapi.sql.dictionary              tools
     iapi.error                iapi.sql.execute                 vti
     iapi.jdbc                 iapi.store
     iapi.security             iapi.store.access
     iapi.services             iapi.store.access.conglomerate
     iapi.services.cache       iapi.store.access.xa
     iapi.services.classfile   iapi.store.raw
     iapi.services.compiler    iapi.store.raw.data
     iapi.services.context     iapi.store.raw.log
     iapi.services.crypto      iapi.store.raw.xact
     iapi.services.daemon      iapi.store.replication
     iapi.services.diag        iapi.store.replication.master
     iapi.services.i18n        iapi.store.replication.slave
     iapi.services.info        iapi.tools
     iapi.services.io          iapi.tools.i18n
     iapi.services.jmx         iapi.types
     iapi.services.loader      iapi.util
     iapi.services.locks       info
     iapi.services.memory      io
     iapi.services.monitor     jdbc
     iapi.services.property    loc
     iapi.services.stream      mbeans
Step 2: How to create bundles?


Apache Derby – what Eclipse uses out of it :-)
org.apache.derby.*
     authentication
     database
     io
     jdbc
     vti                             How to create manifests?
                                      By hand
                                      BND tool
                                      Apache Felix Maven plugin
                                      Eclipse PDE
                                      Bundlor




or in other words…

■ Don’t rush to define manifests, for modules you know nothing of!
Step 3: Let‘s try to activate the bundle.



java.lang.NoClassDefFoundException                                Class definition is
                                                                          missing!


                                 The forName() method in class Class.
Possible causes?                 The findSystemClass method() in class ClassLoader.
                                 The loadClass() method in class ClassLoader
 Missing import-package
 Missing export-package
 Import version mismatch       [1.2.3, 2.0); “1.2.3”
 Forgotten/missing component (really missing!)
 Wrong boot class delegation property
 Missing file system permissions (can’t read the JARs)
Step 3: Separate a the first library as a bundle



java.lang.NoClassDefFoundError                                 Class definition is
                                                                     found, but
                                                             instantiation failed!


Possible causes?
 Exception in static block
 Missing imported class (NoClassDefFoundException for it)
 Class version mismatch
 Hotspot reflection JIT optimizations (BugID 6265952 )
         (injection of sun.misc.Unsafe.defineClass)




 or in other words…

 ■Don’t rush blaming the framework! Classloading there is quite solid!
Step 4: Iterative refactoring



My bundle is not updated?!



Possible causes?
 Didyou update the version?
 You’re replacing your bundle directly in the equinox plugins folder
 Package-imports do not fit to the new bundle version?




 or in other words…

 ■Don’t rush blaming the framework! ;)
Step 4: Iterative refactoring



java.lang.ClassCastError



Possible causes?
 Additionalcopies (besides the system bundle) of the
  OSGi framework classes
 Undesired additional JARs in classpath
■ Clash between RT.jar and application libs
 (previously used embedded jars)
■ Java SE 5 vs. Java SE 6 does make a difference…
 (a bunch of new packages added (StAX, JDBC 4.0, JAXB 2.0, etc.)




 or in other words…

 ■Make sure you understand the root cause. (try using Eclipse Memory Analyzer)
Step 4: Iterative refactoring



Works in Eclipse, but doesn‘t work in Equinox


Possible issues
■ Different setting of org.osgi.parentClassloader
    ■   app           (default for Eclipse)
    ■   boot
    ■   ext
    ■   fwk
 Certain expectations of org.osgi.framework.system.packages
 Different values of org.osgi.framework.bootdelegation
■ property osgi.compatibility.bootdelegation (default for Eclipse is false)

 or in other words…

 ■Don’t be fooled by configuration differences
Step 4: Design flaws



Dependencies on startup order



Possible causes?
■ Avoid lookup-error-fail patterns
■ As a last resort – you can use start levels
■ Keep Activators really lean.
■ Typically seen when extracting code from a web module with fixed
  Servlet.init() order.




or in other words…

■Don’t do anything needless in your activator. That’s not init()/start()!
Step 4: Design flaws



Classloader resource assumptions



Possible issues
■ JAR files
■ Folder containing class files/packages
■ URLs (to any of the above)
■ new File(<resource>), after loader resources iteration
  “bundle:xxx” as a resource




 or in other words…

 ■Don’t make assumptions on the classloader resources!
Step 4: Design flaws



Boot delegation specifics



■ org.osgi.framework.bootdelegation – shortcut the OSGi resolution
■ Adding com.foo.* includes all sub-packages, but not the com.foo
  package itself.
■ osgi.compatibility.bootdelegation - true/false




or in other words…

■Make sure that you understand the setup of your OSGi environment
Step 5: Design flaws



SPI pattern limitations


Possible issues
■ Load a class, described in some meta-data file, used via interface
    ■ META-INF/services/javax.xml.ws.spi.Provider
■ Explicit import of the impl packages is required!
Step 5: Design flaws



My process exits unexpectedly?!


Possible issues
■ Lots of code is written with the assumption that it owns the world and not
  that it lives in a small corner of it.
■ Enabling a Security Manager which traces System.exit() and Runtime.halt()
  calls might help
Step 5: Design flaws



Registering objects in the VM has direct impact on the
ability to stop a bundle

                                                             Some of those
                                                                    have no
Possible issues                                          unregister methods!

■ System in and out streams
■ Shutdown hooks
■ MBean server factory
■ Log4J formatters
■ JNDI provider/factory



or in other words…

■Don’t try to do the job of the underlying middleware.
Step 5: Design flaws



ContextClassLoader usage




Possible issues
■ Some code written to run in a web app might make some assumptions on
  the Context classloader.
■ One example here is JNDI.




or in other words…

■Consider environment dependencies when extracting code into bundles
Agenda




OSGI intro
Headaches
Painkiller options
Q&A
Eclipse Virgo shell improvements



Supportability commands
■ Nested OSGi frameworks
■ Classloading
SpringSource Tool Suite
Other relevant sessions


Tue 12:00 PM   Developing OSGi-Enabled Java EE Applications
Tue 6:00 PM    Patterns for modularity
Tue 6:00 PM    OSGI BOF
Tue 9:00 PM    OSGi at a Large-Scale Enterprise: Lessons from eBay


Wed 10:00 AM   Java EE OSGi applications : Design and Deployment for On-Premises and Cloud
Wed 1:00 PM    OSGi and JSR 294: Module Keyword
Wed 4:45 PM    Visualizing the Science of Conversation with JavaFX and OSGi to Save Lives


Thu 3:30 PM    Creating Modular Applications with Apache Aries and OSGi
Thu 3:30 PM    Developing Rich Modular Clients with Java, JavaFX and OSGi Technology
Q&A?
Thank you!


 Krasimir Semerdzhiev
krasimir.semerdzhiev@sap.com

      Peter Peshev
   peter.peshev@sap.com

Weitere ähnliche Inhalte

Was ist angesagt?

OSGi-enabled Java EE Applications using GlassFish
OSGi-enabled Java EE Applications using GlassFishOSGi-enabled Java EE Applications using GlassFish
OSGi-enabled Java EE Applications using GlassFishArun Gupta
 
What's new in Java EE 6
What's new in Java EE 6What's new in Java EE 6
What's new in Java EE 6Gal Marder
 
5장. Execution Engine
5장. Execution Engine5장. Execution Engine
5장. Execution Engine김 한도
 
2008 Sccc Inheritance
2008 Sccc Inheritance2008 Sccc Inheritance
2008 Sccc Inheritancebergel
 
Create *real* modular Java applications - a brief introduction -
Create *real* modular Java applications - a brief introduction -Create *real* modular Java applications - a brief introduction -
Create *real* modular Java applications - a brief introduction -Jeffrey Groneberg
 
6장 Thread Synchronization
6장 Thread Synchronization6장 Thread Synchronization
6장 Thread Synchronization김 한도
 
OSGi-enabled Java EE Applications using GlassFish at JCertif 2011
OSGi-enabled Java EE Applications using GlassFish at JCertif 2011OSGi-enabled Java EE Applications using GlassFish at JCertif 2011
OSGi-enabled Java EE Applications using GlassFish at JCertif 2011Arun Gupta
 
2장. Runtime Data Areas
2장. Runtime Data Areas2장. Runtime Data Areas
2장. Runtime Data Areas김 한도
 
Running your Java EE applications in the Cloud
Running your Java EE applications in the CloudRunning your Java EE applications in the Cloud
Running your Java EE applications in the CloudArun Gupta
 
1장 Java란 무엇인가.key
1장 Java란 무엇인가.key1장 Java란 무엇인가.key
1장 Java란 무엇인가.key김 한도
 
A JCR View of the World - adaptTo() 2012 Berlin
A JCR View of the World - adaptTo() 2012 BerlinA JCR View of the World - adaptTo() 2012 Berlin
A JCR View of the World - adaptTo() 2012 BerlinAlexander Klimetschek
 
Building Content Applications with JCR and OSGi
Building Content Applications with JCR and OSGiBuilding Content Applications with JCR and OSGi
Building Content Applications with JCR and OSGiCédric Hüsler
 
3장. Garbage Collection
3장. Garbage Collection3장. Garbage Collection
3장. Garbage Collection김 한도
 
Open Source Compiler Construction for the JVM
Open Source Compiler Construction for the JVMOpen Source Compiler Construction for the JVM
Open Source Compiler Construction for the JVMTom Lee
 
Using Java from Ruby with JRuby IRB
Using Java from Ruby with JRuby IRBUsing Java from Ruby with JRuby IRB
Using Java from Ruby with JRuby IRBHiro Asari
 
JRuby in Java Projects
JRuby in Java ProjectsJRuby in Java Projects
JRuby in Java Projectsjazzman1980
 

Was ist angesagt? (19)

Ruby on rails
Ruby on railsRuby on rails
Ruby on rails
 
Whats New In Java Ee 6
Whats New In Java Ee 6Whats New In Java Ee 6
Whats New In Java Ee 6
 
What's new in JSR-283?
What's new in JSR-283?What's new in JSR-283?
What's new in JSR-283?
 
OSGi-enabled Java EE Applications using GlassFish
OSGi-enabled Java EE Applications using GlassFishOSGi-enabled Java EE Applications using GlassFish
OSGi-enabled Java EE Applications using GlassFish
 
What's new in Java EE 6
What's new in Java EE 6What's new in Java EE 6
What's new in Java EE 6
 
5장. Execution Engine
5장. Execution Engine5장. Execution Engine
5장. Execution Engine
 
2008 Sccc Inheritance
2008 Sccc Inheritance2008 Sccc Inheritance
2008 Sccc Inheritance
 
Create *real* modular Java applications - a brief introduction -
Create *real* modular Java applications - a brief introduction -Create *real* modular Java applications - a brief introduction -
Create *real* modular Java applications - a brief introduction -
 
6장 Thread Synchronization
6장 Thread Synchronization6장 Thread Synchronization
6장 Thread Synchronization
 
OSGi-enabled Java EE Applications using GlassFish at JCertif 2011
OSGi-enabled Java EE Applications using GlassFish at JCertif 2011OSGi-enabled Java EE Applications using GlassFish at JCertif 2011
OSGi-enabled Java EE Applications using GlassFish at JCertif 2011
 
2장. Runtime Data Areas
2장. Runtime Data Areas2장. Runtime Data Areas
2장. Runtime Data Areas
 
Running your Java EE applications in the Cloud
Running your Java EE applications in the CloudRunning your Java EE applications in the Cloud
Running your Java EE applications in the Cloud
 
1장 Java란 무엇인가.key
1장 Java란 무엇인가.key1장 Java란 무엇인가.key
1장 Java란 무엇인가.key
 
A JCR View of the World - adaptTo() 2012 Berlin
A JCR View of the World - adaptTo() 2012 BerlinA JCR View of the World - adaptTo() 2012 Berlin
A JCR View of the World - adaptTo() 2012 Berlin
 
Building Content Applications with JCR and OSGi
Building Content Applications with JCR and OSGiBuilding Content Applications with JCR and OSGi
Building Content Applications with JCR and OSGi
 
3장. Garbage Collection
3장. Garbage Collection3장. Garbage Collection
3장. Garbage Collection
 
Open Source Compiler Construction for the JVM
Open Source Compiler Construction for the JVMOpen Source Compiler Construction for the JVM
Open Source Compiler Construction for the JVM
 
Using Java from Ruby with JRuby IRB
Using Java from Ruby with JRuby IRBUsing Java from Ruby with JRuby IRB
Using Java from Ruby with JRuby IRB
 
JRuby in Java Projects
JRuby in Java ProjectsJRuby in Java Projects
JRuby in Java Projects
 

Ähnlich wie JavaOne 2010: OSGI Migrat

OSGi Best Practices - Tim Ward
OSGi Best Practices - Tim WardOSGi Best Practices - Tim Ward
OSGi Best Practices - Tim Wardmfrancis
 
Introduction to Apache Camel
Introduction to Apache CamelIntroduction to Apache Camel
Introduction to Apache CamelFuseSource.com
 
JBoss AS 7, la révolution
JBoss AS 7, la révolutionJBoss AS 7, la révolution
JBoss AS 7, la révolutionAlexis Hassler
 
The Java Content Repository
The Java Content RepositoryThe Java Content Repository
The Java Content Repositorynobby
 
soft-shake.ch - JBoss AS 7, la révolution
soft-shake.ch - JBoss AS 7, la révolutionsoft-shake.ch - JBoss AS 7, la révolution
soft-shake.ch - JBoss AS 7, la révolutionsoft-shake.ch
 
TorqueBox at DC:JBUG - November 2011
TorqueBox at DC:JBUG - November 2011TorqueBox at DC:JBUG - November 2011
TorqueBox at DC:JBUG - November 2011bobmcwhirter
 
Scotas - Oracle Open World Sao Pablo
Scotas - Oracle Open World Sao PabloScotas - Oracle Open World Sao Pablo
Scotas - Oracle Open World Sao PabloJulian Arocena
 
OSGi DevCon US 2010 Review
OSGi DevCon US 2010 ReviewOSGi DevCon US 2010 Review
OSGi DevCon US 2010 Reviewmfrancis
 
Chisimba - introduction to practical demo
Chisimba - introduction to practical demoChisimba - introduction to practical demo
Chisimba - introduction to practical demoDerek Keats
 
TDC 2011: OSGi-enabled Java EE Application
TDC 2011: OSGi-enabled Java EE ApplicationTDC 2011: OSGi-enabled Java EE Application
TDC 2011: OSGi-enabled Java EE ApplicationArun Gupta
 
Monoliths are so 2001 – What you need is Modularity
Monoliths are so 2001 – What you need is ModularityMonoliths are so 2001 – What you need is Modularity
Monoliths are so 2001 – What you need is ModularityGraham Charters
 
Java EE 6 workshop at Dallas Tech Fest 2011
Java EE 6 workshop at Dallas Tech Fest 2011Java EE 6 workshop at Dallas Tech Fest 2011
Java EE 6 workshop at Dallas Tech Fest 2011Arun Gupta
 
Enterprise Java Web Application Frameworks Sample Stack Implementation
Enterprise Java Web Application Frameworks   Sample Stack ImplementationEnterprise Java Web Application Frameworks   Sample Stack Implementation
Enterprise Java Web Application Frameworks Sample Stack ImplementationMert Çalışkan
 
Zotonic presentation Erlang Camp Boston, august 2011
Zotonic presentation Erlang Camp Boston, august 2011Zotonic presentation Erlang Camp Boston, august 2011
Zotonic presentation Erlang Camp Boston, august 2011Arjan
 
When Two Worlds Collide: Java and Ruby in the Enterprise
When Two Worlds Collide: Java and Ruby in the EnterpriseWhen Two Worlds Collide: Java and Ruby in the Enterprise
When Two Worlds Collide: Java and Ruby in the Enterprisebenbrowning
 
Visual COBOL Development for Unix and Java
Visual COBOL Development for Unix and JavaVisual COBOL Development for Unix and Java
Visual COBOL Development for Unix and JavaMicro Focus
 
Haj 4344-java se 9 and the application server-1
Haj 4344-java se 9 and the application server-1Haj 4344-java se 9 and the application server-1
Haj 4344-java se 9 and the application server-1Kevin Sutter
 

Ähnlich wie JavaOne 2010: OSGI Migrat (20)

OSGi Best Practices - Tim Ward
OSGi Best Practices - Tim WardOSGi Best Practices - Tim Ward
OSGi Best Practices - Tim Ward
 
Introduction to Apache Camel
Introduction to Apache CamelIntroduction to Apache Camel
Introduction to Apache Camel
 
JBoss AS 7, la révolution
JBoss AS 7, la révolutionJBoss AS 7, la révolution
JBoss AS 7, la révolution
 
The Java Content Repository
The Java Content RepositoryThe Java Content Repository
The Java Content Repository
 
soft-shake.ch - JBoss AS 7, la révolution
soft-shake.ch - JBoss AS 7, la révolutionsoft-shake.ch - JBoss AS 7, la révolution
soft-shake.ch - JBoss AS 7, la révolution
 
Jvm fundamentals
Jvm fundamentalsJvm fundamentals
Jvm fundamentals
 
TorqueBox at DC:JBUG - November 2011
TorqueBox at DC:JBUG - November 2011TorqueBox at DC:JBUG - November 2011
TorqueBox at DC:JBUG - November 2011
 
Scotas - Oracle Open World Sao Pablo
Scotas - Oracle Open World Sao PabloScotas - Oracle Open World Sao Pablo
Scotas - Oracle Open World Sao Pablo
 
OSGi DevCon US 2010 Review
OSGi DevCon US 2010 ReviewOSGi DevCon US 2010 Review
OSGi DevCon US 2010 Review
 
Chisimba - introduction to practical demo
Chisimba - introduction to practical demoChisimba - introduction to practical demo
Chisimba - introduction to practical demo
 
TDC 2011: OSGi-enabled Java EE Application
TDC 2011: OSGi-enabled Java EE ApplicationTDC 2011: OSGi-enabled Java EE Application
TDC 2011: OSGi-enabled Java EE Application
 
Monoliths are so 2001 – What you need is Modularity
Monoliths are so 2001 – What you need is ModularityMonoliths are so 2001 – What you need is Modularity
Monoliths are so 2001 – What you need is Modularity
 
Java EE 6 workshop at Dallas Tech Fest 2011
Java EE 6 workshop at Dallas Tech Fest 2011Java EE 6 workshop at Dallas Tech Fest 2011
Java EE 6 workshop at Dallas Tech Fest 2011
 
Enterprise Java Web Application Frameworks Sample Stack Implementation
Enterprise Java Web Application Frameworks   Sample Stack ImplementationEnterprise Java Web Application Frameworks   Sample Stack Implementation
Enterprise Java Web Application Frameworks Sample Stack Implementation
 
Zotonic presentation Erlang Camp Boston, august 2011
Zotonic presentation Erlang Camp Boston, august 2011Zotonic presentation Erlang Camp Boston, august 2011
Zotonic presentation Erlang Camp Boston, august 2011
 
When Two Worlds Collide: Java and Ruby in the Enterprise
When Two Worlds Collide: Java and Ruby in the EnterpriseWhen Two Worlds Collide: Java and Ruby in the Enterprise
When Two Worlds Collide: Java and Ruby in the Enterprise
 
Introducing JSR-283
Introducing JSR-283Introducing JSR-283
Introducing JSR-283
 
Understanding the Dalvik Virtual Machine
Understanding the Dalvik Virtual MachineUnderstanding the Dalvik Virtual Machine
Understanding the Dalvik Virtual Machine
 
Visual COBOL Development for Unix and Java
Visual COBOL Development for Unix and JavaVisual COBOL Development for Unix and Java
Visual COBOL Development for Unix and Java
 
Haj 4344-java se 9 and the application server-1
Haj 4344-java se 9 and the application server-1Haj 4344-java se 9 and the application server-1
Haj 4344-java se 9 and the application server-1
 

Mehr von SAP HANA Cloud Platform

SAP Hack2Build hackathon - SAP Commerce Cloud & Kyma runtime
SAP Hack2Build hackathon - SAP Commerce Cloud & Kyma runtimeSAP Hack2Build hackathon - SAP Commerce Cloud & Kyma runtime
SAP Hack2Build hackathon - SAP Commerce Cloud & Kyma runtimeSAP HANA Cloud Platform
 
Gardener: Managed Kubernetes on Your Terms
Gardener: Managed Kubernetes on Your TermsGardener: Managed Kubernetes on Your Terms
Gardener: Managed Kubernetes on Your TermsSAP HANA Cloud Platform
 
Kyma: Extending Business systems with Kubernetes, Istio and <fill the blank>.
Kyma: Extending Business systems with Kubernetes, Istio and <fill the blank>.Kyma: Extending Business systems with Kubernetes, Istio and <fill the blank>.
Kyma: Extending Business systems with Kubernetes, Istio and <fill the blank>.SAP HANA Cloud Platform
 
Using Kubernetes to Extend Enterprise Software
Using Kubernetes to Extend Enterprise Software Using Kubernetes to Extend Enterprise Software
Using Kubernetes to Extend Enterprise Software SAP HANA Cloud Platform
 
Kubernetes, Istio and Knative - noteworthy practical experience
Kubernetes, Istio and Knative - noteworthy practical experienceKubernetes, Istio and Knative - noteworthy practical experience
Kubernetes, Istio and Knative - noteworthy practical experienceSAP HANA Cloud Platform
 
Options for running Kubernetes at scale across multiple cloud providers
Options for running Kubernetes at scale across multiple cloud providersOptions for running Kubernetes at scale across multiple cloud providers
Options for running Kubernetes at scale across multiple cloud providersSAP HANA Cloud Platform
 
SAP DKOM 2016 | 30154 | SAP HCP Cloud Extensions Intro
SAP DKOM 2016 | 30154 | SAP HCP Cloud Extensions IntroSAP DKOM 2016 | 30154 | SAP HCP Cloud Extensions Intro
SAP DKOM 2016 | 30154 | SAP HCP Cloud Extensions IntroSAP HANA Cloud Platform
 
SAP TechEd 2015 | DEV109 | Extending Cloud Solutions from SAP using SAP HANA ...
SAP TechEd 2015 | DEV109 | Extending Cloud Solutions from SAP using SAP HANA ...SAP TechEd 2015 | DEV109 | Extending Cloud Solutions from SAP using SAP HANA ...
SAP TechEd 2015 | DEV109 | Extending Cloud Solutions from SAP using SAP HANA ...SAP HANA Cloud Platform
 
SAP D-Code/TechEd 2014|DEV203|Extending SuccessFactors using SAP HANA Cloud P...
SAP D-Code/TechEd 2014|DEV203|Extending SuccessFactors using SAP HANA Cloud P...SAP D-Code/TechEd 2014|DEV203|Extending SuccessFactors using SAP HANA Cloud P...
SAP D-Code/TechEd 2014|DEV203|Extending SuccessFactors using SAP HANA Cloud P...SAP HANA Cloud Platform
 
SAP TechEd 2013: CD105: Extending SuccessFactors EmployeeCentral with apps on...
SAP TechEd 2013: CD105: Extending SuccessFactors EmployeeCentral with apps on...SAP TechEd 2013: CD105: Extending SuccessFactors EmployeeCentral with apps on...
SAP TechEd 2013: CD105: Extending SuccessFactors EmployeeCentral with apps on...SAP HANA Cloud Platform
 
SAP HANA Cloud Platform Community BOF @ Devoxx 2013
SAP HANA Cloud Platform Community BOF @ Devoxx 2013SAP HANA Cloud Platform Community BOF @ Devoxx 2013
SAP HANA Cloud Platform Community BOF @ Devoxx 2013SAP HANA Cloud Platform
 
SAP HANA Cloud Platform: The void between your Datacenter and the Cloud
SAP HANA Cloud Platform: The void between your Datacenter and the CloudSAP HANA Cloud Platform: The void between your Datacenter and the Cloud
SAP HANA Cloud Platform: The void between your Datacenter and the CloudSAP HANA Cloud Platform
 
SAP HANA Cloud: From Your Datacenter to the Cloud and Back
SAP HANA Cloud: From Your Datacenter to the Cloud and Back  SAP HANA Cloud: From Your Datacenter to the Cloud and Back
SAP HANA Cloud: From Your Datacenter to the Cloud and Back SAP HANA Cloud Platform
 

Mehr von SAP HANA Cloud Platform (17)

SAP Hack2Build hackathon - SAP Commerce Cloud & Kyma runtime
SAP Hack2Build hackathon - SAP Commerce Cloud & Kyma runtimeSAP Hack2Build hackathon - SAP Commerce Cloud & Kyma runtime
SAP Hack2Build hackathon - SAP Commerce Cloud & Kyma runtime
 
Gardener: Managed Kubernetes on Your Terms
Gardener: Managed Kubernetes on Your TermsGardener: Managed Kubernetes on Your Terms
Gardener: Managed Kubernetes on Your Terms
 
Kyma: Extending Business systems with Kubernetes, Istio and <fill the blank>.
Kyma: Extending Business systems with Kubernetes, Istio and <fill the blank>.Kyma: Extending Business systems with Kubernetes, Istio and <fill the blank>.
Kyma: Extending Business systems with Kubernetes, Istio and <fill the blank>.
 
Using Kubernetes to Extend Enterprise Software
Using Kubernetes to Extend Enterprise Software Using Kubernetes to Extend Enterprise Software
Using Kubernetes to Extend Enterprise Software
 
Kubernetes, Istio and Knative - noteworthy practical experience
Kubernetes, Istio and Knative - noteworthy practical experienceKubernetes, Istio and Knative - noteworthy practical experience
Kubernetes, Istio and Knative - noteworthy practical experience
 
Options for running Kubernetes at scale across multiple cloud providers
Options for running Kubernetes at scale across multiple cloud providersOptions for running Kubernetes at scale across multiple cloud providers
Options for running Kubernetes at scale across multiple cloud providers
 
SAP DKOM 2016 | 30154 | SAP HCP Cloud Extensions Intro
SAP DKOM 2016 | 30154 | SAP HCP Cloud Extensions IntroSAP DKOM 2016 | 30154 | SAP HCP Cloud Extensions Intro
SAP DKOM 2016 | 30154 | SAP HCP Cloud Extensions Intro
 
SAP TechEd 2015 | DEV109 | Extending Cloud Solutions from SAP using SAP HANA ...
SAP TechEd 2015 | DEV109 | Extending Cloud Solutions from SAP using SAP HANA ...SAP TechEd 2015 | DEV109 | Extending Cloud Solutions from SAP using SAP HANA ...
SAP TechEd 2015 | DEV109 | Extending Cloud Solutions from SAP using SAP HANA ...
 
SAP D-Code/TechEd 2014|DEV203|Extending SuccessFactors using SAP HANA Cloud P...
SAP D-Code/TechEd 2014|DEV203|Extending SuccessFactors using SAP HANA Cloud P...SAP D-Code/TechEd 2014|DEV203|Extending SuccessFactors using SAP HANA Cloud P...
SAP D-Code/TechEd 2014|DEV203|Extending SuccessFactors using SAP HANA Cloud P...
 
SAP TechEd 2013: CD105: Extending SuccessFactors EmployeeCentral with apps on...
SAP TechEd 2013: CD105: Extending SuccessFactors EmployeeCentral with apps on...SAP TechEd 2013: CD105: Extending SuccessFactors EmployeeCentral with apps on...
SAP TechEd 2013: CD105: Extending SuccessFactors EmployeeCentral with apps on...
 
SAP HANA Cloud Platform Community BOF @ Devoxx 2013
SAP HANA Cloud Platform Community BOF @ Devoxx 2013SAP HANA Cloud Platform Community BOF @ Devoxx 2013
SAP HANA Cloud Platform Community BOF @ Devoxx 2013
 
SAP HANA Cloud Platform: The void between your Datacenter and the Cloud
SAP HANA Cloud Platform: The void between your Datacenter and the CloudSAP HANA Cloud Platform: The void between your Datacenter and the Cloud
SAP HANA Cloud Platform: The void between your Datacenter and the Cloud
 
SAP HANA Cloud: From Your Datacenter to the Cloud and Back
SAP HANA Cloud: From Your Datacenter to the Cloud and Back  SAP HANA Cloud: From Your Datacenter to the Cloud and Back
SAP HANA Cloud: From Your Datacenter to the Cloud and Back
 
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
 
[BGOUG] Memory analyzer
[BGOUG] Memory analyzer[BGOUG] Memory analyzer
[BGOUG] Memory analyzer
 
[BGOUG] Java GC - Friend or Foe
[BGOUG] Java GC - Friend or Foe[BGOUG] Java GC - Friend or Foe
[BGOUG] Java GC - Friend or Foe
 
Eclipse Open Source @ SAP
Eclipse Open Source @ SAPEclipse Open Source @ SAP
Eclipse Open Source @ SAP
 

Kürzlich hochgeladen

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdfChristopherTHyatt
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
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 WorkerThousandEyes
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 

Kürzlich hochgeladen (20)

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
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
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 

JavaOne 2010: OSGI Migrat

  • 1. S314613: OSGI Migration headaches Krasimir Semerdzhiev SAP Labs Bulgaria Development Architect Peter Peshev SAP Labs Bulgaria Development Architect
  • 5. Good architecture and interchangeable minilang party pos. product workeffort workflow … accounting assetmaint content bi ebay ecommerce googlebase guiapp hhfacility manufact. marketing minerva oagis order Application layer common catalina base datafile entity widget … resolver rome serializer servlets tomcat xalan bsf mail mx4j naming jetty poi wsdl4j bsh jenks jpos18 jython looks lucene xerces velocity jakarta jcl json jdbm jdom xmlapis ws-commons log4j barcode4j axis batik commons xmlrpc geronimo httpunit freemarker ezmorph fop derby xmlgraphics Libs.. Java VM rt jce jsse plugin sunjce_prov. dnsns ..
  • 6. Problem: CLASSPATH Java VM party common resolver axis xerces Begin rt jce assetmaint hhfacility catalina base mail jenks ezmorph servlets xmlapis xmlrpc Here jsse pos. datafile jakarta jetty xmlgraphics plugin content entity log4j looks sunjce_prov manufact. widget httpunit jdbm . dnsns product … mx4j bsf .. bi rome batik bsh Class marketing workflow jpos18 fop velocity workeffort ecommerce jcl tomcat ws-commons Not ebay oagis barcode4j poi geronimo Found minerva … freemarker lucene .. Exception minilang googlebase serializer jdom json accounting order naming commons xalan guiapp ofbiz jython derby wsdl4j
  • 7. The OSGi Alliance  Started March 1999 as an initiative from ERICSSON, SUN and IBM  Today: A stable Alliance with almost 100 members  Now practically all of the Java Server vendors are represented there  A standardization body…
  • 8. OSGi Framework Layers Staircase  Applications can make use of different layers directly  Module Layer defines packaging , deployment dependancies among modules  Lifecycle Layer controls lifecycyle operations of a bundle
  • 9. Module Layer: Bundles Bundles  Are JAR files  Contain classes, other resources like HTML, images, specific metadata  Contain manifest file (META-INF/MANIFEST.MF) with OSGI specific headers used to manage the bundle  Describes the content of the JAR file  Export Import package  Require-Bundle
  • 10. Module Layer: Runtime class loading load class com.foo.classA
  • 12. Class Loading Architecture: Delegation Basic properties  Parent delegation  Wire importers and exporters  There can be fragment bundles  Class loading traversal based on importers and their wires
  • 13. Lifecycle Layer Runtime representation of bundles  Forevery bundle, the framework creates a Bundle java object  Bundles are identified by Bundle ID, Bundle Symbolic Name and Bundle Location  Bundle has a runtime state:
  • 14. What is the story? Web Web Module bundle Web Module Web Modules Modules (war) (war) bundle Web Modules bundle Web Modules State 2 bundle Lib Lib Lib Lib EAR file EAR file OSGi framework Java EE compliant runtime bundle bundle bundle bundle bundle bundle bundle bundle bundle bundle bundle bundle bundle bundle bundle OSGi framework
  • 15. What do we aim to get from OSGi? ■ Standardized execution environment ■ Java-based modularization ■ Well defined module contract ■ Strict dependency management at build and run time ■ Manifest as a single point of truth ■ Deterministic declarative runtime resolution or in other words… ■ Evolve from JARs/modules to “interchangeable/reusable parts”
  • 17. Step 1: Choose an OSGi runtime
  • 18. Step 2: How to create bundles? Manifest-Version: 1.0 Bundle-Name: My First Bundle Bundle-SymbolicName: com.acme.myfirstbundle Bundle-Version: 1.0.0 Bundle-Description: Small Bundle Bundle-Vendor: ACME Bundle-Activator: com.acme.myfirstbundle.impl.Activator Bundle-Category: example Import-Package: org.osgi.framework Export-Package: com.acme.myfirstbundle.api Export-Package ::= export(‘,’ export)* export ::= package-names(‘;’ parameter)* package-names ::= package-name(‘;’ package-name)* Import-Package ::= import(‘,’ import)* import ::= package-names(‘;’ parameter)* package-names ::= package-name(‘;’ package-name)* Require-Bundle ::= bundle-description ( ',' bundle-description )* bundle-description ::= symbolic-name (';' parameter )*
  • 19. Step 2: How to create bundles? Let‘s take one example – Apache Derby org.apache.derby.* authentication iapi.services.timer impl.jdbc.authentication impl.store.access.sort catalog iapi.services.uuid impl.load impl.store.raw catalog.types iapi.sql impl.services impl.store.raw.data database iapi.sql.compile impl.services.bytecode impl.store.raw.log diag iapi.sql.conn impl.services.cache impl.store.raw.xact iapi iapi.sql.depend impl.services.daemon impl.store.replication iapi.db iapi.sql.dictionary impl.services.jce impl.store.replication.buffer iapi.error iapi.sql.execute impl.services.jmx impl.store.replication.master iapi.jdbc iapi.store impl.services.jmxnone impl.store.replication.net iapi.security iapi.store.access impl.services.locks impl.store.replication.slave iapi.services iapi.store.access.conglomerate impl.services.monitor impl.tools iapi.services.cache iapi.store.access.xa impl.services.reflect impl.tools.sysinfo iapi.services.classfile iapi.store.raw impl.services.stream info iapi.services.compiler iapi.store.raw.data impl.services.timer io iapi.services.context iapi.store.raw.log impl.services.uuid jdbc iapi.services.crypto iapi.store.raw.xact impl.sql loc iapi.services.daemon iapi.store.replication impl.sql.catalog mbeans iapi.services.diag iapi.store.replication.master impl.sql.compile osgi iapi.services.i18n iapi.store.replication.slave impl.sql.conn security iapi.services.info iapi.tools impl.sql.depend shared iapi.services.io iapi.tools.i18n impl.sql.execute shared.common iapi.services.jmx iapi.types impl.sql.execute.rts shared.common.error iapi.services.loader iapi.util impl.store shared.common.sanity iapi.services.locks impl impl.store.access tools iapi.services.memory impl.db impl.store.access.btree vti iapi.services.monitor impl.io impl.store.access.btree.index iapi.services.property impl.io.vfmem impl.store.access.conglomerate iapi.services.stream impl.jdbc impl.store.access.heap
  • 20. Step 2: How to create bundles? Apache Derby – impl.* gone org.apache.derby.* authentication iapi.services.timer osgi catalog iapi.services.uuid security catalog.types iapi.sql shared database iapi.sql.compile shared.common diag iapi.sql.conn shared.common.error iapi iapi.sql.depend shared.common.sanity iapi.db iapi.sql.dictionary tools iapi.error iapi.sql.execute vti iapi.jdbc iapi.store iapi.security iapi.store.access iapi.services iapi.store.access.conglomerate iapi.services.cache iapi.store.access.xa iapi.services.classfile iapi.store.raw iapi.services.compiler iapi.store.raw.data iapi.services.context iapi.store.raw.log iapi.services.crypto iapi.store.raw.xact iapi.services.daemon iapi.store.replication iapi.services.diag iapi.store.replication.master iapi.services.i18n iapi.store.replication.slave iapi.services.info iapi.tools iapi.services.io iapi.tools.i18n iapi.services.jmx iapi.types iapi.services.loader iapi.util iapi.services.locks info iapi.services.memory io iapi.services.monitor jdbc iapi.services.property loc iapi.services.stream mbeans
  • 21. Step 2: How to create bundles? Apache Derby – what Eclipse uses out of it :-) org.apache.derby.* authentication database io jdbc vti How to create manifests?  By hand  BND tool  Apache Felix Maven plugin  Eclipse PDE  Bundlor or in other words… ■ Don’t rush to define manifests, for modules you know nothing of!
  • 22. Step 3: Let‘s try to activate the bundle. java.lang.NoClassDefFoundException Class definition is missing! The forName() method in class Class. Possible causes? The findSystemClass method() in class ClassLoader. The loadClass() method in class ClassLoader  Missing import-package  Missing export-package  Import version mismatch [1.2.3, 2.0); “1.2.3”  Forgotten/missing component (really missing!)  Wrong boot class delegation property  Missing file system permissions (can’t read the JARs)
  • 23. Step 3: Separate a the first library as a bundle java.lang.NoClassDefFoundError Class definition is found, but instantiation failed! Possible causes?  Exception in static block  Missing imported class (NoClassDefFoundException for it)  Class version mismatch  Hotspot reflection JIT optimizations (BugID 6265952 ) (injection of sun.misc.Unsafe.defineClass) or in other words… ■Don’t rush blaming the framework! Classloading there is quite solid!
  • 24. Step 4: Iterative refactoring My bundle is not updated?! Possible causes?  Didyou update the version?  You’re replacing your bundle directly in the equinox plugins folder  Package-imports do not fit to the new bundle version? or in other words… ■Don’t rush blaming the framework! ;)
  • 25. Step 4: Iterative refactoring java.lang.ClassCastError Possible causes?  Additionalcopies (besides the system bundle) of the OSGi framework classes  Undesired additional JARs in classpath ■ Clash between RT.jar and application libs (previously used embedded jars) ■ Java SE 5 vs. Java SE 6 does make a difference… (a bunch of new packages added (StAX, JDBC 4.0, JAXB 2.0, etc.) or in other words… ■Make sure you understand the root cause. (try using Eclipse Memory Analyzer)
  • 26. Step 4: Iterative refactoring Works in Eclipse, but doesn‘t work in Equinox Possible issues ■ Different setting of org.osgi.parentClassloader ■ app (default for Eclipse) ■ boot ■ ext ■ fwk  Certain expectations of org.osgi.framework.system.packages  Different values of org.osgi.framework.bootdelegation ■ property osgi.compatibility.bootdelegation (default for Eclipse is false) or in other words… ■Don’t be fooled by configuration differences
  • 27. Step 4: Design flaws Dependencies on startup order Possible causes? ■ Avoid lookup-error-fail patterns ■ As a last resort – you can use start levels ■ Keep Activators really lean. ■ Typically seen when extracting code from a web module with fixed Servlet.init() order. or in other words… ■Don’t do anything needless in your activator. That’s not init()/start()!
  • 28. Step 4: Design flaws Classloader resource assumptions Possible issues ■ JAR files ■ Folder containing class files/packages ■ URLs (to any of the above) ■ new File(<resource>), after loader resources iteration “bundle:xxx” as a resource or in other words… ■Don’t make assumptions on the classloader resources!
  • 29. Step 4: Design flaws Boot delegation specifics ■ org.osgi.framework.bootdelegation – shortcut the OSGi resolution ■ Adding com.foo.* includes all sub-packages, but not the com.foo package itself. ■ osgi.compatibility.bootdelegation - true/false or in other words… ■Make sure that you understand the setup of your OSGi environment
  • 30. Step 5: Design flaws SPI pattern limitations Possible issues ■ Load a class, described in some meta-data file, used via interface ■ META-INF/services/javax.xml.ws.spi.Provider ■ Explicit import of the impl packages is required!
  • 31. Step 5: Design flaws My process exits unexpectedly?! Possible issues ■ Lots of code is written with the assumption that it owns the world and not that it lives in a small corner of it. ■ Enabling a Security Manager which traces System.exit() and Runtime.halt() calls might help
  • 32. Step 5: Design flaws Registering objects in the VM has direct impact on the ability to stop a bundle Some of those have no Possible issues unregister methods! ■ System in and out streams ■ Shutdown hooks ■ MBean server factory ■ Log4J formatters ■ JNDI provider/factory or in other words… ■Don’t try to do the job of the underlying middleware.
  • 33. Step 5: Design flaws ContextClassLoader usage Possible issues ■ Some code written to run in a web app might make some assumptions on the Context classloader. ■ One example here is JNDI. or in other words… ■Consider environment dependencies when extracting code into bundles
  • 35. Eclipse Virgo shell improvements Supportability commands ■ Nested OSGi frameworks ■ Classloading
  • 37. Other relevant sessions Tue 12:00 PM Developing OSGi-Enabled Java EE Applications Tue 6:00 PM Patterns for modularity Tue 6:00 PM OSGI BOF Tue 9:00 PM OSGi at a Large-Scale Enterprise: Lessons from eBay Wed 10:00 AM Java EE OSGi applications : Design and Deployment for On-Premises and Cloud Wed 1:00 PM OSGi and JSR 294: Module Keyword Wed 4:45 PM Visualizing the Science of Conversation with JavaFX and OSGi to Save Lives Thu 3:30 PM Creating Modular Applications with Apache Aries and OSGi Thu 3:30 PM Developing Rich Modular Clients with Java, JavaFX and OSGi Technology
  • 38. Q&A?
  • 39. Thank you! Krasimir Semerdzhiev krasimir.semerdzhiev@sap.com Peter Peshev peter.peshev@sap.com