felix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From craig niles <nile...@gmail.com>
Subject Re: NoClassDefFoundError in OSGI bundle
Date Fri, 04 Dec 2015 14:46:40 GMT
It looks like you aren't importing a required package in your bundle.
Without the import the framework is resolving the bundle and activating the
bundle, but the bundle still doesn't have access to the class.  Is the
org.apache.axis2.util package provided through another bundle installed in
Karaf or is it included in the set of jars you're putting in your new
bundle?


On Fri, Dec 4, 2015 at 5:26 AM, <shridhar.kabbur@promantia.com> wrote:

> Hi Felix Forum,
> I have created a OSGI bundle from a custom API jar,the jar depends on
> around 60 jars.
>
> In the bundle I have created I have packaged the jars in a lib directory
> and then included the jars in the classpath in the `maven pom.xml`. When I
> deploy the bundle in Karaf the bundle starts and shows its active ,but when
> I try to access the API bundle from another bundle say test I get
> `NoClassDefFoundError`
>
> On investigation I found that there is a static initializer in the
> `org.apache.axis2.util.XMLUtils` class which might be causing the error.
>
> The Full error message is:
>
>
>
>     org.apache.karaf.shell.support.MultiException: Error executing command
> on bundles:
>         Error starting bundle66: Activator start error in bundle
> com.rna.app [66].
>         at
> org.apache.karaf.shell.support.MultiException.throwIf(MultiException.java:61)
>         at
> org.apache.karaf.bundle.command.BundlesCommand.doExecute(BundlesCommand.java:69)[23:org.apache.karaf.bundle.core:4.0.1]
>         at
> org.apache.karaf.bundle.command.BundlesCommand.execute(BundlesCommand.java:54)[23:org.apache.karaf.bundle.core:4.0.1]
>         at
> org.apache.karaf.shell.impl.action.command.ActionCommand.execute(ActionCommand.java:83)[43:org.apache.karaf.shell.core:4.0.1]
>         at
> org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:67)[43:org.apache.karaf.shell.core:4.0.1]
>         at
> org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:87)[43:org.apache.karaf.shell.core:4.0.1]
>         at
> org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:480)[43:org.apache.karaf.shell.core:4.0.1]
>         at
> org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:406)[43:org.apache.karaf.shell.core:4.0.1]
>         at
> org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)[43:org.apache.karaf.shell.core:4.0.1]
>         at
> org.apache.felix.gogo.runtime.Closure.execute(Closure.java:182)[43:org.apache.karaf.shell.core:4.0.1]
>         at
> org.apache.felix.gogo.runtime.Closure.execute(Closure.java:119)[43:org.apache.karaf.shell.core:4.0.1]
>         at
> org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:94)[43:org.apache.karaf.shell.core:4.0.1]
>         at
> org.apache.karaf.shell.impl.console.ConsoleSessionImpl.run(ConsoleSessionImpl.java:267)[43:org.apache.karaf.shell.core:4.0.1]
>         at java.lang.Thread.run(Thread.java:745)[:1.8.0_66]
>     Caused by: java.lang.Exception: Error starting bundle66: Activator
> start error in bundle com.rna.app [66].
>         at
> org.apache.karaf.bundle.command.BundlesCommand.doExecute(BundlesCommand.java:66)[23:org.apache.karaf.bundle.core:4.0.1]
>         ... 12 more
>     Caused by: org.osgi.framework.BundleException: Activator start error
> in bundle com.rna.app [66].
>         at
> org.apache.felix.framework.Felix.activateBundle(Felix.java:2270)[org.apache.felix.framework-5.0.1.jar:]
>         at
> org.apache.felix.framework.Felix.startBundle(Felix.java:2138)[org.apache.felix.framework-5.0.1.jar:]
>         at
> org.apache.felix.framework.BundleImpl.start(BundleImpl.java:977)[org.apache.felix.framework-5.0.1.jar:]
>         at
> org.apache.karaf.bundle.command.Start.executeOnBundle(Start.java:38)[23:org.apache.karaf.bundle.core:4.0.1]
>         at
> org.apache.karaf.bundle.command.BundlesCommand.doExecute(BundlesCommand.java:64)[23:org.apache.karaf.bundle.core:4.0.1]
>         ... 12 more
>     Caused by: java.lang.NoClassDefFoundError: Could not initialize class
> org.apache.axis2.util.XMLUtils
>         at
> org.apache.axis2.deployment.DescriptionBuilder.buildOM(DescriptionBuilder.java:97)
>         at
> org.apache.axis2.deployment.AxisConfigBuilder.populateConfig(AxisConfigBuilder.java:88)
>         at
> org.apache.axis2.deployment.DeploymentEngine.populateAxisConfiguration(DeploymentEngine.java:705)
>         at
> org.apache.axis2.deployment.FileSystemConfigurator.getAxisConfiguration(FileSystemConfigurator.java:116)
>         at
> org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext(ConfigurationContextFactory.java:64)
>         at
> org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContextFromFileSystem(ConfigurationContextFactory.java:206)
>         at com.rna.App.start(App.java:71)
>         at
> org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:697)
>         at org.apache.felix.framework.Felix.activateBundle(Felix.java:2220)
>         ... 16 more
>
>
>
> Any ideas on how to investigate further would be really helpful.
>
> Thanks and RegardsShridhar
>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message