8 Replies Latest reply on Mar 4, 2016 3:20 AM by grgrzybek

    Please help me! installed feature failed org.osgi.service.resolver.ResolutionException: Unable to resolve root: missing requirement [root] osgi.identity...

    jiang01yi

      Hi, Guys

      Appreciate for help. i am new to fuse. Recently, I did create a very simple apache camel program, and trying to deploy to fuse, and getting the following error

      20150909014756.png

      However I had tried, it doesn't work. refrenced to [KARAF-3520] FeatureService fails to install feature in case of missing capability - ASF JIRA. Please have a look my profile:

      20150909014840.png

       

      Please have a look my project structure

      20150909015409.png

       

      applicationContext.xml(camelContext.xml)

      <?xml version="1.0" encoding="UTF-8"?>
      <beans xmlns="http://www.springframework.org/schema/beans"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="
        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
        http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
         <camelContext xmlns="http://camel.apache.org/schema/spring">
         <route>
         <from uri="timer://myTimer?fixedRate=true&amp;period=2000"/>
         <bean ref="myTransform" method="transform"/>
         <to uri="log:demo?showBodyType=false"/>
         </route>
         </camelContext>
         <bean id="myBean" class="com.jacky.test.MyBean"/>
         <bean id="helloRouteBuilder" class="com.jacky.test.JavaRouteBuilder"></bean>
         <bean id="myTransform" class="com.jacky.test.MyTransform">
         <property name="prefix" value="SpringDSL"/>
         </bean>
      
      </beans>
      

       

      pom.xml

      <?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/maven-v4_0_0.xsd">
          <modelVersion>4.0.0</modelVersion>
      
      
          <groupId>com.jacky.testcamel</groupId>
          <artifactId>test-first-camel</artifactId>
          <packaging>bundle</packaging>
          <version>1.1</version>
          <name>A Camel Spring Route Test</name>
      
      
          <properties>
              <camel.version>2.15.0</camel.version>
          </properties>
      
      
         
          <dependencies>
              <dependency>
                  <groupId>org.apache.camel</groupId>
                  <artifactId>camel-core</artifactId>
                  <version>${camel.version}</version>
              </dependency>
              <dependency>
                  <groupId>org.apache.camel</groupId>
                  <artifactId>camel-stream</artifactId>
                  <version>${camel.version}</version>
              </dependency>
              <dependency>
                  <groupId>org.apache.camel</groupId>
                  <artifactId>camel-jms</artifactId>
                  <version>${camel.version}</version>
              </dependency>
              <!--<dependency>-->
                  <!--<groupId>org.apache.activemq</groupId>-->
                  <!--<artifactId>activemq-camel</artifactId>-->
                  <!--<version>5.6.0</version>-->
              <!--</dependency>-->
              <dependency>
                  <groupId>org.springframework</groupId>
                  <artifactId>spring-context</artifactId>
                  <version>4.1.5.RELEASE</version>
              </dependency>
              <dependency>
                  <groupId>org.apache.camel</groupId>
                  <artifactId>camel-spring</artifactId>
                  <version>${camel.version}</version>
              </dependency>
              <dependency>
                  <groupId>org.slf4j</groupId>
                  <artifactId>slf4j-simple</artifactId>
                  <version>1.7.12</version>
              </dependency>
      
      
      
      
          </dependencies>
      
      
      
      
          <build>
              <defaultGoal>install</defaultGoal>
              <resources>
                  <resource>
                      <directory>src/main/resources</directory>
                      <filtering>true</filtering>
                  </resource>
              </resources>
              <plugins>
                  <plugin>
                      <groupId>org.apache.maven.plugins</groupId>
                      <artifactId>maven-resources-plugin</artifactId>
                      <executions>
                          <execution>
                              <phase>process-resources</phase>
                              <goals>
                                  <goal>resources</goal>
                              </goals>
                          </execution>
                      </executions>
                      <version>2.7</version>
                  </plugin>
                  <plugin>
                      <groupId>org.apache.camel</groupId>
                      <artifactId>camel-maven-plugin</artifactId>
                      <configuration>
                          <fileApplicationContextUri>src/main/resources/applicationContext.xml</fileApplicationContextUri>
                      </configuration>
                      <version>2.15.3</version>
                  </plugin>
                  <plugin>
                      <groupId>io.fabric8</groupId>
                      <artifactId>fabric8-maven-plugin</artifactId>
                      <version>2.2.22</version>
                      <configuration>
                          <profile>com.jacky.testcamel-test-first-camel</profile>
                      </configuration>
                  </plugin>
      
      
                  <plugin>
                      <groupId>org.apache.felix</groupId>
                      <artifactId>maven-bundle-plugin</artifactId>
                      <version>2.4.0</version>
                      <extensions>true</extensions>
                      <configuration>
                          <instructions>
                              <Bundle-SymbolicName>fabricdemo</Bundle-SymbolicName>
                              <Bundle-Name>${project.name}</Bundle-Name>
                              <Bundle-Version>${project.version}</Bundle-Version>
                              <Export-Package>com.jacky.test.*</Export-Package>
                              <Import-Package>*</Import-Package>
                          </instructions>
                      </configuration>
                  </plugin>
      
      
                  <plugin>
                      <groupId>org.codehaus.mojo</groupId>
                      <artifactId>build-helper-maven-plugin</artifactId>
                      <executions>
                          <execution>
                              <id>attach-artifacts</id>
                              <phase>package</phase>
                              <goals>
                                  <goal>attach-artifact</goal>
                              </goals>
                              <configuration>
                                  <artifacts>
                                      <artifact>
                                          <file>target/classes/features.xml</file>
                                          <type>xml</type>
                                          <classifier>features</classifier>
                                      </artifact>
                                  </artifacts>
                              </configuration>
                          </execution>
                      </executions>
                      <version>1.9.1</version>
                  </plugin>
              </plugins>
          </build>
      
      
      </project>
      

       

      features.xml

       

      <?xml version="1.0" encoding="UTF-8"?>
      <features>
          <repository>mvn:org.apache.camel.karaf/apache-camel/${project.version}/xml/features</repository>
          
          <feature name='camel-example-osgi' version='${project.version}'>
              <feature version="${project.version}">camel-spring</feature>
              <bundle>mvn:org.apache.camel/camel-example-osgi/${project.version}</bundle>
          </feature>
      
      
      </features>
      

       

      I did use the mvn clean -Dmaven.test.skip=true install -X to install this bundle first, then use nvn -X fabric8:deploy to create the profile.

       

      In the jboss fuse command line

      I did use

      fabric:profile-edit --repository mvn:com.jacky.testcamel/test-first-came/1.1/xml/features com.jacky.testcamel-test-first-camel

      fabric:profile-edit --feature test-first-came/0.0.0 com.jacky.testcamel-test-first-camel

      to install the feature in the profile. then it seems run into the above errors.

      I tried the example in osgi, and it is working properly, but I am wondering why it does not work in my own customized project.

       

      I did create the maven settings.xml from the jboss fuse studio, in the .m2 folder. everything seems correct. Please help me for the error. I have tried to post all the information that I have and attach the whole project and maven settings.xml. If you need more, please let me know.

       

      Thank you