[
https://issues.apache.org/jira/browse/AXIS2-4853?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12964630#action_12964630
]
Ancoron Luciferis commented on AXIS2-4853:
------------------------------------------
The real problem here is that Axis2 should NOT use code like "new
AxisConfiguration()" in an OSGi environment because that tries to initialize
Axiom assuming class visibility that may not be the case within such an
environment:
org.apache.axiom.om.OMAbstractFactory.getMetaFactory():
132 try {
133 defaultMetaFactory = (OMMetaFactory)
Class.forName(omFactory).newInstance();
134 } catch (InstantiationException e) {
135 throw new OMException(e);
136 } catch (IllegalAccessException e) {
137 throw new OMException(e);
138 } catch (ClassNotFoundException e) {
139 throw new OMException(e);
140 }
Line 139 appears on the stacktrace. So my suggestion is to prepare
"AxisDescription" for OSGi environments and not doing stuff like this
statically:
70 private OMFactory omFactory = OMAbstractFactory.getOMFactory();
> Use Axiom osgi services
> -----------------------
>
> Key: AXIS2-4853
> URL: https://issues.apache.org/jira/browse/AXIS2-4853
> Project: Axis2
> Issue Type: Bug
> Affects Versions: 1.5.1
> Reporter: Ancoron Luciferis
>
> 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.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]