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

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


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


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