6 Replies Latest reply on Jul 24, 2015 9:35 AM by maxandersen

    Please help me solve this problem i have with hibernate tools.Thanks

    geogeorge

      Hello i'm trying to generate pojos and mapping files from my database but I get the following error(s) on eclipse rcp indigo 3.7.2 with hibernate tools 3.4.0.v20120611-2017-H93-Final plugin installed and hibernate 3.6.10 jars (i didn't use maven but they seem to be all) in my build path

       

      SHORT VERSION :

       

      org.hibernate.console.HibernateConsoleRuntimeException: Received a NoClassDefFoundError, probably the console configuration classpath is incomplete or contains conflicting versions of the same class
      Received a NoClassDefFoundError, probably the console configuration classpath is incomplete or contains conflicting versions of the same class
        java.lang.NoClassDefFoundError: Could not initialize class org.hibernate.cfg.reveng.OverrideRepository
      Could not initialize class org.hibernate.cfg.reveng.OverrideRepository
      java.lang.NoClassDefFoundError: Could not initialize class org.hibernate.cfg.reveng.OverrideRepository
          Could not initialize class org.hibernate.cfg.reveng.OverrideRepository


      MY jars from the project buildpath are ( in order if that matters):

      hibernate-distribution-3.6.10.Final\hibernate3.jar

      hibernate-distribution-3.6.10.Final\lib\required\antlr-2.7.6.jar

      hibernate-distribution-3.6.10.Final\lib\required\commons-collections-3.1.jar

      hibernate-distribution-3.6.10.Final\lib\required\dom4j-1.6.1.jar

      hibernate-distribution-3.6.10.Final\lib\required\javassist-3.12.0.GA.jar

      hibernate-distribution-3.6.10.Final\lib\required\jta-1.1.jar

      hibernate-distribution-3.6.10.Final\lib\required\slf4j-api-1.6.1.jar

      postgresql-9.0-802.jdbc3.jar

       

      I noticed that hibernate tools  plugin has a few older jars in its plugins folder BTW( slf4j for example being version 1.5.8).


      Any other info i should provide?

       

       

      NORMAL STACKTRACE

       

      !ENTRY org.hibernate.eclipse.console 4 666 2012-06-25 04:23:55.946

      !MESSAGE org.hibernate.console.HibernateConsoleRuntimeException: Received a NoClassDefFoundError, probably the console configuration classpath is incomplete or contains conflicting versions of the same class

      !STACK 0

      org.hibernate.console.HibernateConsoleRuntimeException: Received a NoClassDefFoundError, probably the console configuration classpath is incomplete or contains conflicting versions of the same class

      at org.jboss.tools.hibernate3_6.console.ConsoleExtension3_6.launchExporters(ConsoleExtension3_6.java:149)

      at org.hibernate.eclipse.launch.CodeGenerationLaunchDelegate.launch(CodeGenerationLaunchDelegate.java:270)

      at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:854)

      at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:703)

      at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:928)

      at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1132)

      at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

      Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.hibernate.cfg.reveng.OverrideRepository

      at org.jboss.tools.hibernate3_6.console.ConsoleExtension3_6$3.execute(ConsoleExtension3_6.java:249)

      at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:63)

      at org.jboss.tools.hibernate3_6.HibernateExtension3_6.execute(HibernateExtension3_6.java:201)

      at org.jboss.tools.hibernate3_6.console.ConsoleExtension3_6.buildConfiguration(ConsoleExtension3_6.java:239)

      at org.jboss.tools.hibernate3_6.console.ConsoleExtension3_6.runExporters(ConsoleExtension3_6.java:169)

      at org.jboss.tools.hibernate3_6.console.ConsoleExtension3_6.launchExporters(ConsoleExtension3_6.java:126)

      ... 6 more

      !SUBENTRY 1 org.hibernate.eclipse.console 4 666 2012-06-25 04:23:55.946

      !MESSAGE org.hibernate.console.HibernateConsoleRuntimeException: Received a NoClassDefFoundError, probably the console configuration classpath is incomplete or contains conflicting versions of the same class

      !STACK 0

      org.hibernate.console.HibernateConsoleRuntimeException: Received a NoClassDefFoundError, probably the console configuration classpath is incomplete or contains conflicting versions of the same class

      at org.jboss.tools.hibernate3_6.console.ConsoleExtension3_6.launchExporters(ConsoleExtension3_6.java:149)

      at org.hibernate.eclipse.launch.CodeGenerationLaunchDelegate.launch(CodeGenerationLaunchDelegate.java:270)

      at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:854)

      at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:703)

      at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:928)

      at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1132)

      at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

      Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.hibernate.cfg.reveng.OverrideRepository

      at org.jboss.tools.hibernate3_6.console.ConsoleExtension3_6$3.execute(ConsoleExtension3_6.java:249)

      at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:63)

      at org.jboss.tools.hibernate3_6.HibernateExtension3_6.execute(HibernateExtension3_6.java:201)

      at org.jboss.tools.hibernate3_6.console.ConsoleExtension3_6.buildConfiguration(ConsoleExtension3_6.java:239)

      at org.jboss.tools.hibernate3_6.console.ConsoleExtension3_6.runExporters(ConsoleExtension3_6.java:169)

      at org.jboss.tools.hibernate3_6.console.ConsoleExtension3_6.launchExporters(ConsoleExtension3_6.java:126)

      ... 6 more

      !SUBENTRY 1 org.hibernate.eclipse.console 4 666 2012-06-25 04:23:55.946

      !MESSAGE java.lang.NoClassDefFoundError: Could not initialize class org.hibernate.cfg.reveng.OverrideRepository

      !STACK 0

      java.lang.NoClassDefFoundError: Could not initialize class org.hibernate.cfg.reveng.OverrideRepository

      at org.jboss.tools.hibernate3_6.console.ConsoleExtension3_6$3.execute(ConsoleExtension3_6.java:249)

      at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:63)

      at org.jboss.tools.hibernate3_6.HibernateExtension3_6.execute(HibernateExtension3_6.java:201)

      at org.jboss.tools.hibernate3_6.console.ConsoleExtension3_6.buildConfiguration(ConsoleExtension3_6.java:239)

      at org.jboss.tools.hibernate3_6.console.ConsoleExtension3_6.runExporters(ConsoleExtension3_6.java:169)

      at org.jboss.tools.hibernate3_6.console.ConsoleExtension3_6.launchExporters(ConsoleExtension3_6.java:126)

      at org.hibernate.eclipse.launch.CodeGenerationLaunchDelegate.launch(CodeGenerationLaunchDelegate.java:270)

      at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:854)

      at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:703)

      at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:928)

      at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1132)

      at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

       

      L.E.: The first time i tried to use code generation i received this error :

      org.hibernate.console.HibernateConsoleRuntimeException: Received a NoClassDefFoundError, probably the console configuration classpath is incomplete or contains conflicting versions of the same class Received a NoClassDefFoundError, probably the console configuration classpath is incomplete or contains conflicting versions of the same class   java.lang.NoClassDefFoundError: org/objectweb/asm/Type   org/objectweb/asm/Type java.lang.NoClassDefFoundError: org/objectweb/asm/Type org/objectweb/asm/Type     java.lang.ClassNotFoundException: org.objectweb.asm.Type     org.objectweb.asm.Type

       

      After that i got only the cfg.reveng.OverrideRepository error

       

      Thanks


        • 1. Re: Please help me solve this problem i have with hibernate tools.Thanks
          dgolovin

          What version is selected in Hibernate Console Configuration properties? Is it 3.6?

          console-config.png

          • 2. Re: Please help me solve this problem i have with hibernate tools.Thanks
            geogeorge

            I am positive.And i have double checked

            I have just installed  a clean eclipse indigo 3.7.2 ( rhis one- http://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/indigo/SR2/eclipse-modeling-indigo-SR2-win32.zip) and a new workspace +added hibernate tools via eclipse "install new software " option. I have not yet added the hibernate 3.6.10 jars to the build path. Just the jdbc4 jar for postgres 9.0 ( the newest jar version i found for my pg). i got the following error after trying to generate hibernate mapping files from a new databse.

            i get the following error

            org.hibernate.console.HibernateConsoleRuntimeException: Received a NoClassDefFoundError, probably the console configuration classpath is incomplete or contains conflicting versions of the same class
            Received a NoClassDefFoundError, probably the console configuration classpath is incomplete or contains conflicting versions of the same class
              java.lang.NoClassDefFoundError: org/objectweb/asm/Type
              org/objectweb/asm/Type
            java.lang.NoClassDefFoundError: org/objectweb/asm/Type
            org/objectweb/asm/Type
                java.lang.ClassNotFoundException: org.objectweb.asm.Type
                org.objectweb.asm.Type

             


             

            Here's how my proj  looked like when i got the error

            http://img11.imageshack.us/img11/9076/ss20120625263721.png

            if i add the other jars like  in the next picture

            http://img542.imageshack.us/img542/4963/ss20120625255021.png

            i get the following error:

             

            org.hibernate.console.HibernateConsoleRuntimeException: Received a NoClassDefFoundError, probably the console configuration classpath is incomplete or contains conflicting versions of the same class

            org.hibernate.console.HibernateConsoleRuntimeException: Received a NoClassDefFoundError, probably the console configuration classpath is incomplete or contains conflicting versions of the same class

            Received a NoClassDefFoundError, probably the console configuration classpath is incomplete or contains conflicting versions of the same class

              java.lang.NoClassDefFoundError: Could not initialize class org.hibernate.cfg.reveng.OverrideRepository

              Could not initialize class org.hibernate.cfg.reveng.OverrideRepository

                java.lang.NoClassDefFoundError: Could not initialize class org.hibernate.cfg.reveng.OverrideRepository

                Could not initialize class org.hibernate.cfg.reveng.OverrideRepository

             


            • 3. Re: Please help me solve this problem i have with hibernate tools.Thanks
              geogeorge

              Hi,

              Solved this one. It was a matter of removing some hibernate 3.6 jars which were apparently conflicting with the hibernate-tools  plugin's own jars.

              Here's what you need to do to succesfully reverse engineer the database tables without getting the errors i got:

              you must have in the project build path only the hibernate3.jar and the jdbc driver ( in my case postgresql-9.0-blabla.jar), the others (antlr, dom4j, slf4j, jta,etc.) should be removed; i have not tried to reverse-engineer in JPA mode but i reckon you'll have to keep the hinernate-jpa-2.0-api-blabla.jar in your project's build path.

              After you finished using hibernate-tools plugin you must include the other jars because otherwise the hibernate code won't work ( i think, i haven't tested yet, but if the documentation for 3.6 says so... ) .

               

              If anyone  has anything to add please take the time and do it, as i have.

              Thanks

              • 4. Re: Please help me solve this problem i have with hibernate tools.Thanks
                maxandersen

                Hi,

                 

                This should not happen - could you please open a bug report on https://jira.jboss.org/jira/browse/JBIDE optimally with a small test project showing the problem ?

                 

                Thanks!

                • 5. Re: Please help me solve this problem i have with hibernate tools.Thanks
                  acisser

                  I ran into the same trouble and found the solution of Denis Golovin is working for me. I selected Hibernate 3.5 in the Edit Launch Configuration Properties window. Aditionally I took hibernate3.jar and hibernate-tools.jar (If you are using reverse configuration control) from plugins to resolve compilation problems on my project. I test it with JPA 2 Type Console. And voila everything workins as ever.

                   

                  Thanks you all.

                  • 6. Re: Please help me solve this problem i have with hibernate tools.Thanks
                    kunalsumbly

                    wonder why change to 3.5 worked. Any idea?

                    • 7. Re: Please help me solve this problem i have with hibernate tools.Thanks
                      maxandersen

                      in older versions of jbosstools hibernatetools bundled/incldued most of hibernate 3.5 and some often used dependencies.

                       

                      As hibernate 4.x versions got released and some libraries became incompatible we had to dynamically load the hibernate jars *BUT* we also can't always know which jars are needed - thus we allow user to add them too.

                       

                      If 3.5 works for you, it is probably because you are using version of jbosstools where hibernate 3.5 is bundled, but if you use a more recent version you will have to add any custom jars your classes needed to the classpath of the project/console configuration.