Improve JNDI detection logic
Update JndiLocatorDelegate.isDefaultJndiEnvironmentAvailable() to call `getEnvironment()` on the `InitialContext` in order to actually trigger a NamingException if JNDI is not available. Issue: SPR-12223
This commit is contained in:
@@ -58,7 +58,7 @@ public class JndiLocatorDelegate extends JndiLocatorSupport {
|
||||
*/
|
||||
public static boolean isDefaultJndiEnvironmentAvailable() {
|
||||
try {
|
||||
new InitialContext();
|
||||
new InitialContext().getEnvironment();
|
||||
return true;
|
||||
}
|
||||
catch (Throwable ex) {
|
||||
|
||||
Reference in New Issue
Block a user