0 Replies Latest reply on Oct 28, 2012 6:19 AM by malcomtom

    Seam 2.3 Hibernate Envers Problem with Listeners

    malcomtom Newbie

      Dear all,

       

      I was successfully using Hibernate envers in Seam 2.2.2 with Hibernate version 3.3, but when i tried to move to Seam 2.3.

      I got problems when using Envers (i downloaded the matching envers from Hibernate 4.0.1 which seams the version

      Seam 2.3 is using at the Moment. In hibernate.cf.xml i entered the property:

      <property name="hibernate.listeners.envers.autoRegister">true</property>


      This is the stacktrace i got when deploying the application:

      11:07:40,660 INFO  [org.hibernate.engine.transaction.internal.TransactionFactoryInitiator] (MSC service thread 1-8) HHH000399: Using default transaction strategy (direct JDBC transactions)

      11:07:40,666 INFO  [org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory] (MSC service thread 1-8) HHH000397: Using ASTQueryTranslatorFactory

      11:07:40,773 INFO  [org.hibernate.validator.util.Version] (MSC service thread 1-8) Hibernate Validator 4.2.0.Final

      11:07:41,038 ERROR [stderr] (MSC service thread 1-8) Initial SessionFactory creation failed.org.hibernate.MappingException: Unable to create AuditStrategy[org.hibernate.envers.strategy.DefaultAuditStrategy] instance.

       

       

      11:07:41,043 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/TestApp]] (MSC service thread 1-8) Exception sending context initialized event to listener instance of class org.jboss.seam.servlet.SeamListener: java.lang.RuntimeException: exception invoking: observe

        at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:154) [jboss-seam.jar:2.3.0.Final]

        at org.jboss.seam.Component.callComponentMethod(Component.java:2313) [jboss-seam.jar:2.3.0.Final]

        at org.jboss.seam.core.Events.raiseEvent(Events.java:85) [jboss-seam.jar:2.3.0.Final]

        at org.jboss.seam.contexts.ServletLifecycle.endInitialization(ServletLifecycle.java:145) [jboss-seam.jar:2.3.0.Final]

        at org.jboss.seam.init.Initialization.init(Initialization.java:813) [jboss-seam.jar:2.3.0.Final]

        at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:36) [jboss-seam.jar:2.3.0.Final]

        at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3392) [jbossweb-7.0.13.Final.jar:]

        at org.apache.catalina.core.StandardContext.start(StandardContext.java:3850) [jbossweb-7.0.13.Final.jar:]

        at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]

        at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)

        at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)

        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) [rt.jar:1.6.0_35]

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.6.0_35]

        at java.lang.Thread.run(Unknown Source) [rt.jar:1.6.0_35]

      Caused by: java.lang.reflect.InvocationTargetException

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_35]

        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) [rt.jar:1.6.0_35]

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) [rt.jar:1.6.0_35]

        at java.lang.reflect.Method.invoke(Unknown Source) [rt.jar:1.6.0_35]

        at org.jboss.seam.util.Reflections.invoke(Reflections.java:22) [jboss-seam.jar:2.3.0.Final]

        at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:32) [jboss-seam.jar:2.3.0.Final]

        at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56) [jboss-seam.jar:2.3.0.Final]

        at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28) [jboss-seam.jar:2.3.0.Final]

        at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) [jboss-seam.jar:2.3.0.Final]

        at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:77) [jboss-seam.jar:2.3.0.Final]

        at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) [jboss-seam.jar:2.3.0.Final]

        at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44) [jboss-seam.jar:2.3.0.Final]

        at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) [jboss-seam.jar:2.3.0.Final]

        at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107) [jboss-seam.jar:2.3.0.Final]

        at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:186) [jboss-seam.jar:2.3.0.Final]

        at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:104) [jboss-seam.jar:2.3.0.Final]

        ... 12 more

      Caused by: org.hibernate.MappingException: Unable to create AuditStrategy[org.hibernate.envers.strategy.DefaultAuditStrategy] instance.

        at org.hibernate.envers.configuration.AuditConfiguration.initializeAuditStrategy(AuditConfiguration.java:114) [hibernate-envers-4.0.1.Final.jar:4.0.1.Final]

        at org.hibernate.envers.configuration.AuditConfiguration.<init>(AuditConfiguration.java:101) [hibernate-envers-4.0.1.Final.jar:4.0.1.Final]

        at org.hibernate.envers.configuration.AuditConfiguration.getFor(AuditConfiguration.java:135) [hibernate-envers-4.0.1.Final.jar:4.0.1.Final]

        at org.hibernate.envers.event.EnversIntegrator.integrate(EnversIntegrator.java:63) [hibernate-envers-4.0.1.Final.jar:4.0.1.Final]

        at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:294) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]

        at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1737) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]

        at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1775) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]

        ... 76 more

       

      Thanking you in advance for your help. I am really looking forward for getting a possible solution/workaround

       

      best regards

       

      Malcom