Uploaded image for project: 'Karaf'
  1. Karaf
  2. KARAF-2993

Cannot use Camel with karaf-maven-plugin

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Blocker
    • Resolution: Fixed
    • 3.0.1
    • None
    • karaf
    • Java 1.7, Mac OS X 10.8.5 (same problem in CentOS 6.5), Camel 2.13.1, ActiveMQ 5.9.1, Maven 3.2.1

    Description

      Here's an example pom.xml (created from the maven archetype):

      <?xml version="1.0" encoding="UTF-8"?>
      <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
      
          <!--
            Licensed to the Apache Software Foundation (ASF) under one or more
            contributor license agreements.  See the NOTICE file distributed with
            this work for additional information regarding copyright ownership.
            The ASF licenses this file to You under the Apache License, Version 2.0
            (the "License"); you may not use this file except in compliance with
            the License.  You may obtain a copy of the License at
      
               http://www.apache.org/licenses/LICENSE-2.0
      
            Unless required by applicable law or agreed to in writing, software
            distributed under the License is distributed on an "AS IS" BASIS,
            WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
            See the License for the specific language governing permissions and
            limitations under the License.
          -->
      
          <modelVersion>4.0.0</modelVersion>
      
          <groupId>com.example</groupId>
          <artifactId>jms-kar-test</artifactId>
          <version>1.0-SNAPSHOT</version>
          <packaging>kar</packaging>
      
          <name>jms-kar-test-kar</name>
          <description>jms-kar-test details</description>
      
          <dependencies>
              <dependency>
                  <groupId>org.apache.activemq</groupId>
                  <artifactId>activemq-camel</artifactId>
                  <version>5.9.1</version>
              </dependency>
              <!-- add the artifacts that should be in the kar in the dependencies set -->
          </dependencies>
      
          <build>
              <pluginManagement>
                  <plugins>
                      <plugin>
                          <groupId>org.apache.karaf.tooling</groupId>
                          <artifactId>karaf-maven-plugin</artifactId>
                          <version>3.0.1</version>
                          <extensions>true</extensions>
                      </plugin>
                  </plugins>
              </pluginManagement>
              <plugins>
                  <plugin>
                      <groupId>org.apache.karaf.tooling</groupId>
                      <artifactId>karaf-maven-plugin</artifactId>
                      <configuration>
                          <startLevel>50</startLevel>
                          <aggregateFeatures>true</aggregateFeatures>
                          <resolver>(obr)</resolver>
                          <checkDependencyChange>true</checkDependencyChange>
                          <failOnDependencyChange>false</failOnDependencyChange>
                          <logDependencyChanges>true</logDependencyChanges>
                          <overwriteChangedDependencies>true</overwriteChangedDependencies>
                      </configuration>
                  </plugin>
              </plugins>
          </build>
      
      </project>
      

      Then I run mvn clean install, then I copy the .kar file to my karaf/deploy/ directory. Tailing the logs, I get the following error:

      2014-05-20 17:52:27,161 | INFO | ker/karaf/deploy | FeaturesServiceImpl | 24 - org.apache.karaf.features.core - 3.0.1 | Installing feature jms-kar-test 1.0-SNAPSHOT
      2014-05-20 17:52:28,446 | WARN | ker/karaf/deploy | KarServiceImpl | 67 - org.apache.karaf.kar.core - 3.0.1 | Unable to install Kar feature jms-kar-test/1.0-SNAPSHOT
      java.lang.Exception: Could not start bundle mvn:org.apache.activemq/activemq-camel/5.9.1 in feature(s) jms-kar-test-1.0-SNAPSHOT, synergy-service-1.0-SNAPSHOT: The bundle "org.apache.activemq.activemq-camel_5.9.1 [175]" could not be resolved. Reason: Missing Constraint: Import-Package: org.apache.camel.component.jms; version="[2.12.0,3.0.0)"
      at org.apache.karaf.features.internal.FeaturesServiceImpl.startBundle(FeaturesServiceImpl.java:478)[24:org.apache.karaf.features.core:3.0.1]
      at org.apache.karaf.features.internal.FeaturesServiceImpl.installFeatures(FeaturesServiceImpl.java:433)[24:org.apache.karaf.features.core:3.0.1]
      at org.apache.karaf.features.internal.FeaturesServiceImpl.installFeature(FeaturesServiceImpl.java:373)[24:org.apache.karaf.features.core:3.0.1]
      at Proxy48d4e7c4_5cbf_42c8_a35a_8a5885da52e7.installFeature(Unknown Source)[:]
      at Proxy2e2fbf12_62e5_4914_a8cc_9341e308786a.installFeature(Unknown Source)[:]
      at org.apache.karaf.kar.internal.KarServiceImpl.installFeatures(KarServiceImpl.java:215)[67:org.apache.karaf.kar.core:3.0.1]
      at org.apache.karaf.kar.internal.KarServiceImpl.install(KarServiceImpl.java:96)[67:org.apache.karaf.kar.core:3.0.1]
      at org.apache.karaf.kar.internal.KarServiceImpl.install(KarServiceImpl.java:84)[67:org.apache.karaf.kar.core:3.0.1]
      at Proxycaddf5e6_73d6_4025_aea0_b652eeb4a3e4.install(Unknown Source)[:]
      at Proxy0dd72639_2b42_4661_af23_b346065c53ea.install(Unknown Source)[:]
      at org.apache.karaf.deployer.kar.KarArtifactInstaller.install(KarArtifactInstaller.java:50)[69:org.apache.karaf.deployer.kar:3.0.1]
      at Proxy4169478f_f658_4100_8d98_86e9f068df4a.install(Unknown Source)[:]
      at org.apache.felix.fileinstall.internal.DirectoryWatcher.install(DirectoryWatcher.java:945)[11:org.apache.felix.fileinstall:3.2.8]
      at org.apache.felix.fileinstall.internal.DirectoryWatcher.install(DirectoryWatcher.java:873)[11:org.apache.felix.fileinstall:3.2.8]
      at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:499)[11:org.apache.felix.fileinstall:3.2.8]
      at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:308)[11:org.apache.felix.fileinstall:3.2.8]
      Caused by: org.osgi.framework.BundleException: The bundle "org.apache.activemq.activemq-camel_5.9.1 [175]" could not be resolved. Reason: Missing Constraint: Import-Package: org.apache.camel.component.jms; version="[2.12.0,3.0.0)"
      at org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolverError(AbstractBundle.java:1332)[org.eclipse.osgi-3.8.2.v20130124-134944.jar:]
      at org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolutionFailureException(AbstractBundle.java:1316)[org.eclipse.osgi-3.8.2.v20130124-134944.jar:]
      at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:323)[org.eclipse.osgi-3.8.2.v20130124-134944.jar:]
      at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:300)[org.eclipse.osgi-3.8.2.v20130124-134944.jar:]
      at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:292)[org.eclipse.osgi-3.8.2.v20130124-134944.jar:]
      at org.apache.karaf.features.internal.FeaturesServiceImpl.startBundle(FeaturesServiceImpl.java:475)[24:org.apache.karaf.features.core:3.0.1]
      ... 15 more

      Attachments

        Activity

          People

            gnodet Guillaume Nodet
            mattsicker Matt Sicker
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: