[forge-users] Error when generate-entities using Forge 2 in JBoss Tools 4.1.1 in Eclipse Kepler

forge-users at lists.jboss.org forge-users at lists.jboss.org
Wed Jan 15 13:43:00 EST 2014


Hi All,

I created a project "forgedemo3" with forge command console in Eclipse Kepler. When I tried to generate entities, I got the following error:

****ERROR*** An unexpected error happened during reverse engineering.org.hibernate.cfg.JDBCBinderException: Duplicate class name 'com.dliao.forgedemo.model.JobHistory' generated for 'org.hibernate.mapping.Table(HR.JOB_HISTORY)'. Same name where generated for 'org.hibernate.mapping.Table(HR.JOB_HISTORY)'*

Even though I specified with one schema (APEX_DBO) and one table (HOLIDAY). I don't understand why JBoss forge still looks for the JOB_HISTORY table under a different schema.

Here is the tailed log from Forge Console.

Thanks you, Dave

---------------------------------------------------------

[forgedemo3] forgedemo3 $ generate-entities --schema APEX_DBO --table HOLIDAY
 ? Specify the URL for the JDBC connection. [jdbc:h2:tcp://localhost/sakila] jdbc:oracle:thin:@dliao:1521:ORCL
 ? Enter the user name for JDBC connection. [null] APEX_DBO
 ? Enter the password for JDBC connection. [ENTER for default] ****
 ? Enter the dialect to use for the datasource. [org.hibernate.dialect.H2Dialect] org.hibernate.dialect.OracleDialect
 ? Specify the class name for the JDBC driver for the datasource. [org.h2.Driver] oracle.jdbc.OracleDriver
 ? Enter the path in the local file system to the jar file containing the JDBC driver. [null] C:\DLiao\Lib\oracle\ojdbc14.jar
 ? In which package you'd like to generate the entities, or enter for default: [com.example.forgedemo3.model] com.dliao.forgedemo.model
***ERROR*** An unexpected error happened during reverse engineering.org.hibernate.cfg.JDBCBinderException: Duplicate class name 'com.dliao.forgedemo.model.JobHistory' generated for 'org.hibernate.mapping.Table(HR.JOB_HISTORY)'. Same name where generated for 'org.hibernate.mapping.Table(HR.JOB_HISTORY)'

    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$1.run(GenerateEntitiesPlugin.java:179)
    at org.hibernate.forge.common.UrlClassLoaderExecutor.execute(UrlClassLoaderExecutor.java:13)
    at org.hibernate.forge.generate.GenerateEntitiesPlugin.doReverseEngineering(GenerateEntitiesPlugin.java:171)
    at org.hibernate.forge.generate.GenerateEntitiesPlugin.generateEntities(GenerateEntitiesPlugin.java:78)
    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:160)
    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:796)
    at org.jboss.forge.shell.ShellImpl.execute(ShellImpl.java:819)
    at org.jboss.forge.shell.ShellImpl.doShell(ShellImpl.java:609)
    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:186)
    at java.lang.Thread.run(Thread.java:662)
[forgedemo3] forgedemo3 $ generate-entities --schema APEX_DBO --table HOLIDAY
 ? Specify the URL for the JDBC connection. [jdbc:h2:tcp://localhost/sakila] jdbc:oracle:thin:@dliao:1521:ORCL
 ? Enter the user name for JDBC connection. [null] APEX_DBO
 ? Enter the password for JDBC connection. [ENTER for default] ****
 ? Enter the dialect to use for the datasource. [org.hibernate.dialect.H2Dialect] org.hibernate.dialect.OracleDialect
 ? Specify the class name for the JDBC driver for the datasource. [org.h2.Driver] oracle.jdbc.OracleDriver
 ? Enter the path in the local file system to the jar file containing the JDBC driver. [null] C:\DLiao\Lib\oracle\ojdbc14.jar
 ? In which package you'd like to generate the entities, or enter for default: [com.example.forgedemo3.model] com.dliao.forgedemo3.model
***ERROR*** An unexpected error happened during reverse engineering.
org.hibernate.cfg.JDBCBinderException: Duplicate class name 'com.dliao.forgedemo3.model.JobHistory' generated for 'org.hibernate.mapping.Table(HR.JOB_HISTORY)'. Same name where generated for 'org.hibernate.mapping.Table(HR.JOB_HISTORY)'
    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$1.run(GenerateEntitiesPlugin.java:179)
    at org.hibernate.forge.common.UrlClassLoaderExecutor.execute(UrlClassLoaderExecutor.java:13)
    at org.hibernate.forge.generate.GenerateEntitiesPlugin.doReverseEngineering(GenerateEntitiesPlugin.java:171)
    at org.hibernate.forge.generate.GenerateEntitiesPlugin.generateEntities(GenerateEntitiesPlugin.java:78)
    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:160)
    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:796)
    at org.jboss.forge.shell.ShellImpl.execute(ShellImpl.java:819)
    at org.jboss.forge.shell.ShellImpl.doShell(ShellImpl.java:609)
    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:186)
    at java.lang.Thread.run(Thread.java:662)
[forgedemo3] forgedemo3 $ 

Posted by forums
Original post: https://community.jboss.org/message/853162#853162



More information about the forge-users mailing list