5 Replies Latest reply on May 13, 2014 10:48 PM by arevalo0o

    Error installing custom feature with Smooks dependency.

    arevalo0o

      Hi,

       

      I'm recently experimenting with JBoss Fuse 6.1 and I'm facing a problem with a small project that is based on the rider-auto-osgi[*] example, but I have added the smooks dependency in order to use the SmooksDataFormat class, I have in the respective pom.xml something like this:

       

      <dependency>

        <groupId>org.milyn</groupId>

        <artifactId>milyn-smooks-all</artifactId>

        <version>${smooks-version}</version><!-- 1.5.2 -->

      </dependency>

       

      Also I have added in the features.xml:

      <features name="project-transport-osgi" xmlns="http://karaf.apache.org/xmlns/features/v1.0.0">

          ...

         <repository>mvn:org.milyn/milyn-smooks-all/1.5.2/xml/features</repository>

       

        <feature version="${project.version}" name="project-name">

                  <feature>smooks</feature>

           ...

        </feature>

      </features>

       

      But when I try to install this custom feature (using feature:install) I get the next error message:

      Error executing command: URL [mvn:commons-lang/commons-lang/${commons.lang.version}] could not be resolved.

       

      And this is part of the stack trace:

      java.lang.RuntimeException: URL [mvn:commons-lang/commons-lang/${commons.lang.version}] could not be resolved.

        at org.ops4j.pax.url.mvn.internal.Connection.getInputStream(Connection.java:195)[1:org.ops4j.pax.url.mvn:1.3.7]

        at java.net.URL.openStream(URL.java:1010)[:1.6.0_45]

        at org.apache.karaf.features.internal.FeaturesServiceImpl.installBundleIfNeeded(FeaturesServiceImpl.java:775)[22:org.apache.karaf.features.core:2.3.0.redhat-610379]

       

      I have tried with other smooks versions but I get the same error, also if I remove the smook's feature specification from my features.xml  I get the next error:

      missing requirement [284.0] osgi.wiring.package; (&(osgi.wiring.package=org.milyn.smooks.camel.dataformat)(version>=1.5.0)(!(version>=2.0.0)))

       

      So if someone has faced the same problem and found a solution, I would be really grateful  for your help.

       

      Thank you in advance

       

      [*] FuseByExample/rider-auto-osgi · GitHub

        • 1. Re: Error installing custom feature with Smooks dependency.
          ffang

          Hi,

           

          Where the url

          mvn:commons-lang/commons-lang/${commons.lang.version}


          comes from?

          The ${commons.lang.version} not get filtered correctly, your need address this first.


          Freeman

          1 of 1 people found this helpful
          • 2. Re: Error installing custom feature with Smooks dependency.
            arevalo0o

            Hi Freeman, thanks for your reply.

             

            I'm not pretty sure where it comes from, but it certainly has something to do with the smooks dependency, if I remove this feature from my project and everything related, I can install it without problem, taking a look to the features.xml of the milyn-smooks-all v1.5.2 it uses the commons-lang bundle but the URL looks ok.

             

            <?xml version="1.0" encoding="UTF-8"?>

            <features name="milyn-1.5.2">

              <feature name="smooks" version="1.5.2">

                <bundle>mvn:org.antlr/com.springsource.antlr/2.7.7</bundle>

                <bundle>mvn:org.freemarker/com.springsource.freemarker/2.3.15</bundle>

                <!-- Karaf comes with pax-logging and slf4j; the following logging jars should not be required -->

                <!--<bundle>mvn:org.apache.commons/com.springsource.org.apache.commons.logging/1.1.1</bundle>-->

                <!--<bundle>mvn:org.apache.log4j/com.springsource.org.apache.log4j/1.2.15</bundle>-->

                <bundle>mvn:org.codehaus.groovy/com.springsource.org.codehaus.groovy/1.5.7</bundle>

                <bundle>mvn:org.jaxen/com.springsource.org.jaxen/1.1.1</bundle>

                <bundle>mvn:org.objectweb.asm/com.springsource.org.objectweb.asm/2.2.3</bundle>

                <bundle>mvn:org.objectweb.asm/com.springsource.org.objectweb.asm.tree/2.2.3</bundle>

                <bundle>mvn:org.objectweb.asm/com.springsource.org.objectweb.asm.tree.analysis/2.2.3</bundle>

                <bundle>mvn:org.objectweb.asm/com.springsource.org.objectweb.asm.util/2.2.3</bundle>

                <bundle>mvn:commons-lang/commons-lang/2.4</bundle>

                <bundle>mvn:org.ow2.bundles/ow2-bundles-externals-opencsv/1.0.23</bundle>

                <bundle>mvn:org.milyn/milyn-smooks-all/1.5.2</bundle>

              </feature>

            </features>

             

            I took this from the jar milyn-smooks-all-1.5.2.jar that is in my maven repository.

             

            So I really don't know where this URL comes from.

             

            Regards

            • 3. Re: Error installing custom feature with Smooks dependency.
              arevalo0o

              Hi,

               

              Just trying to find where this URL comes from, I used a grep command (grep -rnw "commons\.lang\.version" --include \*.pom --include \*.xml) to find in my maven repository where this ${commons.lang.version} is used, and I found this:

              org/milyn/milyn-smooks-all/1.6-SNAPSHOT/milyn-smooks-all-1.6-SNAPSHOT-features.xml:16:    <bundle>mvn:commons-lang/commons-lang/${commons.lang.version}</bundle>

               

              So I realized that in a previous test installing my project, I was using a built of Smooks 1.6 that I made by myself , so maybe this milyn-smooks-all-1.6-SNAPSHOT-features.xml was making the problem. I don't know if JBoss Fuse has some kind of cache, or maybe I made a mistake and didn't build the project using the 1.5.2 version of smooks. So I just replaced my JBoss Fuse, and tried again, and now I can install the project without problem.

               

              Thanks for all your help.

               

              Regards

              • 4. Re: Error installing custom feature with Smooks dependency.
                ffang

                Hi,

                 

                Great you've make it work.

                 

                Normally you can use

                features:list|grep smooks

                to figure out what's the feature version you used.

                 

                Freeman

                • 5. Re: Error installing custom feature with Smooks dependency.
                  arevalo0o

                  Thanks a lot Freeman, this is a really useful tip.