-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: ORA-01424 reverse engineering an Oracle database
PostPosted: Thu Jun 30, 2005 1:01 pm 
Newbie

Joined: Thu Jun 30, 2005 12:37 pm
Posts: 3
Hi,
I've got an ORA-01424 error while reverse engineering an Oracle database with hibernatetool ant task.
The same configuration works OK with hsqldb.
Any Help would be appreciated.

Best Regards.

Rodolfo Martín.

[b]Hibernate version:[/b]
Hibernate tools 3.0.5 alpha4

[b]Mapping documents:[/b]
My build.xml:
[code]
<target name="hibernateTools" description="Generate .hbm.java from .hbm files.">
<taskdef
name="hibernatetool"
classname="org.hibernate.tool.ant.HibernateToolTask"
classpathref="lib.class.path"
/>

<hibernatetool destdir="${gen.dir}">
<!-- database settings are read from hibernate.cfg.xml and/or via propertyfile if provided -->
<jdbcconfiguration
packagename="${name}"
configurationfile="hibernate.cfg.xml"
revengfile="hibernate.reveng.xml"
/>
<cfg2hbm templatespath="${templates.dir}"/>
<hbm2java generics="true" templatespath="${templates.dir}"/>
<hbm2doc destdir="${doc.dir}"/>
</hibernatetool>
</target>
[/code]

The hibernate.cfg.xml content:
[code]
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//hibernate/hibernate Configuration DTD 3.0//EN"

"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

<hibernate-configuration>

<session-factory>
<property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="hibernate.connection.url">jdbc:oracle:thin:@myserver:mySID</property>
<property name="hibernate.connection.username">user</property>
<property name="hibernate.connection.password">password</property>
<property name="dialect">org.hibernate.dialect.OracleDialect</property>
<property name="show_sql">true</property>
<property name="transaction.factory_class">
org.hibernate.transaction.JDBCTransactionFactory
</property>
</session-factory>

</hibernate-configuration>
[/code]

My reveng file:
[code]
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-reverse-engineering SYSTEM "http://hibernate.sourceforge.net/hibernate-reverse-engineering-3.0.dtd" >

<hibernate-reverse-engineering>

<type-mapping>
<sql-type jdbc-type="INTEGER" hibernate-type="java.lang.Integer" />
<sql-type jdbc-type="DOUBLE" hibernate-type="java.lang.Double" />
<sql-type jdbc-type="VARCHAR" length='1' hibernate-type="true_false" />
</type-mapping>

</hibernate-reverse-engineering>
[/code]

[b]Full stack trace of any exception that occurs:[/b]
[code]
--- Nested Exception ---
org.hibernate.exception.GenericJDBCException: Reading from database
at org.hibernate.exception.ErrorCodeConverter.handledNonSpecificException(ErrorCodeConverter.java:92)
at org.hibernate.exception.ErrorCodeConverter.convert(ErrorCodeConverter.java:80)
at org.hibernate.cfg.JDBCBinder.readFromDatabase(JDBCBinder.java:96)
at org.hibernate.cfg.JDBCMetaDataConfiguration.readFromJDBC(JDBCMetaDataConfiguration.java:37)
at org.hibernate.tool.ant.JDBCConfigurationTask.doConfiguration(JDBCConfigurationTask.java:71)
at org.hibernate.tool.ant.ConfigurationTask.getConfiguration(ConfigurationTask.java:50)
at org.hibernate.tool.ant.HibernateToolTask.getConfiguration(HibernateToolTask.java:150)
at org.hibernate.tool.ant.GeneratorTask.configureExporter(GeneratorTask.java:74)
at org.hibernate.tool.ant.GeneratorTask.execute(GeneratorTask.java:32)
at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:115)
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.tools.ant.Target.performTasks(Target.java:369)
at org.apache.tools.ant.Project.executeTarget(Project.java:1214)
at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:386)
at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:106)
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.tools.ant.Target.performTasks(Target.java:369)
at org.apache.tools.ant.Project.executeTarget(Project.java:1214)
at org.apache.tools.ant.Project.executeTargets(Project.java:1062)
at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:234)
at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:242)
at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:125)
Caused by: java.sql.SQLException: ORA-01424: falta el carácter o no es válido a continuación del carácter de escape
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208)
at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:543)
at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1405)
at oracle.jdbc.ttc7.TTC7Protocol.fetch(TTC7Protocol.java:889)
at oracle.jdbc.driver.OracleStatement.doExecuteQuery(OracleStatement.java:1681)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1870)
at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:363)
at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:314)
at oracle.jdbc.OracleDatabaseMetaData.getColumns(OracleDatabaseMetaData.java:2550)
at org.hibernate.cfg.JDBCBinder.processBasicColumns(JDBCBinder.java:732)
at org.hibernate.cfg.JDBCBinder.readDatabaseSchema(JDBCBinder.java:123)
at org.hibernate.cfg.JDBCBinder.readFromDatabase(JDBCBinder.java:91)
... 23 more
[/code]

[b]Name and version of the database you are using:[/b]
Oracle 8.1.6


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 30, 2005 2:31 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
you need to ensure you are not reverse engineering table with $ in them (oracles system tables has that and their jdbc driver cannot handle that)

easiest way is to set default schema-catalog to something usefull.

if you want more than one schema then you need to use reveng.xml

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 01, 2005 4:59 am 
Newbie

Joined: Thu Jun 30, 2005 12:37 pm
Posts: 3
Thank you Max,
You are right. I have set a hibernate.default_schema and it works.

Best Regards

Rodolfo.


Top
 Profile  
 
 Post subject: Re: ORA-01424 reverse engineering an Oracle database
PostPosted: Thu Oct 16, 2008 8:30 am 
Newbie

Joined: Thu Oct 16, 2008 8:25 am
Posts: 1
Location: pune, India
Hi Rodolfo Martín,

I am new to hibernate . Please help me to hibernatetool ant task.
Please provide me code for hibernatetool ant task.

Regards
Vasudevan T


[quote="rmg26"]Hi,
I've got an ORA-01424 error while reverse engineering an Oracle database with hibernatetool ant task.
The same configuration works OK with hsqldb.
Any Help would be appreciated.

Best Regards.

Rodolfo Martín.

[b]Hibernate version:[/b]
Hibernate tools 3.0.5 alpha4

[b]Mapping documents:[/b]
My build.xml:
[code]
<target name="hibernateTools" description="Generate .hbm.java from .hbm files.">
<taskdef
name="hibernatetool"
classname="org.hibernate.tool.ant.HibernateToolTask"
classpathref="lib.class.path"
/>

<hibernatetool destdir="${gen.dir}">
<!-- database settings are read from hibernate.cfg.xml and/or via propertyfile if provided -->
<jdbcconfiguration
packagename="${name}"
configurationfile="hibernate.cfg.xml"
revengfile="hibernate.reveng.xml"
/>
<cfg2hbm templatespath="${templates.dir}"/>
<hbm2java generics="true" templatespath="${templates.dir}"/>
<hbm2doc destdir="${doc.dir}"/>
</hibernatetool>
</target>
[/code]

The hibernate.cfg.xml content:
[code]
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//hibernate/hibernate Configuration DTD 3.0//EN"

"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

<hibernate-configuration>

<session-factory>
<property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="hibernate.connection.url">jdbc:oracle:thin:@myserver:mySID</property>
<property name="hibernate.connection.username">user</property>
<property name="hibernate.connection.password">password</property>
<property name="dialect">org.hibernate.dialect.OracleDialect</property>
<property name="show_sql">true</property>
<property name="transaction.factory_class">
org.hibernate.transaction.JDBCTransactionFactory
</property>
</session-factory>

</hibernate-configuration>
[/code]

My reveng file:
[code]
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-reverse-engineering SYSTEM "http://hibernate.sourceforge.net/hibernate-reverse-engineering-3.0.dtd" >

<hibernate-reverse-engineering>

<type-mapping>
<sql-type jdbc-type="INTEGER" hibernate-type="java.lang.Integer" />
<sql-type jdbc-type="DOUBLE" hibernate-type="java.lang.Double" />
<sql-type jdbc-type="VARCHAR" length='1' hibernate-type="true_false" />
</type-mapping>

</hibernate-reverse-engineering>
[/code]

[b]Full stack trace of any exception that occurs:[/b]
[code]
--- Nested Exception ---
org.hibernate.exception.GenericJDBCException: Reading from database
at org.hibernate.exception.ErrorCodeConverter.handledNonSpecificException(ErrorCodeConverter.java:92)
at org.hibernate.exception.ErrorCodeConverter.convert(ErrorCodeConverter.java:80)
at org.hibernate.cfg.JDBCBinder.readFromDatabase(JDBCBinder.java:96)
at org.hibernate.cfg.JDBCMetaDataConfiguration.readFromJDBC(JDBCMetaDataConfiguration.java:37)
at org.hibernate.tool.ant.JDBCConfigurationTask.doConfiguration(JDBCConfigurationTask.java:71)
at org.hibernate.tool.ant.ConfigurationTask.getConfiguration(ConfigurationTask.java:50)
at org.hibernate.tool.ant.HibernateToolTask.getConfiguration(HibernateToolTask.java:150)
at org.hibernate.tool.ant.GeneratorTask.configureExporter(GeneratorTask.java:74)
at org.hibernate.tool.ant.GeneratorTask.execute(GeneratorTask.java:32)
at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:115)
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.tools.ant.Target.performTasks(Target.java:369)
at org.apache.tools.ant.Project.executeTarget(Project.java:1214)
at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:386)
at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:106)
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.tools.ant.Target.performTasks(Target.java:369)
at org.apache.tools.ant.Project.executeTarget(Project.java:1214)
at org.apache.tools.ant.Project.executeTargets(Project.java:1062)
at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:234)
at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:242)
at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:125)
Caused by: java.sql.SQLException: ORA-01424: falta el carácter o no es válido a continuación del carácter de escape
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208)
at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:543)
at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1405)
at oracle.jdbc.ttc7.TTC7Protocol.fetch(TTC7Protocol.java:889)
at oracle.jdbc.driver.OracleStatement.doExecuteQuery(OracleStatement.java:1681)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1870)
at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:363)
at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:314)
at oracle.jdbc.OracleDatabaseMetaData.getColumns(OracleDatabaseMetaData.java:2550)
at org.hibernate.cfg.JDBCBinder.processBasicColumns(JDBCBinder.java:732)
at org.hibernate.cfg.JDBCBinder.readDatabaseSchema(JDBCBinder.java:123)
at org.hibernate.cfg.JDBCBinder.readFromDatabase(JDBCBinder.java:91)
... 23 more
[/code]

[b]Name and version of the database you are using:[/b]
Oracle 8.1.6[/quote]


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 17, 2008 2:04 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
the code is in svn.

see http://www.hibernate.org/268.html for details.

_________________
Max
Don't forget to rate


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.