3 Replies Latest reply on Nov 22, 2012 4:53 PM by Thomas Frühbeck

    Forge hibernate plugin not work with 10g Release 10.2.0.1.0

    Alcides Nolasco Newbie

      Last login: Tue Sep 18 12:07:27 on ttys001

      Alcides-MacBook-Pro:~ alcides$ cd example

      Alcides-MacBook-Pro:example alcides$ forge

          _____                   

         |  ___|__  _ __ __ _  ___

         | |_ / _ \| `__/ _` |/ _ \  \\

         |  _| (_) | | | (_| |  __/  //

         |_|  \___/|_|  \__, |\___|

                         |___/     

       

       

      JBoss Forge, version [ 1.0.7-SNAPSHOT ] - JBoss, by Red Hat, Inc. [ http://jboss.org/forge ]

      [example] example $ generate-entities --pathToDriver /Users/alcides/Downloads/ojdbc14.jar --url "jdbc:oracle:thin:@192.168.1.5:1522:synergy" --user seguridad --schema seguridad --dialect org.hibernate.dialect.OracleDialect --driver oracle.jdbc.OracleDriver

      ? Enter the password for JDBC connection. ***

      ? In which package you'd like to generate the entities, or enter for default: [net.synergyca.model]

      ***ERROR*** An unexpected error happened during reverse engineering.

      org.hibernate.cfg.JDBCBinderException: Duplicate class name 'net.synergyca.model.Syscatalog' generated for 'org.hibernate.mapping.Table(SYS.SYSCATALOG_)'. Same name where generated for 'org.hibernate.mapping.Table(SYS.SYSCATALOG_)'

                at org.hibernate.cfg.JDBCBinder.createPersistentClasses(JDBCBinder.java:173)

                at org.hibernate.cfg.JDBCBinder.readFromDatabase(JDBCBinder.java:94)

                at org.hibernate.cfg.JDBCMetaDataConfiguration.readFromJDBC(JDBCMetaDataConfiguration.java:43)

                at org.hibernate.forge.generate.GenerateEntitiesPlugin$2.run(GenerateEntitiesPlugin.java:514)

                at org.hibernate.forge.generate.GenerateEntitiesPlugin.executeInNewUrlClassLoader(GenerateEntitiesPlugin.java:495)

                at org.hibernate.forge.generate.GenerateEntitiesPlugin.doReverseEngineering(GenerateEntitiesPlugin.java:506)

                at org.hibernate.forge.generate.GenerateEntitiesPlugin.generateEntities(GenerateEntitiesPlugin.java:403)

                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.jboss.forge.shell.command.Execution.perform(Execution.java:134)

                at org.jboss.forge.shell.command.fshparser.FSHRuntime.run(FSHRuntime.java:109)

                at org.jboss.forge.shell.command.fshparser.FSHRuntime.run(FSHRuntime.java:47)

                at org.jboss.forge.shell.ShellImpl$ExecutorThread.run(ShellImpl.java:817)

                at org.jboss.forge.shell.ShellImpl.execute(ShellImpl.java:840)

                at org.jboss.forge.shell.ShellImpl.doShell(ShellImpl.java:630)

                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.jboss.weld.bean.proxy.AbstractBeanInstance.invoke(AbstractBeanInstance.java:48)

                at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:125)

                at org.jboss.forge.shell.ShellImpl$Proxy$_$$_WeldClientProxy.doShell(ShellImpl$Proxy$_$$_WeldClientProxy.java)

                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.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:305)

                at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:54)

                at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:163)

                at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:299)

                at org.jboss.weld.introspector.jlr.WeldMethodImpl.invokeOnInstance(WeldMethodImpl.java:188)

                at org.jboss.weld.introspector.ForwardingWeldMethod.invokeOnInstance(ForwardingWeldMethod.java:59)

                at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:198)

                at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:282)

                at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:265)

                at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:234)

                at org.jboss.weld.manager.BeanManagerImpl.notifyObservers(BeanManagerImpl.java:635)

                at org.jboss.weld.manager.BeanManagerImpl.fireEvent(BeanManagerImpl.java:622)

                at org.jboss.weld.manager.BeanManagerImpl.fireEvent(BeanManagerImpl.java:616)

                at org.jboss.forge.shell.Bootstrap$1.run(Bootstrap.java:173)

                at java.lang.Thread.run(Thread.java:680)

      [example] example $

        • 1. Re: Forge hibernate plugin not work with 10g Release 10.2.0.1.0
          Koen Aers Master

          Hi Alcides,

           

          This is a known issue due to a problem in the version of Hibernate Tools that the Hibernate Tools Forge plugin is using. Last week we finally released Hibernate Tools 4.0.0.CR1, 3.4.0.CR2 and 3.6.0.CR1 for which this issue should have disappeared. I will update the dependencies in the Hibernate Tools Forge plugin shortly so that we finally can generate entities for Oracle ;-)

           

          Thanks for your patience!

           

          Cheers,

          Koen

          • 2. Re: Forge hibernate plugin not work with 10g Release 10.2.0.1.0
            Max McByte Newbie

            Hi Koen;

             

            I have the same issue using Forge as Alcides "***ERROR*** An unexpected error happened during reverse engineering".

             

            What must I do to get Forge to reverse engineer tables in an Oracle 11.2 database into Entities?

             

            I need to know *** now *** if Forge actually works with Oracle 11.2 or if this is something that will be working down the road.

             

            I want to introduce JBoss AS7, EE6 and related technologies for this project. This a important high profile project for a top-of-the-line-global-company based in Marin county.

             

            (Note; I have successfully used Forge with a mysql database with very little pain.)

             

            Here are the basic step I am using;

             

            I setup a JDBC data-source in JBoss AS 7 as a Module using the Oracle jdbc driver "ojdbc6.jar". Testing the JDBC data-source connection from within the AS 7 admin console is successful.

             

            Then proceed to the Forge part of the process.

             

            Within Forge, I enter the commands to;

            install-plug-in hibernate-tools

            setup the project

            persistence setup --provider HIBERNATE --container JBOSS_AS7 --jndiDataSource java:/OracleDSJNDI

            then generate-entities

            for JDBC connection I enter - jdbc:oracle:thin:@xx.xx.xx.xx:1521:SID

            then username/password

            then dialect = org.hibernate.dialect.OracleDialect

            then jdbc driver class name = oracle.jdbc.OracleDriver

            then path to jar C:\Users\t_gfrow\dev\apps\libraries\jdbc\oracle\ojdbc6.jar

             

            Then it fails with the error "***ERROR*** An unexpected error happened during reverse engineering. blah, blah"

             

            Always happens when using generate-entities. I also tried generating an entity from a single table, same result.

             

            I first used "Forge 1.1.1.FINAL" and that did not work. Now am using "Forge 1.1.3-SNAPSHOT" and that does not work, same problem.

             

            My team and I do not have time for this and will soon let go of Forge and the opportunity for JBoss AS 7.

             

            If Forge really works with Oracle 11.2 database using ojdbc6.jar. Then please provide clear instructions.

             

            Thank you very much.

            • 3. Re: Forge hibernate plugin not work with 10g Release 10.2.0.1.0
              Thomas Frühbeck Newbie

              Reverse engineering databases is just a very small aspect of Forge - and there are abundant alternatives just for that (e.g. Netbeans). Meanwhile I more often refrain from this generation pattern due to the capabilities of Forge.

              Anyway it is very easy to bring in generated entity classes into a Forge project and to successfully use the incredible wealth of Forge plugins. You should not dismiss a groundbreaking technology just because of this issue.