You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When moving the application, the root folder of Simple-JNDI most of the times needs to be relocated, so I believe it would be good to make it sufficient to specify the value via system properties, while now it's also mandatory to have it in jndi.properties.
Currently, I can specify pretty much all configuration values that would need to be set in jndi.properties via system properties, with the exception of the root path. In fact, I have a jndi.properties file which only contains the root, with a dummy value that I will be later overwriting via system property.
Still, a root declaration in jndi.properties is mandatory because, even if the code already supports that the root is overwritten via system property in SimpleJNDI.overwriteEnvironmentWithSystemProperties(), if the root is not specified in the properties file the code will fail before reaching the above method when the SimpleJndiContextFactory is initialized in line 73, because contextsByRoot is a concurrent hashmap that does not allow a null key and throws a NPE:
When moving the application, the root folder of Simple-JNDI most of the times needs to be relocated, so I believe it would be good to make it sufficient to specify the value via system properties, while now it's also mandatory to have it in jndi.properties.
Currently, I can specify pretty much all configuration values that would need to be set in jndi.properties via system properties, with the exception of the root path. In fact, I have a jndi.properties file which only contains the root, with a dummy value that I will be later overwriting via system property.
Still, a root declaration in jndi.properties is mandatory because, even if the code already supports that the root is overwritten via system property in
SimpleJNDI.overwriteEnvironmentWithSystemProperties()
, if the root is not specified in the properties file the code will fail before reaching the above method when the SimpleJndiContextFactory is initialized in line 73, because contextsByRoot is a concurrent hashmap that does not allow a null key and throws a NPE:The code after the map lookup seems to be able to deal with a null Context, so a change like the following should work:
If you are OK with the idea I can raise a pull request.
Edit: fix typo and formatting
The text was updated successfully, but these errors were encountered: