4 Replies Latest reply on Feb 7, 2011 5:31 AM by gertv

    Help Creating an OSGi Camel Bundle

    niceguyrobb

      I am using Camel routing (http - JMS, JMS - JPA) in a simple proof of concept with other ESBs. Camel itself is working great and I create a bundle using the "org.apache.felix"/"maven-bundle-plugin". Yet when I deploy the resulting JAR into FUSE I get 'Missing Constraint' errors.

       

      If I try to solve this by removing the 'Import-Package' section in the manifest, I get ClassNotFoundExceptions.

       

      If I try to solve it by using "<Embed-Dependency>*;scope=compile|runtime<Embed-Dependency>;" in order to get the dependancies in the JAR, it seems like there are version conflicts.

       

      If I try to use the "org.apache.felix:maven-bundle-plugin:bundleall" goal, I get errors that it cannot find dependant JARs, and the build fails.

       

      Is there a secret step I am missing? What information would any potential helpers need in order to get a clearer picture in order to help?

       

      Edited by: niceguyrobb on Feb 3, 2011 10:30 PM

       

      Edited by: niceguyrobb on Feb 3, 2011 10:30 PM

       

      Edited by: niceguyrobb on Feb 3, 2011 10:31 PM

        • 1. Re: Help Creating an OSGi Camel Bundle
          davsclaus

          Are you using features to install the camel components?

           

          features:install camel-jms

          features:install camel-http

          features:install camel-jpa

           

          And then after that you can install your own bundle.

           

          See more details here http://fusesource.com/docs/esb/4.3.1/esb_deploy_osgi/index.html

          • 2. Re: Help Creating an OSGi Camel Bundle
            niceguyrobb

            Yes that was my first attempt. I have all the 'required' features:install'ed.

             

            I think the issue is with the dependancies. FUSE (Felix) just can't find things. Out of the Box - I deployed Fuse 4.3.0, ran it, installed the features I use (camel, camel-jms, camel-jetty, camel-jpa).

             

            I then deploy'ed my bundle, which was created via the 'org.apache.felix:maven-bundle-plugin:bundle' Maven goal. I would have wanted to use the 'bundleall' goal since my issue is with classes not being found, but that goal errors out continuiously.

             

            After the deploy, FUSE's logs state that the ActiveMQ Broker class cannot be found. I can fix that issue by finding the jar on the Net and depositing in into the LIB directory, but that seems wrong and is just the tip of the iceberg, as the next issue states that another class cannot be found.

             

            Thanks for any help I get. This POC is tryhing to prove out different ESBs based on their usability.

            • 3. Re: Help Creating an OSGi Camel Bundle
              davsclaus

              You can take a look at some of the examples in the Fuse ESB examples directory. There should be some Camel JMS examples. They are all OSGi and should be ready to be installed. Some of the examples provided their own feature file AFAIR.

               

              That would even make installing your own applications much easier as its just one command.

               

              If you still have issues you may have to provide more details such as stacktrace dumps and maybe some sample code.

               

              Fuse ESB 4.3.1 is about to be released. It may be worthwhile to try that release, as its improved over the last release. For example Camel has been upgraded from 2.4 to 2.6.

              • 4. Re: Help Creating an OSGi Camel Bundle
                gertv

                L.S.,

                 

                 

                Can you provide us with the output of the 'osgi:headers ' command, as well as the exception that you're seeing at runtime?  It's a bit hard to guess what's wrong without these bits of information.

                 

                FWIW, the 4.3.1-fuse-00-00 release is available on http://fusesource.com/products/enterprise-servicemix as well

                 

                 

                Regards,

                 

                Gert