Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Won't Fix
-
4.1
-
None
-
None
Description
I am trying to use a JNDI connection, but an error occurs getting the connection. The error is swallowed and obscured by a NullPointerException. See comments inline below.
JdbcDataSource.java
protected Callable<Connection> createConnectionFactory(final Context context, final Properties initProps) { ... final String jndiName = initProps.getProperty(JNDI_NAME); final String url = initProps.getProperty(URL); /* is null */ final String driver = initProps.getProperty(DRIVER); /* is null */ ... return factory = new Callable<Connection>() { @Override public Connection call() throws Exception { ... try { if(url != null){ c = DriverManager.getConnection(url, initProps); } else if(jndiName != null){ ... /* error occurs */ ... } } catch (SQLException e) { /* exception handler assumes that try block followed "url != null" path; in the JNDI case, driver is null, and DocBuilder.loadClass(..) throws a NPE */ Driver d = (Driver) DocBuilder.loadClass(driver, context.getSolrCore()).newInstance(); c = d.connect(url, initProps); } ... } }; }
Attachments
Issue Links
- is superceded by
-
SOLR-14783 Remove DIH from 9.0
- Closed