7 Replies Latest reply on Dec 18, 2008 12:25 PM by Adam Warski

    Joined inheritance strategy not supported for versioning!

    Louie Liu Newbie

      I have the versioned joined entities with Joined inheritance strategy. When I run the hbm2ddl tool to generate the schema, I got the following error:

      Dec 16, 2008 1:17:29 PM org.hibernate.validator.Version <clinit>
      INFO: Hibernate Validator 3.1.0.GA
      [hibernatetool] An exception occurred while running exporter #2:hbm2ddl (Generates database schema)
      [hibernatetool] To get the full stack trace run ant with -verbose
      [hibernatetool] org.hibernate.MappingException: Joined inheritance strategy not supported for versioning!
      [INFO] ------------------------------------------------------------------------
      [ERROR] BUILD ERROR
      [INFO] ------------------------------------------------------------------------
      [INFO] Error executing ant tasks
      
      Embedded error: org.hibernate.MappingException: Joined inheritance strategy not supported for versioning!
      [INFO] ------------------------------------------------------------------------
      [INFO] Trace
      org.apache.maven.lifecycle.LifecycleExecutionException: Error executing ant tasks
       at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:583)
       at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:499)
       at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:478)
       at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330)
       at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:291)
       at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
       at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
       at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
       at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:597)
       at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
       at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
       at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
       at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
      Caused by: org.apache.maven.plugin.MojoExecutionException: Error executing ant tasks
       at org.apache.maven.plugin.antrun.AbstractAntMojo.executeTasks(AbstractAntMojo.java:114)
       at org.apache.maven.plugin.antrun.AntRunMojo.execute(AntRunMojo.java:83)
       at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451)
       at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:558)
       ... 16 more
      Caused by: org.hibernate.MappingException: Joined inheritance strategy not supported for versioning!
       at org.hibernate.tool.ant.HibernateToolTask.reportException(HibernateToolTask.java:226)
       at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:189)
       at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
       at org.apache.tools.ant.Task.perform(Task.java:364)
       at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:64)
       at net.sf.antcontrib.logic.IfTask.execute(IfTask.java:197)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:597)
       at org.apache.tools.ant.TaskAdapter.execute(TaskAdapter.java:123)
       at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
       at org.apache.tools.ant.Task.perform(Task.java:364)
       at org.apache.tools.ant.Target.execute(Target.java:341)
       at org.apache.maven.plugin.antrun.AbstractAntMojo.executeTasks(AbstractAntMojo.java:108)
       ... 19 more
      Caused by: org.hibernate.MappingException: Joined inheritance strategy not supported for versioning!
       at org.jboss.envers.configuration.metadata.VersionsMetadataGenerator.generateFirstPass(VersionsMetadataGenerator.java:307)
       at org.jboss.envers.configuration.EntitiesConfigurator.configure(EntitiesConfigurator.java:84)
       at org.jboss.envers.configuration.VersionsConfiguration.<init>(VersionsConfiguration.java:80)
       at org.jboss.envers.configuration.VersionsConfiguration.getFor(VersionsConfiguration.java:93)
       at org.jboss.envers.ant.JPAConfigurationTaskWithEnvers.doConfiguration(JPAConfigurationTaskWithEnvers.java:33)
       at org.hibernate.tool.ant.ConfigurationTask.getConfiguration(ConfigurationTask.java:55)
       at org.hibernate.tool.ant.HibernateToolTask.getConfiguration(HibernateToolTask.java:302)
       at org.hibernate.tool.ant.Hbm2DDLExporterTask.createExporter(Hbm2DDLExporterTask.java:51)
       at org.hibernate.tool.ant.ExporterTask.execute(ExporterTask.java:39)
       at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:186)
       ... 32 more
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 49 seconds
      [INFO] Finished at: Tue Dec 16 13:17:30 PST 2008
      [INFO] Final Memory: 45M/92M
      [INFO] ------------------------------------------------------------------------
      


      Please let us know how to resolve this issue.

      Thanks.

      Louie Liu

        • 1. Re: Joined inheritance strategy not supported for versioning
          Adam Warski Master

          Hello,

          do you use the trunk Hibernate-envers module, or the preview version from the website?

          --
          Adam

          • 2. Re: Joined inheritance strategy not supported for versioning
            Louie Liu Newbie

            I am using the current Envers production version 1.1.0.GA.

            • 3. Re: Joined inheritance strategy not supported for versioning
              Adam Warski Master

              Well, Hibernate-envers trunk already has this feature, and it should work.

              --
              Adam

              • 4. Re: Joined inheritance strategy not supported for versioning
                Louie Liu Newbie

                Thanks!

                However, the development trunk from hibernate does not compile if I download from the following URL:

                http://anonsvn.jboss.org/repos/hibernate/core/

                I wonder if I can get the source for hibernate 3.4.0-SNAPSHOT which is compile.

                Thanks again.

                Louie

                • 5. Re: Joined inheritance strategy not supported for versioning
                  Adam Warski Master

                  Hello,

                  you have to compile with skipping tests, so that annotations and entity-manager will compile. Just use:
                  mvn -Dmaven.test.skip install
                  and all the necessary artifacts should be installed in your local repo.

                  Adam

                  • 6. Re: Joined inheritance strategy not supported for versioning
                    Louie Liu Newbie

                    Thanks for your help.

                    Now, I can compile the hibernate source and generate the hibernate-envers 3.4.0-SNAPSHOT jar file.

                    This new jar did solve the joined inheritance issue I had before for some simple cases. However, it still failed during the final ddl generation process and throw the following exception:

                    INFO: Hibernate Validator 3.1.0.GA
                    [hibernatetool] An exception occurred while running exporter #2:hbm2ddl (Generates database schema)
                    [hibernatetool] To get the full stack trace run ant with -verbose
                    [hibernatetool] java.lang.NullPointerException
                    [INFO] ------------------------------------------------------------------------
                    [ERROR] BUILD ERROR
                    [INFO] ------------------------------------------------------------------------
                    [INFO] Error executing ant tasks
                    
                    Embedded error: java.lang.NullPointerException
                    [INFO] ------------------------------------------------------------------------
                    [INFO] Trace
                    org.apache.maven.lifecycle.LifecycleExecutionException: Error executing ant tasks
                     at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:583)
                     at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:499)
                     at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:478)
                     at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330)
                     at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:291)
                     at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
                     at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
                     at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
                     at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
                     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                     at java.lang.reflect.Method.invoke(Method.java:597)
                     at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
                     at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
                     at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
                     at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
                    Caused by: org.apache.maven.plugin.MojoExecutionException: Error executing ant tasks
                     at org.apache.maven.plugin.antrun.AbstractAntMojo.executeTasks(AbstractAntMojo.java:114)
                     at org.apache.maven.plugin.antrun.AntRunMojo.execute(AntRunMojo.java:83)
                     at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451)
                     at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:558)
                     ... 16 more
                    Caused by: java.lang.NullPointerException
                     at org.hibernate.tool.ant.HibernateToolTask.reportException(HibernateToolTask.java:226)
                     at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:189)
                     at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
                     at org.apache.tools.ant.Task.perform(Task.java:364)
                     at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:64)
                     at net.sf.antcontrib.logic.IfTask.execute(IfTask.java:197)
                     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                     at java.lang.reflect.Method.invoke(Method.java:597)
                     at org.apache.tools.ant.TaskAdapter.execute(TaskAdapter.java:123)
                     at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
                     at org.apache.tools.ant.Task.perform(Task.java:364)
                     at org.apache.tools.ant.Target.execute(Target.java:341)
                     at org.apache.maven.plugin.antrun.AbstractAntMojo.executeTasks(AbstractAntMojo.java:108)
                     ... 19 more
                    Caused by: java.lang.NullPointerException
                     at org.hibernate.envers.configuration.metadata.AuditMetadataGenerator.generateInheritanceMappingData(AuditMetadataGenerator.java:248)
                     at org.hibernate.envers.configuration.metadata.AuditMetadataGenerator.generateFirstPass(AuditMetadataGenerator.java:296)
                     at org.hibernate.envers.configuration.EntitiesConfigurator.configure(EntitiesConfigurator.java:87)
                     at org.hibernate.envers.configuration.AuditConfiguration.<init>(AuditConfiguration.java:86)
                     at org.hibernate.envers.configuration.AuditConfiguration.getFor(AuditConfiguration.java:99)
                     at org.hibernate.envers.ant.JPAConfigurationTaskWithEnvers.doConfiguration(JPAConfigurationTaskWithEnvers.java:36)
                     at org.hibernate.tool.ant.ConfigurationTask.getConfiguration(ConfigurationTask.java:55)
                     at org.hibernate.tool.ant.HibernateToolTask.getConfiguration(HibernateToolTask.java:302)
                     at org.hibernate.tool.ant.Hbm2DDLExporterTask.createExporter(Hbm2DDLExporterTask.java:51)
                     at org.hibernate.tool.ant.ExporterTask.execute(ExporterTask.java:39)
                     at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:186)
                     ... 32 more
                    [INFO] ------------------------------------------------------------------------
                    [INFO] Total time: 47 seconds
                    [INFO] Finished at: Wed Dec 17 16:02:05 PST 2008
                    [INFO] Final Memory: 43M/81M
                    


                    I will continue figure out what cause this issue from our side and post the test case to you later.

                    At mean time, please let us know what we need to change to make it work.

                    Thanks a lot.

                    Louie Liu

                    Louie

                    • 7. Re: Joined inheritance strategy not supported for versioning
                      Adam Warski Master

                      Hello,

                      so, what are the steps to reproduce the bug?

                      --
                      Thanks,
                      Adam