-
-
Notifications
You must be signed in to change notification settings - Fork 25
Description
Submitted by: @mrotteveel
Performing a Hibernate reverse engineering in Netbeans leads to a NullPointerException in the wizard.
See:
http://stackoverflow.com/questions/14500429/nullpointerexception-in-netbeans-hibernate-mapping-files-and-pojos-wizard-from-f
http://stackoverflow.com/questions/18904451/how-to-configure-jaybird-with-hibernate
Looking at the Hibernate (3.2) and Netbeans code involved, the problem seems to be in the way that Netbeans creates the connection in org.netbeans.modules.hibernate.util.CustomJDBCConnectionProvider and this somehow leads to a null connection being returned from Firebird. This might be a classloading issue.
The specific code (which matches with the logging in Netbeans) in CustomJDBCConnectionProvider (based on 7.3.1 source) is:
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
Class clazz = classLoader.loadClass(driverClassName);
java.sql.Driver driver = (java.sql.Driver) clazz.newInstance();
http://logger.info("Loaded JDBC driver ");
// Establish the connection
java.util.Properties info = new java.util.Properties();
info.setProperty("user", username);
info.setProperty("password", password);
connection = driver.connect(driverURL, info);
http://logger.info("Got connection.. returning");
Looking at org.firebirdsql.jdbc.FBDriver this can only return null if GDSFactory.getTypeForProtocol(url); does not return a GDSType, which should only happen if the URL is not a Firebird url.
Commits: 6c2e2f5 e8e217e 769ebed e0d05d6 FirebirdSQL/fbt-repository@7f6fb80 FirebirdSQL/fbt-repository@1dee1ca FirebirdSQL/fbt-repository@bb1c405 FirebirdSQL/fbt-repository@c00a50d