2 Replies Latest reply on Nov 14, 2012 3:42 AM by jasonnh

    DB persistence tutorial for Fuse ESB?

    freelancersunion

      Hi, I'm trying to prototype a system that has some DB object persistence, but haven't found much luck finding a tutorial.  I'm open to using openjpa or hibernate, spring or blueprint.  I just want to be able to decorate a model and bundle it for OSGI.

       

      I tried implementing this tutorial:

      https://github.com/cschneider/Karaf-Tutorial/tree/master/db/examplejpa

       

      but it fails to start and I'm left with the following error:

      org.osgi.service.blueprint.container.ComponentDefinitionException: Error when instantiating bean #recipe-1 of class null

       

      Finally, I've noticed that when I install:

      install -s mvn:org.apache.aries/org.apache.aries.util/0.3

       

      subsequent restarts of fuse generate an error:

      ERROR: Bundle org.apache.felix.bundlerepository EventDispatcher: Error during dispatch. (java.lang.NullPointerException)

       

      and if i install:

      install -s mvn:org.apache.aries/org.apache.aries.util/0.4

       

      Two errors are generated and the command line prompt never comes up.

       

      We are hoping to finalize our evaluation of Fuse enterprise but want to be sure that we

      don't have to re-invent the wheel for fundamentals like DB persistence.  Any pointers

      you can offer are appreciated!

       

      Thanks in advance,

      Terence

       

      Edited by: freelancersunion on Nov 13, 2012 6:27 PM

        • 1. Re: DB persistence tutorial for Fuse ESB?
          jasonnh

          Hi,

           

          I have implemented DB object persistence on FUSE 7.0.2 using:

          - hibernate via Spring

          - OpenJPA via blueprint

           

          I used the persistence bundles that come with FUSE.  I would imagine if you try and start with a custom version of hibernate or OpenJPA you are going to struggle as integrating those is not easy.  The same thing with Aries, i.e. I expect upgrading from the one provided in FUSE will have side effects. 

           

          The hibernate versions is old and not JPA 2 - I hope someone from RedHat (FUSE) is listening and will give us an updated version that works easily with blueprint! 

           

          For example, with OpenJPA via blueprint I installed the following features:

          jpa

          camel-jpa

          jndi

           

          and then the following bundles:

          wrap:mvn:

          wrap:mvn:net.sourceforge.serp/serp/1.13.1   (workaround needed for OpenJPA)

           

          There is a good tutorial in Part 1 chapter 3 of the "Enterprise OSGi in Action" book called "Persitence pays off".

           

          Also, if you are using fabric please see:

          http://fusesource.com/forums/thread.jspa?messageID=15697&#15697

           

          And if using property placeholders in your blueprint with jpa camel:

          http://fusesource.com/forums/thread.jspa?messageID=15711&#15711

          • 2. Re: DB persistence tutorial for Fuse ESB?
            jasonnh

            I should add that I was unable to get the hibernate provided with FUSE to work with camel-jpa - I used OpenJPA for that.

             

            Edited by: jasonnh on Nov 14, 2012 8:42 AM