Results 1 to 3 of 3

Thread: binary attributes (objectGUID) - programmatically set the environment

  1. #1
    Join Date
    May 2008
    Posts
    5

    Default binary attributes (objectGUID) - programmatically set the environment

    Hi,

    I need to programmatically set the following piece of configuration xml in spring:

    <property name="baseEnvironmentProperties">
    <map>
    <entry key="java.naming.ldap.attributes.binary" value="objectGUID"/>
    </map>
    </property>

    I tried to set the property of the environment AFTER the container startup but I got the exception: java.lang.String cannot be cast to [B

    if I use it from xml configuration descriptor it works fine.

    please help

    Thanks in advance.
    YF

  2. #2
    Join Date
    Jul 2005
    Location
    Helsingborg, Sweden
    Posts
    504

    Default

    Did you remember to call afterPropertiesSet on your (Abstract)ContextSource?

    Code:
    AbstractContextSource contextSource = (AbstractContextSource) ldapTemplate.getContextSource();
    Map<String,String> baseEnvironmentProperties = new HashMap<String, String>();
    baseEnvironmentProperties.put("java.naming.ldap.attributes.binary", "objectGUID");
    contextSource.setBaseEnvironmentProperties(baseEnvironmentProperties);
    contextSource.afterPropertiesSet();
    Ulrik Sandberg
    Jayway (www.jayway.com)
    Spring LDAP project member

  3. #3
    Join Date
    May 2008
    Posts
    5

    Default

    Thanks Ulsa - thats exactly what I was looking for!

    you great - thx!

    YF

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •