ServiceMix
  1. ServiceMix
  2. SM-2279

The jndi feature can not be installed

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.0.0
    • Fix Version/s: 5.0.1, 5.1.0, 6.0.0.M1, 6.0.0
    • Component/s: assemblies
    • Labels:
      None

      Description

      Installation of the jndi feature ends with following error

      karaf@root> features:install jndi
      Error executing command: Can not resolve feature:
      Unsatisfied requirement(s):
      ---------------------------
         service:(service=org.apache.aries.proxy.ProxyManager)
            Apache Karaf :: JNDI :: Core 
      

      Cfr: http://servicemix.396122.n5.nabble.com/Feature-Install-Errors-in-SMX-5-0-0-td5719921.html

        Issue Links

          Activity

          Hide
          Krzysztof Sobkowiak added a comment -

          I have removed following lines from etc/startup.properties and the jndi feature could be installed

          org/apache/felix/org.apache.felix.bundlerepository/1.6.6/org.apache.felix.bundlerepository-1.6.6.jar=10
          org/apache/karaf/features/org.apache.karaf.features.obr/2.3.4/org.apache.karaf.features.obr-2.3.4.jar=30
          

          These lines are added by maven-antrun-plugin

                              <execution>
                                  <id>enable-obr</id>
                                  <phase>prepare-package</phase>
                                  <goals>
                                      <goal>run</goal>
                                  </goals>
                                  <configuration>
                                      <target name="enable-obr">
                                          <echo message="Updating etc/startup.properties in assembly" />
                                          <concat destfile="target/dependencies/unix/apache-karaf-${karaf.version}/etc/startup.properties" append="true">
                                              <string value="${line.separator}" />
                                              <fileset file="target/classes/startup-obr.properties" />
                                          </concat>
                                      </target>
                                  </configuration>
                              </execution>
          

          Do we really need this?

          Show
          Krzysztof Sobkowiak added a comment - I have removed following lines from etc/startup.properties and the jndi feature could be installed org/apache/felix/org.apache.felix.bundlerepository/1.6.6/org.apache.felix.bundlerepository-1.6.6.jar=10 org/apache/karaf/features/org.apache.karaf.features.obr/2.3.4/org.apache.karaf.features.obr-2.3.4.jar=30 These lines are added by maven-antrun-plugin <execution> <id>enable-obr</id> <phase>prepare- package </phase> <goals> <goal>run</goal> </goals> <configuration> <target name= "enable-obr" > <echo message= "Updating etc/startup.properties in assembly" /> <concat destfile= "target/dependencies/unix/apache-karaf-${karaf.version}/etc/startup.properties" append= " true " > <string value= "${line.separator}" /> <fileset file= "target/classes/startup-obr.properties" /> </concat> </target> </configuration> </execution> Do we really need this?
          Hide
          Jean-Baptiste Onofré added a comment -

          It's to use the OBR resolver. IMHO, it's not required and we can use the default feature/bundle resolver.

          Show
          Jean-Baptiste Onofré added a comment - It's to use the OBR resolver. IMHO, it's not required and we can use the default feature/bundle resolver.
          Hide
          Krzysztof Sobkowiak added a comment -

          I thought so, it is for OBR. It is not enabled in Karaf 2.3.4 by default. Was there any reason? I have copied the both jars in Karafs system directory and added the both lines at the end of Karafs startup.priperties - I can't install jndi too. Is it a bug in the OBR resolver? Is this problem known in Karaf?

          Show
          Krzysztof Sobkowiak added a comment - I thought so, it is for OBR. It is not enabled in Karaf 2.3.4 by default. Was there any reason? I have copied the both jars in Karafs system directory and added the both lines at the end of Karafs startup.priperties - I can't install jndi too. Is it a bug in the OBR resolver? Is this problem known in Karaf?
          Hide
          Jean-Baptiste Onofré added a comment -

          Did you try to install the obr feature ?

          For me it sounds like an issue in the OBR resolver as aries-proxy is there and used by jndi.

          Show
          Jean-Baptiste Onofré added a comment - Did you try to install the obr feature ? For me it sounds like an issue in the OBR resolver as aries-proxy is there and used by jndi.
          Hide
          Krzysztof Sobkowiak added a comment - - edited

          Installing the obr feature (or adding it to featuresBoot) solves the problem. I propose to add it to featuresBoot.

          Show
          Krzysztof Sobkowiak added a comment - - edited Installing the obr feature (or adding it to featuresBoot ) solves the problem. I propose to add it to featuresBoot .
          Hide
          Gert Vanthienen added a comment -

          We install the OBR features resolver support to avoid duplicate bundle versions when dealing with the different features descriptors. E.g. is Camel has version x of a bundle and CXF has bundle y, the OBR support kind of irons out these inconsistencies.

          The reason we enabled the obr feature like this instead of adding it to the boot features, was to work around https://issues.apache.org/jira/browse/KARAF-608.

          Show
          Gert Vanthienen added a comment - We install the OBR features resolver support to avoid duplicate bundle versions when dealing with the different features descriptors. E.g. is Camel has version x of a bundle and CXF has bundle y, the OBR support kind of irons out these inconsistencies. The reason we enabled the obr feature like this instead of adding it to the boot features, was to work around https://issues.apache.org/jira/browse/KARAF-608 .
          Hide
          Gert Vanthienen added a comment -

          The problem with the jndi feature probably is that the Aries Proxy bundle does not have an Export-Service header to advertise it's publishing that service into the OSGi Service Registry.

          Show
          Gert Vanthienen added a comment - The problem with the jndi feature probably is that the Aries Proxy bundle does not have an Export-Service header to advertise it's publishing that service into the OSGi Service Registry.
          Hide
          Krzysztof Sobkowiak added a comment -

          Should we open a JIRA issue in Aries?

          As workaround we have 3 solutions

          • We can propose to install the obr feature manually.
          • We can add obr into the boot features, but we have problem with KARAF-608
          • We can remove the obr resolver from startup.properties, but we have problem with duplicate bundle versions

          We could eventually overwrite the jndi feature in ServiceMix features and add obr as dependency. Even if Aries adds the Export-Service header, it will be probably not included in ServiceMix 5. In ServiceMix 6 the problem is solved by KARAF-608

          Show
          Krzysztof Sobkowiak added a comment - Should we open a JIRA issue in Aries? As workaround we have 3 solutions We can propose to install the obr feature manually. We can add obr into the boot features, but we have problem with KARAF-608 We can remove the obr resolver from startup.properties , but we have problem with duplicate bundle versions We could eventually overwrite the jndi feature in ServiceMix features and add obr as dependency. Even if Aries adds the Export-Service header, it will be probably not included in ServiceMix 5. In ServiceMix 6 the problem is solved by KARAF-608
          Hide
          Krzysztof Sobkowiak added a comment - - edited

          It looks like changing the start level of org.apache.felix.bundlerepository in assembly/src/main/filtered-resources/startup-obr.properties from 10 to 30 (similar to the start level defined by the obr feature) solves the problem

          # enabling features OBR resolver support
          org/apache/felix/org.apache.felix.bundlerepository/${felix.obr.version}/org.apache.felix.bundlerepository-${felix.obr.version}.jar=30
          org/apache/karaf/features/org.apache.karaf.features.obr/${karaf.version}/org.apache.karaf.features.obr-${karaf.version}.jar=30
          
          Show
          Krzysztof Sobkowiak added a comment - - edited It looks like changing the start level of org.apache.felix.bundlerepository in assembly/src/main/filtered-resources/startup-obr.properties from 10 to 30 (similar to the start level defined by the obr feature) solves the problem # enabling features OBR resolver support org/apache/felix/org.apache.felix.bundlerepository/${felix.obr.version}/org.apache.felix.bundlerepository-${felix.obr.version}.jar=30 org/apache/karaf/features/org.apache.karaf.features.obr/${karaf.version}/org.apache.karaf.features.obr-${karaf.version}.jar=30
          Hide
          Gert Vanthienen added a comment -

          I raised ARIES-1182 to get the extra Export-Service added to the Aries proxy-impl bundle.

          Show
          Gert Vanthienen added a comment - I raised ARIES-1182 to get the extra Export-Service added to the Aries proxy-impl bundle.
          Hide
          Gert Vanthienen added a comment - - edited

          It took me some debugging yesterday eventing to figure out why the change in startlevel in the startup.properties file actually works. It turns out that for the bundles that are already active in the container when the OBR implementation is installed, it looks at the actual services that have been published by a bundle instead of relying on the Export-Service header for this information.

          Anyway, changing the startlevel to anything higher than the proxy-impl bundle will do the trick, so I think that would be the best solution for this issue until the ARIES-1182 one gets fixed.

          Show
          Gert Vanthienen added a comment - - edited It took me some debugging yesterday eventing to figure out why the change in startlevel in the startup.properties file actually works. It turns out that for the bundles that are already active in the container when the OBR implementation is installed, it looks at the actual services that have been published by a bundle instead of relying on the Export-Service header for this information. Anyway, changing the startlevel to anything higher than the proxy-impl bundle will do the trick, so I think that would be the best solution for this issue until the ARIES-1182 one gets fixed.
          Hide
          Krzysztof Sobkowiak added a comment -

          So we can do the change as workaround until ARIES-1182 is fixed. Next we can revert this change for ServiceMix 5.x. If I have correctly understood KARAF-608, we can completely remove the obr bundles from startup.properties in ServiceMix 6.x (after migration to Karaf 3.x) and add obr in featuresBoot.

          Show
          Krzysztof Sobkowiak added a comment - So we can do the change as workaround until ARIES-1182 is fixed. Next we can revert this change for ServiceMix 5.x. If I have correctly understood KARAF-608 , we can completely remove the obr bundles from startup.properties in ServiceMix 6.x (after migration to Karaf 3.x) and add obr in featuresBoot .
          Show
          Krzysztof Sobkowiak added a comment - Workaround committed in 5.0.x – https://git-wip-us.apache.org/repos/asf?p=servicemix.git;a=commit;h=62cd7187fe755bab2ee4c29eb0803467320ce79d 5.1.x – https://git-wip-us.apache.org/repos/asf?p=servicemix.git;a=commit;h=e1f1a1b4bf4111ac35b71333a80969c426c86f30 6.0.x – https://git-wip-us.apache.org/repos/asf?p=servicemix.git;a=commit;h=bf9f30d72525859e7043cc23b51ad1c9ff94aa97

            People

            • Assignee:
              Krzysztof Sobkowiak
              Reporter:
              Krzysztof Sobkowiak
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development