Activation error when installing a bundle in OSGi - osgi

I am getting the following error when installing a bundle.
Failed to start bundle x.y.z-1.0.0, exception activator error org/osgi/framework/BundleActivator from: java.lang.ClassLoader:defineClass1#-2
How can I get rid of this ?

The easiest way to get rid of the message would be to not install the bundle :-)
It sounds like the bundle's activator class depends on a class the bundle cannot load. So perhaps the desired class was not properly packaged in the bundle or the necessary import package clause is missing.

Related

Hystrix and OSGI bundle

I have used org.apache.servicemix.bundles.hystrix dependency to bundle Hystrix as OSGI bundle. However, I'm facing this issue:
org.osgi.framework.BundleException: Could not resolve module: [828]
Unresolved requirement: Import-Package: com.netflix.hystrix; version="[1.5.0,2.0.0)"
Can someone help me on this?
Thanks!
The error tells you that the bundle you try to install and resolve requires a certain package and that there is no bundle that offers this package.
So in you case the package com.netflix.hystrix is missing. This means that you either do not have the hystrix bundle installed or you installed a version that does not match the version range [1.5.0,2.0.0).

Jena OSGi bundle cannot start

I want to use Jena OSGi 3.0.0 version in Felix 2.0.3, but when I install the bundle I get the exception:
Unresolved constraint in bundle org.apache.jena.osgi [1]: package; (&(package=org.apache.commons.cli)(version>=1.3.0)(!(version>=2.0.0)))
Does this mean that the package org.apache.commons.cli is not contained in the jena-osgi bundle?
Any ideas how to solve this issue?
Yes, this means that the jena-osgi bundle imports package org.apache.commons.cli. You need to install the bundle that exports this package.
Funnily enough, this package is exported by a bundle named org.apache.commons.cli which you can get from Maven Central:
http://search.maven.org/#artifactdetails|commons-cli|commons-cli|1.3.1|jar

Apache karaf how to easily install bundle from Maven repo

I am trying out Karaf and installed some bundle X. This bundle X complains about a missing requirement: Unresolved requirements ... osgi.wiring.package; (osgi.wiring.package=org.apache.commons.httpclient)]
Hence, I tried to provide the org.apache.commons.httpclient through bundle:install mvn:commons-httpclient/commons-httpclient/3.1 which worked.
But, after trying to start the X again, I still get the same error message.
thanks!
That jar is not a bundle, hence can't be deployed to karaf, it's just ignored.
Try
karaf#root>bundle:install -s mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-httpclient/3.1_7
Make it sure that your bundle has in their META-INF/MANIFEST.MF the osgi import declarations syntax. I assume that you use bndtools to generate the bundle.
Agree with #Antonio, for third party libraries which are not OSGi bundles you can also try to install them with wrap:
bundle:install -s wrap:mvn:commons-httpclient/commons-httpclient/3.1
This will create a basic OSGi MANIFEST for the library...
You can find more info here: http://karaf.apache.org/manual/latest/developers-guide/creating-bundles.html

Apache Sling: unresolved package after Installing SlingShot sample bundle

I am Unable to run slingshot sample , apache sling i have followed these steps
Click here!
the package got installed but it didn't get activated. The detail collapsed view of bundle shows
org.apache.sling.api.resource,version=[2.2,2) -- Cannot be resolved
Your bundle import org.apache.sling.api.resource,version=[2.2,2) was not resolved.
Assuming that your sling installation is running, you should verify if the package org.apache.sling.api.resource is either not exported or exported in the wrong version.
If the package is present then adapt your import.
You didn't indicate how you built or started the Sling instance where you installed the Slingshot bundle.
I just tried with a Sling launchpad built from the launchpad/builder folder of the Sling source code, the Slingshot bundle starts without problems and the /slingshot/albums.html path mentioned in the sample's README.txt works.

annotate command "no such load to file" with -R

The annotate command fails when using the -R option to load additional files before loading the models with version 2.4.1.beta. The files appear to be found, but the error still occurs (if I use a wild-card path the first file is displayed as the error). A similar error message appears here (https://github.com/ctran/annotate_models/issues/78) The solution there is to use:
gem 'annotate', github: 'ctran/annotate_models'
but if I replace annotate in the Gemfile with the above, and do:
gem uninstall annotate
bundle install
Then bundle reports on the first line:
Updating git://github.com/ctran/annotate_models.git
and later:
Using annotate (2.5.0.pre1) from git://github.com/ctran/annotate_models.git (at master)
Note that neither message says "Installing". Then executing annotate ends up with the annotate executable not being found. Any solutions? (Ruby 1.9.2p280, Rails 3.2.2)

Resources