2 Replies Latest reply on Jul 6, 2016 10:43 AM by mraza1

    Autowiring a Spring Bean from a jar

    mraza1

      Hi,

       

      I have a Camel project that reads/writes data to a RabbitMQ. I wanted to add a jar that a co-worker wrote as a dependency and autowire a bean from that jar in my camel project.

       

      I added the jar to the pom file but when I try to deploy the bundle, I get an error saying:

       

      Bundle ID: 334

      Error executing command: Error installing bundles:

              Unable to start bundle mvn:com.company.camel/ExternalWSProcessor/1.0.0: Unresolved constraint in bundle com.company.camel.ExternalWSProcessor [334]: Unable to resolve 334.0: missing requirement [334.0] osgi.wiring.package; (osgi.wiring.package=com.amazonaws.auth)

       

      The jar uses AWS SDK to talk to DynamoDB. Is there a specific way to include Spring jar in a Camel project for it to work on JBoss Fuse? Am I supposed to enable any features in JBoss Fuse? Why do I get "FeatureServices service is unavailable" message when I try to addurl by doing "features:addurl" ?

       

      Thanks,

      Mohammad

        • 1. Re: Autowiring a Spring Bean from a jar
          sonyjop

          Mohammad,

           

          I hope the JAR that your co-worker wrote is an OSGi bundle. things are simpler then. You will have to deploy this bundle/jar into the container you intend your own project bundle to be deployed. eg: osgi:install -s mvn:<your coworkerJar's maven coordinates>.

           

          If it is not an OSGi bundle then you can go ahead do a wrap to the dependency jar while installing.

          eg: osgi:install -s wrap:mvn:<your coworkerJar's maven coordinates>

           

          Hope this will help.

          • 2. Re: Autowiring a Spring Bean from a jar
            mraza1

            Although this did not solve all of my problems, it did solve some of my problems. Thanks!