You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by jw...@apache.org on 2005/06/16 17:54:51 UTC

svn commit: r190940 - /lenya/trunk/src/java/org/apache/lenya/ac/ldap/LDAPUser.java

Author: jwkaltz
Date: Thu Jun 16 08:54:51 2005
New Revision: 190940

URL: http://svn.apache.org/viewcvs?rev=190940&view=rev
Log:
[minor change] added explicit check for required properties for nicer error message

Modified:
    lenya/trunk/src/java/org/apache/lenya/ac/ldap/LDAPUser.java

Modified: lenya/trunk/src/java/org/apache/lenya/ac/ldap/LDAPUser.java
URL: http://svn.apache.org/viewcvs/lenya/trunk/src/java/org/apache/lenya/ac/ldap/LDAPUser.java?rev=190940&r1=190939&r2=190940&view=diff
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/ac/ldap/LDAPUser.java (original)
+++ lenya/trunk/src/java/org/apache/lenya/ac/ldap/LDAPUser.java Thu Jun 16 08:54:51 2005
@@ -332,9 +332,24 @@
                 .getAbsolutePath()
                 + File.separator + defaultProperties.getProperty(KEY_STORE_PROP));
 
+
         env.put(Context.INITIAL_CONTEXT_FACTORY, LdapCtxFactory.class.getName());
-        env.put(Context.PROVIDER_URL, defaultProperties.getProperty(PROVIDER_URL_PROP));
-        env.put(Context.SECURITY_PROTOCOL, defaultProperties.getProperty(SECURITY_PROTOCOL_PROP));
+
+        String prop = defaultProperties.getProperty(PROVIDER_URL_PROP);
+        if (prop == null)
+            throw new RuntimeException("LDAP configuration error: property " +
+                                       PROVIDER_URL_PROP + 
+                                       " is not set in property file " + 
+                                       LDAP_PROPERTIES_FILE);
+        env.put(Context.PROVIDER_URL, prop);
+
+        prop = defaultProperties.getProperty(SECURITY_PROTOCOL_PROP);
+        if (prop == null)
+            throw new RuntimeException("LDAP configuration error: property " +
+                                       SECURITY_PROTOCOL_PROP + 
+                                       " is not set in property file " + 
+                                       LDAP_PROPERTIES_FILE);
+        env.put(Context.SECURITY_PROTOCOL, prop);
 
         env.put(Context.SECURITY_AUTHENTICATION, authMethod);
         if (authMethod != null && ! authMethod.equals("none")) {



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org