The actual problem is to validate the camel-elasticsearch feature in Camel
(I'm cutting the Camel 2.11.0 release right now).
We use a config.properties file which I updated with the jre.properties
provided by Karaf 2.3.1. I also updated the
"org.osgi.framework.system.packages" property from Karaf's
config.properties file.
The error I get is:
[WARNING] Failed to validate feature camel-elasticsearch
[WARNING] No export found to match javax.annotation (imported by
mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch/0.19.10_1)
This package should be of course provided by the Java runtime. The work
around for now is to change the jre export from:
javax.annotation;version="1.1", \
to
javax.annotation, \
and it works. However, I do not understand this behavior because
org.apache.servicemix.bundles.elasticsearch use the following package
import declaration:
Import-Package =
...
javax.annotation,
...
which means from version 0.0.0 and all after. This should match with the
jre provided export for version 1.1.
Does somebody has an explanation for me what's wrong?
If I install this feature in a fresh Karaf 2.3.1 instance, it works fine:
cmueller$ ./karaf clean
__ __ ____
/ //_/____ __________ _/ __/
/ ,< / __ `/ ___/ __ `/ /_
/ /| |/ /_/ / / / /_/ / __/
/_/ |_|\__,_/_/ \__,_/_/
Apache Karaf (2.3.1)
Hit '<tab>' for a list of available commands
and '[cmd] --help' for help on a specific command.
Hit '<ctrl-d>' or type 'osgi:shutdown' or 'logout' to shutdown Karaf.
karaf@root> features:chooseurl camel 2.11-SNAPSHOT
adding feature url
mvn:org.apache.camel.karaf/apache-camel/2.11-SNAPSHOT/xml/features
karaf@root> features:install camel-elasticsearch
karaf@root> list
START LEVEL 100 , List Threshold: 50
ID State Blueprint Level Name
[ 60] [Active ] [ ] [ 50] camel-core (2.11.0.SNAPSHOT)
[ 61] [Active ] [Created ] [ 50] camel-karaf-commands
(2.11.0.SNAPSHOT)
[ 84] [Active ] [ ] [ 50] Guava: Google Core Libraries
for Java (14.0.1)
[ 85] [Active ] [ ] [ 50] Apache ServiceMix :: Bundles ::
protobuf-java (2.3.0.3)
[ 86] [Active ] [ ] [ 50] Jackson-core (2.1.4)
[ 87] [Active ] [ ] [ 50] Jackson-dataformat-Smile (2.1.4)
[ 88] [Active ] [ ] [ 50] Joda-Time (1.6.2)
[ 89] [Active ] [ ] [ 50] Apache ServiceMix :: Bundles ::
jakarta-regexp (1.4.0.1)
[ 90] [Active ] [ ] [ 50] mvel2 (2.1.3.Final)
[ 91] [Active ] [ ] [ 50] Apache ServiceMix :: Bundles ::
lucene-core (3.6.0.1)
[ 92] [Active ] [ ] [ 50] Apache ServiceMix :: Bundles ::
elasticsearch (0.19.10.1)
[ 93] [Active ] [ ] [ 50] camel-elasticsearch
(2.11.0.SNAPSHOT)
karaf@root> headers 92 | more
You are about to access system bundle 92. Do you wish to continue (yes/no):
Apache ServiceMix :: Bundles :: elasticsearch (92)
--------------------------------------------------
Manifest-Version = 1.0
Bnd-LastModified = 1349451636868
Tool = Bnd-1.50.0
Built-By = jbonofre
Build-Jdk = 1.6.0_26
Created-By = Apache Maven Bundle Plugin
Bundle-Vendor = The Apache Software Foundation
Bundle-Name = Apache ServiceMix :: Bundles :: elasticsearch
Bundle-DocURL = http://www.apache.org/
Bundle-Description = This OSGi bundle wraps elasticsearch 0.19.10 jar file.
Bundle-SymbolicName = org.apache.servicemix.bundles.elasticsearch
Bundle-Version = 0.19.10.1
Bundle-License = http://www.apache.org/licenses/LICENSE-2.0.txt
Bundle-ManifestVersion = 2
Import-Package =
com.fasterxml.jackson.core,
com.fasterxml.jackson.core.base,
com.fasterxml.jackson.core.format,
com.fasterxml.jackson.core.io,
com.fasterxml.jackson.core.json,
com.fasterxml.jackson.core.sym,
com.fasterxml.jackson.core.type,
com.fasterxml.jackson.core.util,
com.fasterxml.jackson.dataformat.smile,
com.google.common.annotations,
com.google.common.base,
com.google.common.cache,
com.google.common.collect,
com.google.common.io,
com.google.common.math,
com.google.common.primitives,
com.google.common.util.concurrent,
com.google.protobuf,
com.ning.compress;resolution:=optional,
com.ning.compress.lzf;resolution:=optional,
com.ning.compress.lzf.impl;resolution:=optional,
com.ning.compress.lzf.impl;resolution:=optional,
com.ning.compress.lzf.util;resolution:=optional,
com.sun.jna;resolution:=optional,
gnu.trove;resolution:=optional,
gnu.trove.function;resolution:=optional,
gnu.trove.impl;resolution:=optional,
gnu.trove.impl.hash;resolution:=optional,
gnu.trove.iterator;resolution:=optional,
gnu.trove.iterator.hash;resolution:=optional,
gnu.trove.list;resolution:=optional,
gnu.trove.list.array;resolution:=optional,
gnu.trove.map;resolution:=optional,
gnu.trove.map.hash;resolution:=optional,
gnu.trove.procedure;resolution:=optional,
gnu.trove.procedure.array;resolution:=optional,
gnu.trove.set;resolution:=optional,
gnu.trove.set.hash;resolution:=optional,
gnu.trove.strategy;resolution:=optional,
javax.annotation,
...
HOWEVER, if I execute:
karaf@root> packages:imports | grep javax.annotation
System Bundle (0): javax.annotation; version=1.1.0
System Bundle (0): javax.annotation; version=1.1.0
it doesn't list the bundle 92 (Apache ServiceMix :: Bundles ::
elasticsearch) although the import was resolved in bundle 92.
Could somebody give me an explanation for this please!?
Best,
Christian