-->
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.  [ 4 posts ] 
Author Message
 Post subject: JDBCExceptionReporter: Invalid column name
PostPosted: Mon Aug 30, 2004 3:48 pm 
Beginner
Beginner

Joined: Tue Jul 27, 2004 2:50 pm
Posts: 23
Hi all,

I am getting a JDBCExceptionReport exception complaining about invalid column name. I have the sql debugging on. Here is what is being reported by the hibernate debugger. If I run the generated sql in a sql client, it works fine. I thought maybe there is a problem with the way I have mapped my class, but the pathway_id it is complaining about is a NUMBER is the Oracle 8 database and I have defined it to be Long type in my class.

Any ideas why I am getting this exception? Here is the log:

Code:

Hibernate: select p.PATHWAY_ID as PATHWAY_ID0_, p.PATHWAY_NAME as PATHWAY_2_0_,
p.PATHWAY_DISPLAY as PATHWAY_3_0_, p.PATHWAY_DIAGRAM as PATHWAY_4_0_, p.TAXON as
TAXON0_ from BIO_Pathways p, Gene g, Reporter r, Pathway_Gene_Object pg, Gene_R
eporter gr where pg.pathway_id = p.pathway_id and pg.gene_id = g.gene_id and gr.
gene_id = g.gene_id and gr.reporter_id = r.reporter_id and r.reporter_id in (sel
ect arm.reporter_id from Array_Reporter_Map_V arm where arm.array_design_id = 7)

15:18:14,728 DEBUG BatcherImpl:115 - preparing statement
15:20:03,103 DEBUG Loader:115 - processing result set
15:20:03,134 DEBUG LongType:115 - returning '220' as column: PATHWAY_ID0_
15:20:03,149 DEBUG JDBCExceptionReporter:140 - SQL Exception
java.sql.SQLException: Invalid column name
        at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:180)
        at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:222)
        at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:285)
        at oracle.jdbc.driver.OracleStatement.get_column_index(OracleStatement.j
ava:5153)
        at oracle.jdbc.driver.OracleResultSetImpl.findColumn(OracleResultSetImpl
.java:698)
        at oracle.jdbc.driver.OracleResultSet.getLong(OracleResultSet.java:1563)

        at net.sf.hibernate.type.LongType.get(LongType.java:18)
        at net.sf.hibernate.type.NullableType.nullSafeGet(NullableType.java:62)
        at net.sf.hibernate.type.NullableType.nullSafeGet(NullableType.java:53)
        at net.sf.hibernate.loader.Loader.getKeyFromResultSet(Loader.java:352)
        at net.sf.hibernate.loader.Loader.doQuery(Loader.java:203)
        at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections
(Loader.java:133)
        at net.sf.hibernate.loader.Loader.doList(Loader.java:955)
        at net.sf.hibernate.loader.Loader.list(Loader.java:946)
        at net.sf.hibernate.loader.SQLLoader.list(SQLLoader.java:92)
        at net.sf.hibernate.impl.SessionImpl.findBySQL(SessionImpl.java:3802)
        at net.sf.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:52)
        at gov.nih.nci.common.persistence.DefaultPersistenceManager.search(Unkno
wn Source)
        at gov.nih.nci.common.manager.DefaultObjectManager.search(Unknown Source
)
        at gov.nih.nci.common.remote.rmi.RMIObjectManagerRemote.search(Unknown S
ource)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
        at sun.rmi.transport.Transport$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.rmi.transport.Transport.serviceCall(Unknown Source)
        at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
        at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Sour
ce)
        at java.lang.Thread.run(Unknown Source)
15:20:03,165  WARN JDBCExceptionReporter:164 - SQL Error: 17006, SQLState: null
15:20:03,165 ERROR JDBCExceptionReporter:180 - Invalid column name
15:20:03,165 DEBUG BatcherImpl:115 - done closing: 0 open PreparedStatements, 0
open ResultSets
15:20:03,165 DEBUG BatcherImpl:115 - closing statement
15:20:03,165 DEBUG JDBCExceptionReporter:140 - SQL Exception
java.sql.SQLException: Invalid column name
        at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:180)
        at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:222)
        at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:285)
        at oracle.jdbc.driver.OracleStatement.get_column_index(OracleStatement.j
ava:5153)
        at oracle.jdbc.driver.OracleResultSetImpl.findColumn(OracleResultSetImpl
.java:698)
        at oracle.jdbc.driver.OracleResultSet.getLong(OracleResultSet.java:1563)

        at net.sf.hibernate.type.LongType.get(LongType.java:18)
        at net.sf.hibernate.type.NullableType.nullSafeGet(NullableType.java:62)
        at net.sf.hibernate.type.NullableType.nullSafeGet(NullableType.java:53)
        at net.sf.hibernate.loader.Loader.getKeyFromResultSet(Loader.java:352)
        at net.sf.hibernate.loader.Loader.doQuery(Loader.java:203)
        at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections
(Loader.java:133)
        at net.sf.hibernate.loader.Loader.doList(Loader.java:955)
        at net.sf.hibernate.loader.Loader.list(Loader.java:946)
        at net.sf.hibernate.loader.SQLLoader.list(SQLLoader.java:92)
        at net.sf.hibernate.impl.SessionImpl.findBySQL(SessionImpl.java:3802)
        at net.sf.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:52)
        at gov.nih.nci.common.persistence.DefaultPersistenceManager.search(Unkno
wn Source)
        at gov.nih.nci.common.manager.DefaultObjectManager.search(Unknown Source
)
        at gov.nih.nci.common.remote.rmi.RMIObjectManagerRemote.search(Unknown S
ource)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
        at sun.rmi.transport.Transport$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.rmi.transport.Transport.serviceCall(Unknown Source)
        at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
        at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Sour
ce)
        at java.lang.Thread.run(Unknown Source)
15:20:03,165  WARN JDBCExceptionReporter:164 - SQL Error: 17006, SQLState: null
15:20:03,165 ERROR JDBCExceptionReporter:180 - Invalid column name
15:20:03,165 ERROR JDBCExceptionReporter:188 - SQLException occurred
java.sql.SQLException: Invalid column name
        at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:180)
        at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:222)
        at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:285)
        at oracle.jdbc.driver.OracleStatement.get_column_index(OracleStatement.j
ava:5153)
        at oracle.jdbc.driver.OracleResultSetImpl.findColumn(OracleResultSetImpl
.java:698)
        at oracle.jdbc.driver.OracleResultSet.getLong(OracleResultSet.java:1563)

        at net.sf.hibernate.type.LongType.get(LongType.java:18)
        at net.sf.hibernate.type.NullableType.nullSafeGet(NullableType.java:62)
        at net.sf.hibernate.type.NullableType.nullSafeGet(NullableType.java:53)
        at net.sf.hibernate.loader.Loader.getKeyFromResultSet(Loader.java:352)
        at net.sf.hibernate.loader.Loader.doQuery(Loader.java:203)
        at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections
(Loader.java:133)
        at net.sf.hibernate.loader.Loader.doList(Loader.java:955)
        at net.sf.hibernate.loader.Loader.list(Loader.java:946)
        at net.sf.hibernate.loader.SQLLoader.list(SQLLoader.java:92)
        at net.sf.hibernate.impl.SessionImpl.findBySQL(SessionImpl.java:3802)
        at net.sf.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:52)
        at gov.nih.nci.common.persistence.DefaultPersistenceManager.search(Unkno
wn Source)
        at gov.nih.nci.common.manager.DefaultObjectManager.search(Unknown Source
)
        at gov.nih.nci.common.remote.rmi.RMIObjectManagerRemote.search(Unknown S
ource)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
        at sun.rmi.transport.Transport$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.rmi.transport.Transport.serviceCall(Unknown Source)
        at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
        at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Sour
ce)
        at java.lang.Thread.run(Unknown Source)



Thank you,
Payam.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 30, 2004 4:46 pm 
Beginner
Beginner

Joined: Tue Jul 27, 2004 2:50 pm
Posts: 23
Since the following binding has been successful, doesn't it eliminate a potential mapping problem? What else could be wrong causing this exception?

16:36:50,181 INFO Configuration:148 - Mapping resource: gov/nih/nci/caBIO/bean/
Pathway.hbm.xml
16:36:50,853 INFO Binder:148 - Mapping class: gov.nih.nci.caBIO.bean.Pathway ->
BIO_PATHWAYS
16:36:50,853 DEBUG Binder:132 - Mapped property: id -> PATHWAY_ID, type: long
16:36:50,853 DEBUG Binder:132 - Mapped property: name -> PATHWAY_NAME, type: str
ing
16:36:50,853 DEBUG Binder:132 - Mapped property: displayValue -> PATHWAY_DISPLAY
, type: string
16:36:50,853 DEBUG Binder:132 - Mapped property: diagram -> PATHWAY_DIAGRAM, typ
e: string
16:36:50,853 DEBUG Binder:132 - Mapped property: taxonId -> TAXON, type: string


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 30, 2004 5:03 pm 
Beginner
Beginner

Joined: Tue Jul 27, 2004 2:50 pm
Posts: 23
Any resolution for this?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 30, 2004 8:18 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Did you ever bother to read the red box before posting?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.