3 Replies Latest reply on Dec 24, 2009 11:03 AM by zlosny

    Problem with class loading in OSGi

    zlosny

      Hello all,

       

      I'm trying to deploy an osgi bundle that uses Hibernate into the fuse esb. As I have seen in the previous topics, the one possible way to bundle Hibernate as osgi is to embed its jars into the bundle. So I did the following.

       

      I used for all dependencies their bundle equivalent and deployed them as bundles into fuse. all of them seems to be ok:

       

      Apache Commons Logging (1.1.1)

      Apache Commons Bean Utilities (1.8.0)

      Apache Commons Lang (2.4.0)

      Google Collections Library (0.8.0.20080820)

      Java Persistence API (1.99.0)

      MySQL AB's JDBC Driver for MySQL (5.1.6)

      Apache Commons Collections (3.2.1)

      dom4j DOM Processor (1.6.1)

      ObjectWeb ASM (1.5.3)

      JBoss Hibernate Common Annotations (3.3.0.ga)

      JBoss Hibernate Object-Relational Mapper (3.3.2.GA)

      JGroups Toolkit (2.5.1)

      CGLIB Code Generation Library (2.2.0)

      Javassist Java Programming Assistant (3.9.0.GA)

      ANTLR (2.7.7)

      my-persistence-bundle (1.0.0.SNAPSHOT)

       

      but the Hibernate annotations jar I embedded inside the my-persistence-bundle because it is a fragment bundle and does not work correctly in the fuse esb. This is my pom file of the my-persistence-bundle.

       

       

      ...

       

      The Felix plugin works ok and puts hibernate-annotations classes (or the jar if I want so) inside the bundle. But when I try to use one of the classes from hibernate-annotations in PersistenceActivator I get java.lang.NoClassDefFoundError: org/hibernate/cfg/AnnotationConfiguration.

       

      Could you help me with this? I've been stuck with it for couple of days...