Uploaded image for project: 'Tools (JBoss Tools)'
  1. Tools (JBoss Tools)
  2. JBIDE-10361

Code generation fails when Hibernate 4.0 version is used

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Blocker
    • Resolution: Done
    • Affects Version/s: 3.3.0.M5
    • Fix Version/s: 3.3.0.M5
    • Component/s: hibernate
    • Labels:
      None
    • Steps to Reproduce:
      Hide

      1. Create Java project
      2. Create Hibernate Configuration (version 4.0), add HSQLDB driver
      3. Create configuration, connect to HSQL database
      4. Create Hibernate Code Generation Configuration, use Domain code exporter, reverse engineer from JDBC connection
      ERROR: errors and code is not generated, see description and screenshot

      HSQLDB 1.8, Server is used, works good with hibernate console 3.5
      DB data: http://anonsvn.jboss.org/repos/jbosstools/trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/resources/sql/SQL%20Scrapbook%200

      Show
      1. Create Java project 2. Create Hibernate Configuration (version 4.0), add HSQLDB driver 3. Create configuration, connect to HSQL database 4. Create Hibernate Code Generation Configuration, use Domain code exporter, reverse engineer from JDBC connection ERROR: errors and code is not generated, see description and screenshot HSQLDB 1.8, Server is used, works good with hibernate console 3.5 DB data: http://anonsvn.jboss.org/repos/jbosstools/trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/resources/sql/SQL%20Scrapbook%200
    • Workaround Description:
      Hide

      Code generation when Hibernate 3.5 version is used works

      Show
      Code generation when Hibernate 3.5 version is used works

      Description

      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/slf4j/impl/StaticLoggerBinder
      org/slf4j/impl/StaticLoggerBinder
      java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder
      org/slf4j/impl/StaticLoggerBinder
      java.lang.ClassNotFoundException: org.slf4j.impl.StaticLoggerBinder
      org.slf4j.impl.StaticLoggerBinder

      java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder
      at org.slf4j.LoggerFactory.getSingleton(LoggerFactory.java:223)
      at org.slf4j.LoggerFactory.bind(LoggerFactory.java:120)
      at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:111)
      at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:269)
      at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:242)
      at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:255)
      at org.hibernate.tool.hbm2x.AbstractExporter.<init>(AbstractExporter.java:25)
      at org.hibernate.tool.hbm2x.GenericExporter.<init>(GenericExporter.java:77)
      at org.hibernate.tool.hbm2x.POJOExporter.<init>(POJOExporter.java:28)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
      at java.lang.Class.newInstance0(Class.java:355)
      at java.lang.Class.newInstance(Class.java:308)
      at org.jboss.tools.hibernate4_0.console.ExporterDefinition.createExporterInstance(ExporterDefinition.java:128)
      at org.jboss.tools.hibernate4_0.console.ExporterFactory.createConfiguredExporter(ExporterFactory.java:211)
      at org.jboss.tools.hibernate4_0.console.ConsoleExtension4_0$2.execute(ConsoleExtension4_0.java:182)
      at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:63)
      at org.jboss.tools.hibernate4_0.HibernateExtension4_0.execute(HibernateExtension4_0.java:248)
      at org.jboss.tools.hibernate4_0.console.ConsoleExtension4_0.runExporters(ConsoleExtension4_0.java:161)
      at org.jboss.tools.hibernate4_0.console.ConsoleExtension4_0.launchExporters(ConsoleExtension4_0.java:118)
      at org.hibernate.eclipse.launch.CodeGenerationLaunchDelegate.launch(CodeGenerationLaunchDelegate.java:268)
      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.ClassNotFoundException: org.slf4j.impl.StaticLoggerBinder
      at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
      at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
      at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
      at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
      ... 28 more

      java.lang.ExceptionInInitializerError
      at org.jboss.tools.hibernate4_0.console.ConsoleExtension4_0.buildConfiguration(ConsoleExtension4_0.java:217)
      at org.jboss.tools.hibernate4_0.console.ConsoleExtension4_0.runExporters(ConsoleExtension4_0.java:154)
      at org.jboss.tools.hibernate4_0.console.ConsoleExtension4_0.launchExporters(ConsoleExtension4_0.java:118)
      at org.hibernate.eclipse.launch.CodeGenerationLaunchDelegate.launch(CodeGenerationLaunchDelegate.java:268)
      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.IllegalStateException: org.slf4j.LoggerFactory could not be successfully initialized. See also http://www.slf4j.org/codes.html#unsuccessfulInit
      at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:276)
      at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:242)
      at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:255)
      at org.hibernate.cfg.JDBCMetaDataConfiguration.<clinit>(JDBCMetaDataConfiguration.java:31)
      ... 9 more

        Gliffy Diagrams

          Attachments

          1. code-generation-4.0.png
            code-generation-4.0.png
            40 kB
          2. hb4.log
            6 kB
          3. hb4dlg.png
            hb4dlg.png
            40 kB

            Activity

              People

              • Assignee:
                dgeraskov Dmitry Geraskov
                Reporter:
                jpeterka Jiri Peterka
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: