5 Replies Latest reply on Jul 3, 2008 7:50 AM by adamw

    Hibernate 3.3?

    talios

      I was just trying a recent trunk snapshot of envers and noticed there was now a requirement/dependency of org.hibernate.cache.access.* which is only available in the Hibernate 3.3.0-CR1 codebase...

      After throwing 3.3.0 in my app I see:

      2008-07-02 17:29:00,248 [FelixDispatchQueue] ERROR nz.co.smx.entity.hibernate.impl.HibernateUtilImpl - could not init listeners
      org.hibernate.AssertionFailure: could not init listeners
       at org.hibernate.event.EventListeners.initializeListeners(EventListeners.java:199)
       at org.hibernate.cfg.Configuration.getInitializedEventListeners(Configuration.java:1315)
       at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1304)
       at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:859)
       at nz.co.smx.entity.hibernate.impl.HibernateUtilImpl.bindSessionFactory(HibernateUtilImpl.java:100)
      


      The requirement for 3.3.0 may be triggered by my OSGi bundlizing of envers, but has anyone got this working with 3.3.0?

        • 1. Re: Hibernate 3.3?
          adamw

          Hello,

          that's right, there is a class bundled for hibernate 3.3 support, but it should get loaded (referenced) only if you're using hibernate 3.3. See line 490 of this file:

          http://fisheye.jboss.org/browse/envers/trunk/src/main/org/jboss/envers/metadata/VersionsMetadataGenerator.java?r=HEAD

          Hibernate 3.2.4 and 3.2.6 should work fine. The exception doesn't contain to much information, there's nothing more above that? I've run the tests on 3.3 and they worked, though it's not an OSGi environment.

          Adam

          • 2. Re: Hibernate 3.3?
            talios

            Hrm - if org.jboss.envers.entity.VersionsInheritanceEntityPersisterFor330 was in its own package I could simply exclude that from my OSGi bundle, as it is - OSGi picks up the class and pulls in a requirement for org.hibernate.cache.access

            For now a workaround I can do is to manually delete that class from the jar file.

            • 3. Re: Hibernate 3.3?
              adamw

              Ah, so OSGi scans the jar and loads every class? I guess I'll just provide two packages, for hibernate 3.2.x and 3.3.x. For now, if you're building from source, you can simply comment out the second < javac > task from the "build" target in build.xml (line 136)

              Adam

              • 4. Re: Hibernate 3.3?
                talios

                OSGi itself doesn't do this, but the bnd tool used to help managing your manifest files does.

                OSGi works by Importing/Exporting packages from various bundles, the bnd tool is scaning the jar and finding this class and added to the manifest that the package uses org.hibernate.cache.access.

                This in turn triggers the OSGi framework so stand up and shout "hey, something in your bundle uses/needs xxx, but its not here...".

                A separate package would be great - thanks.

                • 5. Re: Hibernate 3.3?
                  adamw

                  Hello,

                  I've uploaded the separate packages, for hibernate 3.2.x and 3.3.x:

                  http://www.jboss.org/envers/downloads/development

                  Or if you're building from source, use a dist-32/dist-33 target.

                  Adam