Uploaded image for project: 'Axis2'
  1. Axis2
  2. AXIS2-4853

Use Axiom osgi services

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • 1.5.1
    • None
    • None
    • None

    Description

      When trying to use axis2-osgi with the upstream axiom version the following error appears:

      org.osgi.framework.BundleException: Activator start error in bundle org.apache.axis2.osgi [285].
      at org.apache.felix.framework.Felix.activateBundle(Felix.java:1864)
      at org.apache.felix.framework.Felix.startBundle(Felix.java:1734)
      at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:905)
      at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:892)
      at com.profitbricks.osgi.test.FelixTest.deployBundle(FelixTest.java:61)
      at com.profitbricks.osgi.test.FelixTest.testModules(FelixTest.java:220)
      Caused by: org.apache.axiom.om.OMException: java.lang.ClassNotFoundException: org.apache.axiom.om.impl.llom.factory.OMLinkedListMetaFactory
      at org.apache.axiom.om.OMAbstractFactory.getMetaFactory(OMAbstractFactory.java:139)
      at org.apache.axiom.om.OMAbstractFactory.getOMFactory(OMAbstractFactory.java:152)
      at org.apache.axis2.description.AxisDescription.<init>(AxisDescription.java:70)
      at org.apache.axis2.engine.AxisConfiguration.<init>(AxisConfiguration.java:160)
      at org.apache.axis2.osgi.deployment.OSGiServerConfigurator.populateAxisConfiguration(OSGiServerConfigurator.java:76)
      at org.apache.axis2.osgi.deployment.OSGiServerConfigurator.getAxisConfiguration(OSGiServerConfigurator.java:61)
      at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext(ConfigurationContextFactory.java:64)
      at org.apache.axis2.osgi.deployment.OSGiConfigurationContextFactory.startConfigurationContext(OSGiConfigurationContextFactory.java:93)
      at org.apache.axis2.osgi.deployment.OSGiConfigurationContextFactory.updated(OSGiConfigurationContextFactory.java:102)
      at org.apache.axis2.osgi.internal.Activator.start(Activator.java:45)
      at org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:633)
      at org.apache.felix.framework.Felix.activateBundle(Felix.java:1817)
      ... 34 more
      Caused by: java.lang.ClassNotFoundException: org.apache.axiom.om.impl.llom.factory.OMLinkedListMetaFactory
      at org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:772)
      at org.apache.felix.framework.ModuleImpl.access$200(ModuleImpl.java:73)
      at org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1690)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Class.java:169)
      at org.apache.axiom.om.OMAbstractFactory.getMetaFactory(OMAbstractFactory.java:133)

      This is due to the fact that the axiom OSGi bundles are separated into e.g. axiom-api and axiom-impl, where the class "org.apache.axiom.om.impl.llom.factory.OMLinkedListMetaFactory" resides in "axiom-impl" and the "org.apache.axiom.om.OMAbstractFactory" is exported by "axiom-api".

      To overcome this the folks from axiom already provide a service for the OMMetaFactory:

      <components xmlns:scr="http://www.osgi.org/xmlns/scr/v1.0.0">
      <scr:component enabled="true" immediate="true" name="metafactory.llom.component">
      <implementation class="org.apache.axiom.om.impl.llom.factory.OMLinkedListMetaFactory"/>
      <service servicefactory="false">
      <provide interface="org.apache.axiom.om.OMMetaFactory"/>
      </service>
      <property name="implementationName" type="String" value="llom"/>
      <property name="service.pid" value="metafactory.llom.component"/>
      </scr:component>
      </components>

      So the axis2 OSGi integration really should use that instead.

      Attachments

        Activity

          People

            Unassigned Unassigned
            ancoron Ancoron Luciferis
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: