Uploaded image for project: 'Directory Client API'
  1. Directory Client API
  2. DIRAPI-273

api-ldap-net-mina bundle remains in STARTING mode

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.0.0-M33
    • Fix Version/s: 1.0.0-RC1
    • Labels:
    • Environment:
      Linux; Felix

      Description

      After deploying the api-ldap-net-mina bundle in an OSGI environment (in my case the Felix container) the bundle remains in STARTING mode til an explicit stop and start via a gogo shell command or via Felix webconsole. I've found that removing Bundle-ActivationPolicy: lazy in the MANIFEST.MF resolves this issues. From what I've investigated is not a good pratice to use Bundle-ActivationPolicy at least in a Felix environment (I know that is more common in Equinox). It's possibile to remove this without affecting other OSGI platforms.

      What I can say is that it does not work OOB with this directive.

        Activity

        Hide
        elecharny Emmanuel Lecharny added a comment -

        Stefan has solved the issue weeks ago

        Show
        elecharny Emmanuel Lecharny added a comment - Stefan has solved the issue weeks ago
        Hide
        elecharny Emmanuel Lecharny added a comment -

        Thinking about the problem after a good night of sleep, all of this makes a lot of sense. If we have a default starting for this plugin, it's perfectly logical that it remains in started mode in Felix. I also see how it's bizarre to start it automatically in Eclipse, except that it's convenient from a user POV.

        Starting the plugin explicitly, as Stefan did, seems quite reasonable.

        Thanks Stefan for the fix !

        Show
        elecharny Emmanuel Lecharny added a comment - Thinking about the problem after a good night of sleep, all of this makes a lot of sense. If we have a default starting for this plugin, it's perfectly logical that it remains in started mode in Felix. I also see how it's bizarre to start it automatically in Eclipse, except that it's convenient from a user POV. Starting the plugin explicitly, as Stefan did, seems quite reasonable. Thanks Stefan for the fix !
        Hide
        ivoleitao Ivo Leitão added a comment - - edited

        Ok. Thanks a lot for the links and the explanation, quite frankly I'm just starting in the OSGI world a lot of this stuff is quite new to me

        Show
        ivoleitao Ivo Leitão added a comment - - edited Ok. Thanks a lot for the links and the explanation, quite frankly I'm just starting in the OSGI world a lot of this stuff is quite new to me
        Hide
        seelmann Stefan Seelmann added a comment - - edited

        Eclipse/Equinox doesn't start any bundle automatically. Only if "Bundle-ActivationPolicy: lazy" (or the older "Eclipse-LazyStart: true") is declared Equinox starts them at all, and then also only if some class of that bundle is loaded. Without the "Bundle-ActivationPolicy: lazy" we need to start the bundles ourselves, either programatically or within .product file or config.ini. But the latter would only work for the RCP application, not when installing the Studio plugins within an existing Eclipse. So the programatically start of the bundles is the way to go.

        Two useful links that show that Eclipse behaves different than other OSGi envs::

        Show
        seelmann Stefan Seelmann added a comment - - edited Eclipse/Equinox doesn't start any bundle automatically. Only if "Bundle-ActivationPolicy: lazy" (or the older "Eclipse-LazyStart: true") is declared Equinox starts them at all, and then also only if some class of that bundle is loaded. Without the "Bundle-ActivationPolicy: lazy" we need to start the bundles ourselves, either programatically or within .product file or config.ini. But the latter would only work for the RCP application, not when installing the Studio plugins within an existing Eclipse. So the programatically start of the bundles is the way to go. Two useful links that show that Eclipse behaves different than other OSGi envs:: https://wiki.eclipse.org/Lazy_Start_Bundles https://stackoverflow.com/questions/17590464/lazy-activation-of-eclipse-plugins/17592449#17592449
        Hide
        ivoleitao Ivo Leitão added a comment -

        I find this quite puzzling also. I lingered with this problem at least one day before finding a post somewhere in the net saying that removing the Lazy directive could solve the problem and fortunately it did (it was related with other bundle). I even change the loading order of the bundles a couple of times before giving up and tried to find alternate solutions. Unfortunately with that directive it doesn't work in felix at least, i don't know about other osgi frameworks

        Show
        ivoleitao Ivo Leitão added a comment - I find this quite puzzling also. I lingered with this problem at least one day before finding a post somewhere in the net saying that removing the Lazy directive could solve the problem and fortunately it did (it was related with other bundle). I even change the loading order of the bundles a couple of times before giving up and tried to find alternate solutions. Unfortunately with that directive it doesn't work in felix at least, i don't know about other osgi frameworks
        Hide
        elecharny Emmanuel Lecharny added a comment -

        What I don't get is why the codec you explicitly start in the patch aren't actually started automatically... Are we missing something ?

        Show
        elecharny Emmanuel Lecharny added a comment - What I don't get is why the codec you explicitly start in the patch aren't actually started automatically... Are we missing something ?
        Hide
        seelmann Stefan Seelmann added a comment -

        I think I found a workaround see commit http://svn.apache.org/viewvc?rev=1733998&view=rev

        Show
        seelmann Stefan Seelmann added a comment - I think I found a workaround see commit http://svn.apache.org/viewvc?rev=1733998&view=rev
        Hide
        elecharny Emmanuel Lecharny added a comment -

        Yes, it was my fear. Pierre-Arnaud fight quite a long time with this issue. It seems that Eclipse forces your to use such an activator to speed-up the load of plugins at startup, as far as I understand, favoring the late load.

        Howaver, I think we can probably find a way to workaround this issue.

        Show
        elecharny Emmanuel Lecharny added a comment - Yes, it was my fear. Pierre-Arnaud fight quite a long time with this issue. It seems that Eclipse forces your to use such an activator to speed-up the load of plugins at startup, as far as I understand, favoring the late load. Howaver, I think we can probably find a way to workaround this issue.
        Hide
        seelmann Stefan Seelmann added a comment -

        Hm, unfortunately the LDAP API now doesn't work anymore in Studio. But I think there must be a way to fix it without the lazy ActivationPolicy.

        Show
        seelmann Stefan Seelmann added a comment - Hm, unfortunately the LDAP API now doesn't work anymore in Studio. But I think there must be a way to fix it without the lazy ActivationPolicy.
        Hide
        elecharny Emmanuel Lecharny added a comment -

        Seems to work...

        I'll remove the 'lazy' activators

        Show
        elecharny Emmanuel Lecharny added a comment - Seems to work... I'll remove the 'lazy' activators
        Hide
        elecharny Emmanuel Lecharny added a comment -

        I wonder if the 'lazy' activator directive hasn't be added for Eclipse (specifically Studio). I'll try to remove it to see if it works. Note that it's also used in the api-ldap-codec-core bundle.

        Show
        elecharny Emmanuel Lecharny added a comment - I wonder if the 'lazy' activator directive hasn't be added for Eclipse (specifically Studio). I'll try to remove it to see if it works. Note that it's also used in the api-ldap-codec-core bundle.
        Hide
        ivoleitao Ivo Leitão added a comment -

        I don't know if it helps or not but bellow you can find the list of bundles that I'm currently hosting in my felix environment

        The bundle that was giving me problems is:

        36|Active | 1|Apache Directory LDAP API Network MINA (1.0.0.M33)|1.0.0.M33

        The complete list of bundles that I have in my system (excluding my own bundles, only external dependencies listed):

        ID|State |Level|Name
        0|Active | 0|System Bundle (5.4.0)|5.4.0
        1|Active | 1|javax.annotation API (1.2.0)|1.2.0
        2|Active | 1|Bean Validation API (1.1.0.Final)|1.1.0.Final
        3|Active | 1|Apache ServiceMix :: Specs :: JSR-339 API 2.0 (2.4.0)|2.4.0
        4|Active | 1|Guava: Google Core Libraries for Java (18.0.0)|18.0.0
        5|Active | 1|Commons Lang (2.6.0)|2.6.0
        6|Active | 1|Apache Commons Collections (3.2.2)|3.2.2
        7|Active | 1|Commons IO (2.4.0)|2.4.0
        8|Active | 1|Apache Commons FileUpload (1.3.1)|1.3.1
        9|Active | 1|Commons Pool (1.6.0)|1.6.0
        10|Active | 1|slf4j-api (1.7.16)|1.7.16
        11|Active | 1|log4j-over-slf4j (1.7.16)|1.7.16
        12|Active | 1|jcl-over-slf4j (1.7.16)|1.7.16
        13|Active | 1|OSGi LogService implemented over SLF4J (1.7.16)|1.7.16
        14|Active | 1|Apache Sling SLF4J Implementation (Logback) (4.0.6)|4.0.6
        15|Active | 1|Apache Sling OSGi LogService Implementation (1.0.6)|1.0.6
        16|Active | 1|ASM all classes with debug info (5.0.2)|5.0.2
        17|Active | 1|JSON in Java (1.0.0.v20140107)|1.0.0.v20140107
        18|Active | 1|Jackson-core (2.7.1)|2.7.1
        19|Active | 1|jackson-databind (2.7.1)|2.7.1
        20|Active | 1|Jackson-annotations (2.7.1)|2.7.1
        21|Active | 1|Jackson-JAXRS-base (2.7.1)|2.7.1
        22|Active | 1|Jackson-JAXRS-JSON (2.7.1)|2.7.1
        23|Active | 1|Groovy Runtime (2.4.5)|2.4.5
        24|Active | 1|Apache ServiceMix :: Bundles :: antlr (2.7.7.5)|2.7.7.5
        25|Active | 1|Apache Directory LDAP API Client API (1.0.0.M33)|1.0.0.M33
        26|Active | 1|Apache Directory LDAP API Utilities (1.0.0.M33)|1.0.0.M33
        27|Active | 1|Apache Directory LDAP API Model (1.0.0.M33)|1.0.0.M33
        28|Active | 1|Apache Directory LDAP API Extras ACI (1.0.0.M33)|1.0.0.M33
        29|Active | 1|Apache Directory LDAP API Codec Core (1.0.0.M33)|1.0.0.M33
        30|Active | 1|Apache Directory LDAP API Extras Codec API (1.0.0.M33)|1.0.0.M33
        31|Active | 1|Apache Directory LDAP API Extras Codec (1.0.0.M33)|1.0.0.M33
        32|Active | 1|Apache Directory LDAP API Schema Data (1.0.0.M33)|1.0.0.M33
        33|Active | 1|Apache Directory LDAP API I18n (1.0.0.M33)|1.0.0.M33
        34|Active | 1|Apache Directory API ASN.1 API (1.0.0.M33)|1.0.0.M33
        35|Active | 1|Apache Directory API ASN.1 BER (1.0.0.M33)|1.0.0.M33
        36|Active | 1|Apache Directory LDAP API Network MINA (1.0.0.M33)|1.0.0.M33
        37|Active | 1|Apache MINA Core (2.0.10)|2.0.10
        38|Active | 1|Jetty :: Continuation (9.2.14.v20151106)|9.2.14.v20151106
        39|Active | 1|Apache Felix Metatype Service (1.1.2)|1.1.2
        40|Active | 1|Apache Felix Declarative Services (2.0.2)|2.0.2
        41|Active | 1|Apache Felix Inventory (1.0.4)|1.0.4
        42|Active | 1|Apache Felix Gogo Shell (0.12.0)|0.12.0
        43|Active | 1|Apache Felix Remote Shell (1.1.2)|1.1.2
        44|Active | 1|Apache Felix Gogo Runtime (0.16.2)|0.16.2
        45|Active | 1|Apache Felix Gogo Command (0.16.0)|0.16.0
        46|Active | 1|Apache Felix EventAdmin (1.4.4)|1.4.4
        47|Active | 1|Apache Felix Configuration Admin Service (1.8.8)|1.8.8
        48|Active | 1|Apache Felix File Install (3.5.0)|3.5.0
        49|Active | 1|Apache Felix Servlet API (1.1.2)|1.1.2
        50|Active | 1|Apache Felix Http API (3.0.0)|3.0.0
        51|Active | 1|Apache Felix Http Base (3.0.6)|3.0.6
        52|Active | 1|Apache Felix Http Whiteboard (3.0.0)|3.0.0
        53|Active | 1|Apache Felix Http Jetty (3.1.6)|3.1.6
        54|Active | 1|Apache Felix Web Management Console (4.2.14)|4.2.14
        55|Active | 1|Apache Felix Web Console Package Admin Service Plugin (1.0.2)|1.0.2
        56|Active | 1|Apache Felix Web Console Event Plugin (1.1.4)|1.1.4
        57|Active | 1|Apache Felix Web Console OBR Plugin (1.0.2)|1.0.2
        58|Active | 1|Apache Felix Script Console Plugin (1.0.2)|1.0.2
        59|Active | 1|Apache Felix Web Console Memory Usage Plugin (1.0.6)|1.0.6
        60|Active | 1|Stax2 API (3.1.4)|3.1.4
        61|Active | 1|Woodstox XML-processor (4.4.1)|4.4.1
        62|Active | 1|Apache ServiceMix :: Bundles :: wsdl4j (1.6.3.1)|1.6.3.1
        63|Active | 1|XmlSchema Core (2.2.1)|2.2.1
        64|Active | 1|Apache Aries Util (1.0.0)|1.0.0
        65|Active | 1|Apache Aries Proxy API (1.0.1)|1.0.1
        66|Active | 1|Apache Aries Blueprint API (1.0.1)|1.0.1
        67|Active | 1|Apache Aries Blueprint Core (1.4.2)|1.4.2
        68|Active | 1|Apache CXF Core (3.1.5)|3.1.5
        69|Active | 1|Apache CXF Runtime XML Binding (3.1.5)|3.1.5
        70|Active | 1|Apache CXF Runtime SOAP Binding (3.1.5)|3.1.5
        71|Active | 1|Apache CXF Runtime Core for WSDL (3.1.5)|3.1.5
        72|Active | 1|Apache CXF JAX-RS Client (3.1.5)|3.1.5
        73|Active | 1|Apache CXF JAX-RS Extensions: Providers (3.1.5)|3.1.5
        74|Active | 1|Apache CXF JAX-RS Service Description (3.1.5)|3.1.5
        75|Active | 1|Apache CXF Runtime Aegis Databinding (3.1.5)|3.1.5
        76|Active | 1|Apache CXF Runtime JAXB DataBinding (3.1.5)|3.1.5
        77|Active | 1|Apache CXF Runtime HTTP Transport (3.1.5)|3.1.5
        78|Active | 1|Apache CXF Runtime Simple Frontend (3.1.5)|3.1.5
        79|Active | 1|Apache CXF Runtime JAX-WS Frontend (3.1.5)|3.1.5
        80|Active | 1|Apache CXF Runtime JAX-RS Frontend (3.1.5)|3.1.5
        81|Active | 1|CXF dOSGi Required OSGi Compendium APIs (1.7.0)|1.7.0
        82|Active | 1|CXF dOSGi Remote Service Admin Implementation (1.7.0)|1.7.0
        83|Active | 1|CXF dOSGi Topology Manager (1.7.0)|1.7.0
        84|Active | 1|CXF Local Discovery Service Bundle (1.7.0)|1.7.0

        Show
        ivoleitao Ivo Leitão added a comment - I don't know if it helps or not but bellow you can find the list of bundles that I'm currently hosting in my felix environment The bundle that was giving me problems is: 36|Active | 1|Apache Directory LDAP API Network MINA (1.0.0.M33)|1.0.0.M33 The complete list of bundles that I have in my system (excluding my own bundles, only external dependencies listed): ID|State |Level|Name 0|Active | 0|System Bundle (5.4.0)|5.4.0 1|Active | 1|javax.annotation API (1.2.0)|1.2.0 2|Active | 1|Bean Validation API (1.1.0.Final)|1.1.0.Final 3|Active | 1|Apache ServiceMix :: Specs :: JSR-339 API 2.0 (2.4.0)|2.4.0 4|Active | 1|Guava: Google Core Libraries for Java (18.0.0)|18.0.0 5|Active | 1|Commons Lang (2.6.0)|2.6.0 6|Active | 1|Apache Commons Collections (3.2.2)|3.2.2 7|Active | 1|Commons IO (2.4.0)|2.4.0 8|Active | 1|Apache Commons FileUpload (1.3.1)|1.3.1 9|Active | 1|Commons Pool (1.6.0)|1.6.0 10|Active | 1|slf4j-api (1.7.16)|1.7.16 11|Active | 1|log4j-over-slf4j (1.7.16)|1.7.16 12|Active | 1|jcl-over-slf4j (1.7.16)|1.7.16 13|Active | 1|OSGi LogService implemented over SLF4J (1.7.16)|1.7.16 14|Active | 1|Apache Sling SLF4J Implementation (Logback) (4.0.6)|4.0.6 15|Active | 1|Apache Sling OSGi LogService Implementation (1.0.6)|1.0.6 16|Active | 1|ASM all classes with debug info (5.0.2)|5.0.2 17|Active | 1|JSON in Java (1.0.0.v20140107)|1.0.0.v20140107 18|Active | 1|Jackson-core (2.7.1)|2.7.1 19|Active | 1|jackson-databind (2.7.1)|2.7.1 20|Active | 1|Jackson-annotations (2.7.1)|2.7.1 21|Active | 1|Jackson-JAXRS-base (2.7.1)|2.7.1 22|Active | 1|Jackson-JAXRS-JSON (2.7.1)|2.7.1 23|Active | 1|Groovy Runtime (2.4.5)|2.4.5 24|Active | 1|Apache ServiceMix :: Bundles :: antlr (2.7.7.5)|2.7.7.5 25|Active | 1|Apache Directory LDAP API Client API (1.0.0.M33)|1.0.0.M33 26|Active | 1|Apache Directory LDAP API Utilities (1.0.0.M33)|1.0.0.M33 27|Active | 1|Apache Directory LDAP API Model (1.0.0.M33)|1.0.0.M33 28|Active | 1|Apache Directory LDAP API Extras ACI (1.0.0.M33)|1.0.0.M33 29|Active | 1|Apache Directory LDAP API Codec Core (1.0.0.M33)|1.0.0.M33 30|Active | 1|Apache Directory LDAP API Extras Codec API (1.0.0.M33)|1.0.0.M33 31|Active | 1|Apache Directory LDAP API Extras Codec (1.0.0.M33)|1.0.0.M33 32|Active | 1|Apache Directory LDAP API Schema Data (1.0.0.M33)|1.0.0.M33 33|Active | 1|Apache Directory LDAP API I18n (1.0.0.M33)|1.0.0.M33 34|Active | 1|Apache Directory API ASN.1 API (1.0.0.M33)|1.0.0.M33 35|Active | 1|Apache Directory API ASN.1 BER (1.0.0.M33)|1.0.0.M33 36|Active | 1|Apache Directory LDAP API Network MINA (1.0.0.M33)|1.0.0.M33 37|Active | 1|Apache MINA Core (2.0.10)|2.0.10 38|Active | 1|Jetty :: Continuation (9.2.14.v20151106)|9.2.14.v20151106 39|Active | 1|Apache Felix Metatype Service (1.1.2)|1.1.2 40|Active | 1|Apache Felix Declarative Services (2.0.2)|2.0.2 41|Active | 1|Apache Felix Inventory (1.0.4)|1.0.4 42|Active | 1|Apache Felix Gogo Shell (0.12.0)|0.12.0 43|Active | 1|Apache Felix Remote Shell (1.1.2)|1.1.2 44|Active | 1|Apache Felix Gogo Runtime (0.16.2)|0.16.2 45|Active | 1|Apache Felix Gogo Command (0.16.0)|0.16.0 46|Active | 1|Apache Felix EventAdmin (1.4.4)|1.4.4 47|Active | 1|Apache Felix Configuration Admin Service (1.8.8)|1.8.8 48|Active | 1|Apache Felix File Install (3.5.0)|3.5.0 49|Active | 1|Apache Felix Servlet API (1.1.2)|1.1.2 50|Active | 1|Apache Felix Http API (3.0.0)|3.0.0 51|Active | 1|Apache Felix Http Base (3.0.6)|3.0.6 52|Active | 1|Apache Felix Http Whiteboard (3.0.0)|3.0.0 53|Active | 1|Apache Felix Http Jetty (3.1.6)|3.1.6 54|Active | 1|Apache Felix Web Management Console (4.2.14)|4.2.14 55|Active | 1|Apache Felix Web Console Package Admin Service Plugin (1.0.2)|1.0.2 56|Active | 1|Apache Felix Web Console Event Plugin (1.1.4)|1.1.4 57|Active | 1|Apache Felix Web Console OBR Plugin (1.0.2)|1.0.2 58|Active | 1|Apache Felix Script Console Plugin (1.0.2)|1.0.2 59|Active | 1|Apache Felix Web Console Memory Usage Plugin (1.0.6)|1.0.6 60|Active | 1|Stax2 API (3.1.4)|3.1.4 61|Active | 1|Woodstox XML-processor (4.4.1)|4.4.1 62|Active | 1|Apache ServiceMix :: Bundles :: wsdl4j (1.6.3.1)|1.6.3.1 63|Active | 1|XmlSchema Core (2.2.1)|2.2.1 64|Active | 1|Apache Aries Util (1.0.0)|1.0.0 65|Active | 1|Apache Aries Proxy API (1.0.1)|1.0.1 66|Active | 1|Apache Aries Blueprint API (1.0.1)|1.0.1 67|Active | 1|Apache Aries Blueprint Core (1.4.2)|1.4.2 68|Active | 1|Apache CXF Core (3.1.5)|3.1.5 69|Active | 1|Apache CXF Runtime XML Binding (3.1.5)|3.1.5 70|Active | 1|Apache CXF Runtime SOAP Binding (3.1.5)|3.1.5 71|Active | 1|Apache CXF Runtime Core for WSDL (3.1.5)|3.1.5 72|Active | 1|Apache CXF JAX-RS Client (3.1.5)|3.1.5 73|Active | 1|Apache CXF JAX-RS Extensions: Providers (3.1.5)|3.1.5 74|Active | 1|Apache CXF JAX-RS Service Description (3.1.5)|3.1.5 75|Active | 1|Apache CXF Runtime Aegis Databinding (3.1.5)|3.1.5 76|Active | 1|Apache CXF Runtime JAXB DataBinding (3.1.5)|3.1.5 77|Active | 1|Apache CXF Runtime HTTP Transport (3.1.5)|3.1.5 78|Active | 1|Apache CXF Runtime Simple Frontend (3.1.5)|3.1.5 79|Active | 1|Apache CXF Runtime JAX-WS Frontend (3.1.5)|3.1.5 80|Active | 1|Apache CXF Runtime JAX-RS Frontend (3.1.5)|3.1.5 81|Active | 1|CXF dOSGi Required OSGi Compendium APIs (1.7.0)|1.7.0 82|Active | 1|CXF dOSGi Remote Service Admin Implementation (1.7.0)|1.7.0 83|Active | 1|CXF dOSGi Topology Manager (1.7.0)|1.7.0 84|Active | 1|CXF Local Discovery Service Bundle (1.7.0)|1.7.0

          People

          • Assignee:
            Unassigned
            Reporter:
            ivoleitao Ivo Leitão
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development