2 Replies Latest reply on Aug 24, 2012 3:02 AM by Claus Ibsen

    How to resolve dependencies related to hibernate in Fuse ESB.

    Sarfaraj Sayyad Newbie

      I am not able to get the db operations working using hibernate in Fuse ESB. I am using oracle database and reading from the database table in the camel-context route using hibernate.


      Actually when I run the camel-context locally from Fuse IDE, the db operations work, but when I bundle the project and deploy it in Fuse ESB I am unable to resolve the dependencies related to hibernate.


      Installing the project bundle into Fuse ESB gives following dependency errors related to hibernate:

      1. Class not found - org/hibernate/ejb/HibernatePersistence

         To fix this I installed hibernate-entitymanager-3.6.2.Final.jar, I bundled the jar using bnd tool and then  installed it in servicemix. I also put in this package under <Importe-Package> in bundle plugin in my project pom.xml.  This resolved the dependency error .

      2. Next error is Class not found - org/hibernate/MappingException

         For this I can install either hibernate-core-3.6.2.Final or hibernate-3.6.2.Final ( aggregate jar).

         But when I install any of these jars the hibernate-entitymanager installed in (1) above fails saying that it exports org.hibernate.engine which is also exported by hibernate-core.


      How can I solve this error ? Actually most of the hibernate jars have duplicate packages in them.

         For e.g.

         hibernate-core, hibernate and hibernate-entitymanager having org.hibernate.engine.

         Also org.hibernate.annotations package is present in multiple jars.


      How can these jars co-exists in Fuse ESB if I need to install all of them? How can I get this dependency resolved ?