Simple-JNDI
Simple-JNDI copied to clipboard
Improvement on Documentation and error handling
This documentation seems outdated: https://github.com/h-thurow/Simple-JNDI/wiki/DataSource-Configuration-DBCP-2-and-Commons-Pool-2-(New-in-0.15.0)
When following this, I experienced an error in my logfile stating:
ERROR org.osjava.sj.loader.SJDataSourceConverter - Incomplete arguments provided <some more text>
There was no hint as of what exactly was missing. Checking https://github.com/h-thurow/Simple-JNDI/blob/master/src/main/java/org/osjava/sj/loader/convert/SJDataSourceConverter.java#L46 I found out that the properties file should contain these values:
type=javax.sql.DataSource
driver=org.mariadb.jdbc.Driver
url=jdbc:mariadb://localhost/testdb
user=user_name
password=password
So it might be nice to have the documentation updated. I also noted there are IllegalArgumentExceptions thrown, but these must have been caught/hidden in the Simple-JNDI startup code. Please make them visible so it is more straightforward fixing issues.
When you can access the datasource ignore the message.
I was not able to access the datasource before reading the source code to understand what was missing. The log message was not sufficient, and the exception never shown. It must have been swallosed somewhere else.
Is that intended?