[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-2294) Uncatched NullpointerException

Dishine Chen (JIRA) noreply at atlassian.com
Thu Dec 7 22:05:04 EST 2006


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-2294?page=comments#action_25589 ] 

Dishine Chen commented on HHH-2294:
-----------------------------------

ignore, my mistake, sorry.

10:14:37,716 WARN  [GeronimoConnectionEventListener] connectionErrorOccurred called with null
java.sql.SQLException: Unsupport method.

at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:269)
at oracle.jdbc.dbaccess.DBError.throwUnsupportedFeatureSqlException(DBError.java:689)
at oracle.jdbc.OracleDatabaseMetaData.getDatabaseMajorVersion(OracleDatabaseMetaData.java:4442)
at org.tranql.connector.jdbc.DatabaseMetaDataHandle.getDatabaseMajorVersion(DatabaseMetaDataHandle.java:307)
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:585)
at org.hibernate.cfg.SettingsFactory.getDatabaseMajorVersion(SettingsFactory.java:324)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:80)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2006)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1289)

> Uncatched NullpointerException
> ------------------------------
>
>          Key: HHH-2294
>          URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2294
>      Project: Hibernate3
>         Type: Bug

>     Versions: 3.2.1
>  Environment: jdk1.5
> IBM WebSphere Application Server Community Edition
>     Reporter: Dishine Chen

>
> Original Estimate: 1 hour
>         Remaining: 1 hour
>
> in class: org.hibernate.cfg.SettingsFactory, line324
> 	private int getDatabaseMajorVersion(DatabaseMetaData meta) {
> 		try {
> 			Method gdbmvMethod = DatabaseMetaData.class.getMethod("getDatabaseMajorVersion", null);
> 			return ( (Integer) gdbmvMethod.invoke(meta, null) ).intValue();
> 		}
> 		catch (NoSuchMethodException nsme) {
> 			return 0;
> 		}
> 		catch (Throwable t) {
> 			log.debug("could not get database version from JDBC metadata");
> 			return 0;
> 		}
> 	}
> If "(Integer) gdbmvMethod.invoke(meta, null)" returns null, a nullpointerexception will be thrown, and "catch (Throwable t) {}" block will not catch it.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira




More information about the hibernate-issues mailing list