From bba1bed6706edd41d58280b5f10dffac3a0239b6 Mon Sep 17 00:00:00 2001 From: Harrison Saylor Date: Wed, 8 Mar 2017 10:22:14 -0600 Subject: [PATCH] add check for javax.naming.InitialContext --- .../com/ibm/watson/developer_cloud/util/CredentialUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/com/ibm/watson/developer_cloud/util/CredentialUtils.java b/core/src/main/java/com/ibm/watson/developer_cloud/util/CredentialUtils.java index 793f02e9c68..e29882d3214 100644 --- a/core/src/main/java/com/ibm/watson/developer_cloud/util/CredentialUtils.java +++ b/core/src/main/java/com/ibm/watson/developer_cloud/util/CredentialUtils.java @@ -112,7 +112,7 @@ private CredentialUtils() { * @return The encoded API Key */ private static String getKeyUsingJNDI(String serviceName) { - if (!isClassAvailable("javax.naming.Context")) { + if (!isClassAvailable("javax.naming.Context") || !isClassAvailable("javax.naming.InitialContext")) { log.info("JNDI string lookups is not available."); return null; }