5 Replies Latest reply on Feb 20, 2010 4:01 AM by adamw

    Updating to 1.2.2 - Type not supported: org.hibernate.type.ManyToOneType

      We've been using Envers 1.2.1.GA w/ Hibernate 3.3.2.GA for some time now.  I'm attempting to update to 1.2.2 to make use of the RelationTargetAuditMode.NOT_AUDITED feature.  However, simply dropping the new library in place with no code changes gives the attached stack trace.  Truncated version below.

       

      Including the RelationTargetAuditMode.NOT_AUDITED parameter or @NotAudited on all audited ManyToOne relationships made no difference.


      org.jboss.seam.InstantiationException: Could not instantiate Seam component: org.jboss.seam.ioc.spring.contextLoader

      ...

      Caused by: org.hibernate.HibernateException: could not init listeners

      ...

      Caused by: org.hibernate.MappingException: Type not supported: org.hibernate.type.ManyToOneType
          at org.hibernate.envers.configuration.metadata.IdMetadataGenerator.addIdProperties(IdMetadataGenerator.java:71)
          at org.hibernate.envers.configuration.metadata.IdMetadataGenerator.addId(IdMetadataGenerator.java:107)
          at org.hibernate.envers.configuration.metadata.AuditMetadataGenerator.generateFirstPass(AuditMetadataGenerator.java:380)
          at org.hibernate.envers.configuration.EntitiesConfigurator.configure(EntitiesConfigurator.java:102)
          at org.hibernate.envers.configuration.AuditConfiguration.<init>(AuditConfiguration.java:86)
          at org.hibernate.envers.configuration.AuditConfiguration.getFor(AuditConfiguration.java:99)
          at org.hibernate.envers.event.AuditEventListener.initialize(AuditEventListener.java:315)
          at org.hibernate.event.EventListeners$1.processListener(EventListeners.java:198)
          at org.hibernate.event.EventListeners.processListeners(EventListeners.java:181)
          at org.hibernate.event.EventListeners.initializeListeners(EventListeners.java:194)
          ... 173 more

       

      I'm trying to add relationships like below.  This relationship, without the targetAuditMode parameter, worked successfully in 1.2.1.  SomeEntity was not audited in 1.2.1 and was a static dictionary object, so I didn't have to worry about an Audit join table or an audit table for SomeEntity.  The column would be correctly filled in the audit table.  However, under 1.2.2 the same code does not deploy.

       

          @ManyToOne( fetch = FetchType.LAZY )
          @JoinColumn( name="SOME_ID", nullable=true )
          @Audited(targetAuditMode = RelationTargetAuditMode.NOT_AUDITED)
          private SomeEntity       someEntity;