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).
Related
im having some problems with an sogi-app running on karaf 3.0.8. The app has these dependencies:
dependencies {
compile 'org.apache.camel:camel-core:2.15.2'
compile 'org.apache.camel:camel-cxf:2.15.2'
compile 'org.slf4j:slf4j-api:1.7.12'
testCompile group: 'junit', name: 'junit', version: '4.11'
}
When I try to deploy it in karaf, it says:
org.osgi.framework.BundleException: Unresolved constraint in bundle
foobar.it.osgi.status.osgi-status [863]: Unable to resolve 863.1:
missing requirement [863.1] osgi.wiring.package;
(&(osgi.wiring.package=javax.ws.rs)(version>=2.0.0)(!(version>=3.0.0)))
I tried this:
feature:repo-add mvn:org.apache.cxf.karaf/apache-cxf/3.0.4/xml/feature
feature:install cxf
I then get this error:
Error executing command: Can't install feature cxf/0.0.0:
No feature named 'jetty' with version '[7,10)' available
Hmm, any tips as to how I may install the proper package? Thanks.
I just tested CXF with karaf 3.0.8. I was able to install version 3.0.4, 3.0.10 and 3.1.6 without any problems.
I am not sure why you get the error as karaf 3.0.8 contains jetty 8. So there should be a valid feature in the range you specified.
In any case I recommend to not install cxf 3.0.4. It is quite outdated as CXF is at version 3.0.10 already in this branch. Generally you should always try to install the latest bugfix version as it might contain important fixes like security issues.
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
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
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.
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.