myeclipse "Generating artifacts" 列名无效错误解决办法!

在使用hibernate3.2映射pojo时抛出"Generating artifacts"错误,
注意:我使用的是oracle,如使用mysql则没有出错.

打开workspace/.metadata/.log 文件,发现eclipse抛出的异常日志信息如下:

!ENTRY org.eclipse.core.jobs 4 2 2008-04-02 15:22:23.031
!MESSAGE An internal error occurred during: "Generating Artifacts".
!STACK 0
org.hibernate.exception.GenericJDBCException: Could not get list of tables from database. Probably a JDBC driver problem.
Configured schema:BST114
Configured catalog:null
Available schemas:
  ANONYMOUS
  BST114
  CTXSYS
  D114
  DBSNMP
  DEVELOP
  DG114
  DGBST
  DGTEST
  GAMEDB
  HR
  LOUSHANG
  MDSYS
  ODM
  ODM_MTR
  OE
  OLAPSYS
  ORDPLUGINS
  ORDSYS
  OUTLN
  PM
  QS
  QS_ADM
  QS_CB
  QS_CBADM
  QS_CS
  QS_ES
  QS_OS
  QS_WS
  SCOTT
  SH
  SYS
  SYSTEM
  TESTZTC
  WKPROXY
  WKSYS
  WMSYS
  XDB
Available catalogs:

 at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
 at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
 at org.hibernate.cfg.reveng.dialect.JDBCMetaDataDialect$1.handleSQLException(JDBCMetaDataDialect.java:40)
 at org.hibernate.cfg.reveng.dialect.ResultSetIterator.next(ResultSetIterator.java:62)
 at org.hibernate.cfg.reveng.JDBCReader.processTables(JDBCReader.java:433)
 at org.hibernate.cfg.reveng.JDBCReader.readDatabaseSchema(JDBCReader.java:67)
 at com.genuitec.eclipse.hibernate.wizards.MEJDBCMetaDataConfiguration$1.readDatabaseSchema(MEJDBCMetaDataConfiguration.java:104)
 at org.hibernate.cfg.JDBCBinder.readFromDatabase(JDBCBinder.java:89)
 at com.genuitec.eclipse.hibernate.wizards.MEJDBCMetaDataConfiguration.readFromJDBC(MEJDBCMetaDataConfiguration.java:137)
 at com.genuitec.eclipse.hibernate.wizards.GenerateArtifactsJob$9.execute(GenerateArtifactsJob.java:819)
 at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:56)
 at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:89)
 at com.genuitec.eclipse.hibernate.wizards.GenerateArtifactsJob.buildConfiguration(GenerateArtifactsJob.java:803)
 at com.genuitec.eclipse.hibernate.wizards.GenerateArtifactsJob.run(GenerateArtifactsJob.java:381)
 at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)
Caused by: java.sql.SQLException: 列名无效
 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.java:5278)
 at oracle.jdbc.driver.OracleResultSetImpl.findColumn(OracleResultSetImpl.java:698)
 at oracle.jdbc.driver.OracleResultSet.getString(OracleResultSet.java:1505)
 at org.hibernate.cfg.reveng.dialect.JDBCMetaDataDialect$1.convertRow(JDBCMetaDataDialect.java:33)
 at org.hibernate.cfg.reveng.dialect.ResultSetIterator.next(ResultSetIterator.java:59)
 ... 11 more

 

到网上查了一阵,发现有位网友说:"如果你用的是oracle数据库,如果你的hibernate版本是在比较新,那么你要去找个oracle10i的 JDBC驱动程序. "

于是到网上找了个oracle 10g的classes12.jar,重新映射pojo,OK,成功了,呵呵,,,

共享心情,愿大家能尽快解决同样问题,少走弯路.

你可能感兴趣的:(eclipse,oracle,Hibernate,MyEclipse,jdbc,schema)