Dear Karaf-Users,
I currently successfully ported an OSGI application from Karaf 2.3.3 to
Karaf 3.0.5.
Now, I wanted to port it to Karaf 4.0.3 and failed with an error being
thrown by the
karaf-maven-plugin.
To give an overview of the possibly relevant aspects:
I use Java 7 (Oracle JDK) for implementation and maven 3.3.9 for build.
The Karaf version is 4.0.3 which is also the version of the
karaf-maven-plugin I use.
I already upgraded nearly all packages that my system shares with Karaf
to the version Karaf
4.0.3 uses. I only did not upgrade my OSGI dependency to 6 since the
compilation fails.
But this is another issue and I think it should not be a problem.
I explicitly import the features of Karaf with the descriptor sequence
available for the
karaf-maven-plugin and have my own feature file using the 1.2.1 namespace:
mvn:org.apache.karaf.features/standard/${karaf.version}/xml/features
mvn:org.apache.karaf.features/enterprise/${karaf.version}/xml/features
mvn:org.apache.karaf.features/spring/${karaf.version}/xml/features
mvn:org.apache.karaf.features/framework/${karaf.version}/xml/features
file://${project.basedir}/target/classes/features.xml
The feature files of Karaf are loaded successfully - the feature openjpa
I use is located in
the enterprise features file of Karaf and is successfully found. The
descriptors are even listed
in debug mode. So they should be reachable.
I do not use http-whiteboard feature. But I assume that some cxf feature
I use does.
Nevertheless, the karaf-maven-plugin fails on the goal
features-add-to-repository in the package phase with the
following error message:
[ERROR] Failed to execute goal
org.apache.karaf.tooling:karaf-maven-plugin:4.0.3:features-add-to-repository
(features-add-to-repo) on project features: Error populating repository:
Unable to find the feature 'http-whiteboard' -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to
execute goal
org.apache.karaf.tooling:karaf-maven-plugin:4.0.3:features-add-to-repository
(features-add-to-repo) on project features: Error populating repository
at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at
org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at
org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at
org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at
org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at
org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at
org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: Error
populating repository
at
org.apache.karaf.tooling.features.AbstractFeatureMojo.resolveFeatures(AbstractFeatureMojo.java:252)
at
org.apache.karaf.tooling.features.AddToRepositoryMojo.execute(AddToRepositoryMojo.java:56)
at
org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
... 20 more
Caused by: java.lang.IllegalArgumentException: Unable to find the
feature 'http-whiteboard'
at
org.apache.karaf.tooling.features.AbstractFeatureMojo.getMatchingFeature(AbstractFeatureMojo.java:217)
at
org.apache.karaf.tooling.features.AbstractFeatureMojo.addFeaturesDependencies(AbstractFeatureMojo.java:177)
at
org.apache.karaf.tooling.features.AbstractFeatureMojo.addFeaturesDependencies(AbstractFeatureMojo.java:180)
at
org.apache.karaf.tooling.features.AbstractFeatureMojo.addFeaturesDependencies(AbstractFeatureMojo.java:180)
at
org.apache.karaf.tooling.features.AbstractFeatureMojo.addFeaturesDependencies(AbstractFeatureMojo.java:180)
at
org.apache.karaf.tooling.features.AbstractFeatureMojo.addFeatures(AbstractFeatureMojo.java:170)
at
org.apache.karaf.tooling.features.AbstractFeatureMojo.resolveFeatures(AbstractFeatureMojo.java:236)
... 23 more
I looked into the standard features file of Karaf and found the feature
http-whiteboard. Thus, the maven plugin should find
it.
I even defined the http-whiteboard feature in my own features file,
nearly identically to the definition in the Karaf features but the
bundle still does not find the feature. I just removed the prerequisite
and dependency attributes from the feature elements. Moreover,
I also tried using the 1.3.0 namespace but it did not solve the problem.
Is someone able to give me a hint to a solution of my problem?
Sincerely,
Mario