Hello,
I would like to see if the following is a known issue.
When connecting to an Oracle DB with Vaadin running in Tomcat, I was receiving a NullPointerException. It turned out that I had invalid db login credentials. But I want to see an error message to that effect and not an uninformative NPE. Digging in, it looks like TableQuery.fetchMetaData() can pass a null connection to J2EEConnectionPool.releaseConnection(), but the latter method does not guard against null.
I didn’t find any other discussion of this problem in the forums or in Trac. I’m using Vaadin 6.6.5 and SQLContainer 1.1.0.
java.lang.NullPointerException
at com.vaadin.addon.sqlcontainer.connection.J2EEConnectionPool.releaseConnection(J2EEConnectionPool.java:51)
at com.vaadin.addon.sqlcontainer.query.TableQuery.fetchMetaData(TableQuery.java:527)
at com.vaadin.addon.sqlcontainer.query.TableQuery.<init>(TableQuery.java:87)
and the code from the SQLContainer add-on is
public class TableQuery implements QueryDelegate, QueryDelegate.RowIdChangeNotifier {
private void fetchMetaData() {
try {
c = connectionPool.reserveConnection();
// ...
} catch (SQLException e) {
throw new RuntimeException(e);
} finally {
connectionPool.releaseConnection(c);
}
}
public class J2EEConnectionPool implements JDBCConnectionPool {
public void releaseConnection(Connection conn) {
try {
conn.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
Thanks,
Dan