How to convert javax.naming.directory.Attributes to .String

hi,
i am getting values from ldap server.
but here i want to assin this values to string?
how?
Attributes det1 = ctx.getAttributes("cn="+t1+"", attrIDs3);
String str111=det1;
here i am getting error like this
Incompatible type for declaration. Can't convert javax.naming.directory.Attributes to java.lang.String
can any one help how to overcome and this values how to equal to string?
jpullareddy

now i got answer,i solved
my self for solution
jpullareddy

Similar Messages

  • Javax.naming.directory.SchemaViolationException on LDAP

    I'm trying to update an attribute which contains different values, ex: objectclass, and it contains like top, person, inetOrgPerson, etc.. When I tried to updated, I got the following error
    javax.naming.directory.SchemaViolationException: [LDAP: error code 65 - Object Class Violation]; remaining name 'uid=skk27test1,ou=people,dc=georgetown,dc=edu'
         at com.sun.jndi.ldap.LdapCtx.mapErrorCode(LdapCtx.java:3036)
         at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2951)
         at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2758)
         at com.sun.jndi.ldap.LdapCtx.c_modifyAttributes(LdapCtx.java:1374)
         at com.sun.jndi.toolkit.ctx.ComponentDirContext.p_modifyAttributes(ComponentDirContext.java:235)
         at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.modifyAttributes(PartialCompositeDirContext.java:147)
         at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.modifyAttributes(PartialCompositeDirContext.java:136)
         at javax.naming.directory.InitialDirContext.modifyAttributes(InitialDirContext.java:138)
         at edu.georgetown.netid.test.SimpleAuthentication.main(SimpleAuthentication.java:61)and the code I'm using is
    DirContext authContext = new InitialDirContext(authEnv);
    results = authContext.search("dc=georgetown,dc=edu", "(uid=skk27test1)", controls);
    while(results.hasMore()){
         SearchResult result = (SearchResult)results.next();
         name = result.getName();
    String dn = "uid=skk27test1,ou=people,dc=georgetown,dc=edu";
                       //updating multiple attribute values for an attribute
    Attributes container = new BasicAttributes(true);
    Attribute objClasses = new BasicAttribute("objectclass");
    objClasses.add("top");
    objClasses.add("person");
    objClasses.add("organizationalPerson");
    objClasses.add("inetOrgPerson");                   
    container.put(objClasses);
    authContext.modifyAttributes(dn,DirContext.REPLACE_ATTRIBUTE, container);I can update a single attribute successfully, the following is the code
    //updating single attribute value for an attribute
    ModificationItem[] mods = new ModificationItem[1];
                     mods[0] = new ModificationItem(DirContext.REPLACE_ATTRIBUTE,
                               new BasicAttribute("gubuildingname", "Harris1"));
    authContext.modifyAttributes(name+",dc=georgetown,dc=edu", mods);I don't know why I'm failing to get update the objectclass attribute.

    I got the solution..
    Actually I missed one attribute which should be a mandatory. I compared the attributes in the LDAP request that fails to the schema.
    I came to know there is most likely a must attribute missing, maybe from an inherited object class.
    Attributes container = new BasicAttributes(true); 
    Attribute objClasses = new BasicAttribute("objectclass"); 
    objClasses.add("top"); 
    objClasses.add("person"); 
    objClasses.add("organizationalPerson"); 
    objClasses.add("inetOrgPerson");                 
    objClasses.add("guPerson");                 
    container.put(objClasses); 
    authContext.modifyAttributes(dn,DirContext.REPLACE_ATTRIBUTE, container);  In the above code, earlier I missed to add " objClasses.add("guPerson");", the guPerson attribute value is mandatory.
    Now I can modify the results. :)

  • Help me for  javax.naming.directory.InvalidAttributeValueException

    i change the password by jndi , and administrator of the Active directory
    had changed password of every user ,but the user is not administrator login int,cannot change himself password.why not?please help me!
    Hashtable env = new Hashtable();
    String userName = "CN=test,OU=test,DC=huadi,DC=com";
    String oldPassword = "test";
    String newPassword = "456P@ssw0rd";
    //Access the keystore, this is where the Root CA public key cert was installed
    //Could also do this via command line java -Djavax.net.ssl.trustStore....
    String keystore = "D:/Program Files/Java/jdk1.5.0/jre/lib/security/cacerts";
    System.setProperty("javax.net.ssl.trustStore",keystore);
    env.put(Context.INITIAL_CONTEXT_FACTORY,
    "com.sun.jndi.ldap.LdapCtxFactory");
    //set security credentials, note using simple cleartext authentication
    env.put(Context.SECURITY_AUTHENTICATION,"simple");
    env.put(Context.SECURITY_PRINCIPAL,userName);
    env.put(Context.SECURITY_CREDENTIALS,oldPassword);
    //specify use of ssl
    env.put(Context.SECURITY_PROTOCOL,"ssl");
    //connect to my domain controller
    String ldapURL = "ldaps://173.16.80.208:636";
    env.put(Context.PROVIDER_URL,ldapURL);
    try {
    // Create the initial directory context
    LdapContext ctx = new InitialLdapContext(env,null);
    //change password is a single ldap modify operation
    //that deletes the old password and adds the new password
    System.out.println("----auth------");
    ModificationItem[] mods = new ModificationItem[2];
    //Firstly delete the "unicdodePwd" attribute, using the old password
    //Then add the new password,Passwords must be both Unicode and a quoted string
    String oldQuotedPassword = "\"" + oldPassword + "\"";
    byte[] oldUnicodePassword = oldQuotedPassword.getBytes("UTF-16LE");
    String newQuotedPassword = "\"" + newPassword + "\"";
    byte[] newUnicodePassword = newQuotedPassword.getBytes("UTF-16LE");
    mods[0] = new ModificationItem(DirContext.REMOVE_ATTRIBUTE,
    new BasicAttribute("unicodePwd", oldUnicodePassword));
    mods[1] = new ModificationItem(DirContext.ADD_ATTRIBUTE,
    new BasicAttribute("unicodePwd", newUnicodePassword));
    // Perform the update
    ctx.modifyAttributes(userName, mods);
    System.out.println("Changed Password for: " + userName);
    ctx.close();
    }catch (NamingException e) {
    System.err.println("Problem changing password: " + e);
    }catch (UnsupportedEncodingException e) {
    System.err.println("Problem encoding password: " + e);
    }

    the exception is :
    javax.naming.directory.InvalidAttributeValueException: [LDAP: error code 19 - 0000052D: AtrErr: DSID-03190F00, #1:
         0: 0000052D: DSID-03190F00, problem 1005 (CONSTRAINT_ATT_TYPE), data 0, Att 9005a (unicodePwd)
                          thanks!                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Javax.naming.directory.InvalidAttributeValueException: [LDAP: error code 21

    I have collected the following code from "http://www.concentric.net/~adhawan/tutorial/"
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    import javax.naming.NameAlreadyBoundException;
    import javax.naming.directory.*;
    import java.util.*;
    public class MakeRoot {
            final static String ldapServerName = "localhost";
            final static String rootdn = "cn=Manager, o=jndiTest";
            final static String rootpass = "secret";
            final static String rootContext = "o=jndiTest";
            public static void main( String[] args ) {
                    // set up environment to access the server
                    Properties env = new Properties();
                    env.put( Context.INITIAL_CONTEXT_FACTORY,
                             "com.sun.jndi.ldap.LdapCtxFactory" );
                    env.put( Context.PROVIDER_URL, "ldap://" + ldapServerName + "/" );
                    env.put( Context.SECURITY_PRINCIPAL, rootdn );
                    env.put( Context.SECURITY_CREDENTIALS, rootpass );
                    try {
                            // obtain initial directory context using the environment
                            DirContext ctx = new InitialDirContext( env );
                            // now, create the root context, which is just a subcontext
                            // of this initial directory context.
                            ctx.createSubcontext( rootContext );
                    } catch ( NameAlreadyBoundException nabe ) {
                            System.err.println( rootContext + " has already been bound!" );
                    } catch ( Exception e ) {
                            System.err.println( e );
    }I am using the ldap server at here:
    http://download.bergmans.us/openldap/openldap-2.2.29/openldap-2.2.29-db-4.3.29-openssl-0.9.8a-win32_Setup.exe
    My slap.conf is:database     bdb
    suffix          "dc=jndiTest"
    rootdn          "cn=Manager,dc=jndiTest"
    # Cleartext passwords, especially for the rootdn, should
    # be avoid.  See slappasswd(8) and slapd.conf(5) for details.
    # Use of strong authentication encouraged.
    rootpw          secret
    # The database directory MUST exist prior to running slapd AND
    # should only be accessible by the slapd and slap tools.
    # Mode 700 recommended.
    directory     ./data
    # Indices to maintain
    index     objectClass     eqWhile running this code:
    ldap://localhost:389/
    javax.naming.directory.InvalidAttributeValueException: [LDAP: error code 21 - ob
    jectClass: value #0 invalid per syntax]; remaining name 'dc=jndiTest'
            at com.sun.jndi.ldap.LdapCtx.mapErrorCode(Unknown Source)
            at com.sun.jndi.ldap.LdapCtx.processReturnCode(Unknown Source)
            at com.sun.jndi.ldap.LdapCtx.processReturnCode(Unknown Source)
            at com.sun.jndi.ldap.LdapCtx.c_createSubcontext(Unknown Source)
            at com.sun.jndi.ldap.LdapCtx.c_createSubcontext(Unknown Source)
            at com.sun.jndi.toolkit.ctx.ComponentContext.p_createSubcontext(Unknown
    Source)
            at com.sun.jndi.toolkit.ctx.PartialCompositeContext.createSubcontext(Unk
    nown Source)
            at com.sun.jndi.toolkit.ctx.PartialCompositeContext.createSubcontext(Unk
    nown Source)
            at javax.naming.InitialContext.createSubcontext(Unknown Source)
            at MakeRoot.main(MakeRoot.java:35)It's obviously connecting with the given credentials and provider url. But then why is it not working?
    Any help would highly appreciated. Thanks in advance.

    That is right I agree. And I guess that happened because I was trying to doing different permutation-combination with the naming scheme and I forgot to update slapd.conf. And even after made that change it was showing the same error. The poster forgot to mention to include java.schema. That change made it work finally.
    Thanks for your reply.

  • Design console and javax.naming.directory.basicattributes class

    Hi all,
    Is it possible to do the following in the design console?
    BasicAttributes basicattributes = new BasicAttributes(true);
    basicattributes.put(new BasicAttribute(contextName, "Weblink"));
    basicattributes.put(new BasicAttribute(contextCode, "Web001"));
    your help would be much appreciated..

    While Kodo cannot persist those elements out of the box, you can easily
    use the externalization framework to persist the data in a format your
    database and Kodo can understand.
    http://solarmetric.com/Software/Documentation/3.1.3/docs/ref_guide_meta_ext.html#externalizer
    ouhmmou wrote:
    Hello,
    I'd like to know if KODO implementation (or JDO spec) could manage java
    objects such as javax.naming.directory.BasicAttribute and
    javax.naming.directory.BasicAttributes !
    because I am using those classes in my application but without succes.
    thanks you for your help
    smail
    Steve Kim
    [email protected]
    SolarMetric Inc.
    http://www.solarmetric.com

  • How to convert a text file content to String in JSP?

    Hi,
    I need to read the content of a text file and convert it into String and display it on to a JSP file.
    But the codings below don't work. Please advise me on how can i display the text file content.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    File adCheck = new File("list.txt");
    fis = new FileInputStream(adCheck);
    int Length = adCheck.length();
    byte arr[] = new byte[Length];
    int dataRead = 0;
    int totalData = 0;
    while(totalData <Length)
         dataRead = fis.read(arr,totalData,Length);
         totalData += dataRead;
    String Content = new String(arr);//byte array converted to String
    arr = null;

         InputStreamReader in=new InputStreamReader(fis);
          StringWriter out=new StringWriter();
          char[] buffer=new char[8192];
          int sizeRead;
          while ( ( sizeRead=in.read(buffer, 0, 8192) ) != -1 )
            out.write(buffer, 0, sizeRead);
         String content=out.toString();

  • How to convert an array of Integers into String

    So how can an array of integers be converted into a string?
    As I do not have a javac with me now, I hope you guys could help.
    Can it be done this way:
    int [] value = new int[] {2,3,4,5,6,7}
    String strValue = "";
    for (i=0; i<value.length-1; i++)
    strValue += value;

    Instead of working with Strings, I would suggest you use a StringBuffer. It will improve memory utilization.
    Like this:
    int [] values = new int[] {2,3,4,5,6,7};
    StringBuffer sbTmp = new StringBuffer();
    final int size = values.length;
    for (i = 0; i < size; i++) {
    String intStr = Integer.toString(values);
    sbTmp.append(intStr);
    String strValues = sbTmp.toString();

  • How to convert digital signal to hexadecima​l string?

    Hi!
    My problem seemed to be very easy but I cannot find a simple solution. Namely, I have to make a simple project that acquires bits from a single digital line (not that it is important but I use one channel of a PXI 6552) and stores a certain number of bits (let’s say 1000 bits) from the channel in a txt file in hexadecimal format. I can convert it to a binary array of unsigned integers and make a loop that reads every 4 bits and calculate hexadecimal value but is it possible that there is no simpler way?!
    Thank you!
    Solved!
    Go to Solution.

    Thank you for your prompt reply! I understand that hexadecimal is just a format of presenting data but I have a problem to write digital data in that format to a txt file.  
    To make it easier for understanding and for testing purposes as well, I have made a test program that reads hexadecimal values from a txt file (the structure of this file is the structure I need to get at the end), transforms it in a digital stream as I get from the pxi 6552 (I had to change a bit the VI DTbl Binary U8 to Digital Stream.vi), and write it back to a txt file. This test program still needs some fixing to make input and output file exactly the same, but for the start output file is a txt file with hexadecimal values of my digital stream. I was wondering if there is a simpler solution for the while loop in this example.
    I hope this example made it clearer a bit.
    Attachments:
    WriteToFileHex.vi ‏21 KB
    DTbl Binary U8 to Digital StreamIva.vi ‏19 KB
    barker_tab.txt ‏1 KB

  • How to convert a VISA Resource Name to String?

    I would like to convert a VISA Resource Name (invalid reference) to string so I can open a session to a GPIB instrument.

    You can typcast the VISA Resource Name, but I usually just treat it like a string. You can connect it directly to string indicators or to any VI that takes a string input. You can even search, concatenate and split it like a string. You can also feed strings into the VISA Resource Name inputs of the VISA functions.
    Rob

  • How do convert selected item in JComboBox to String?

    I'm trying to get an option from a JComboBox to print in a JTextArea upon click.
    I've tried many ways, including converting to String, String array, and using textArea.append which doesn't seem to work either. .
    can anyone help?

    toString and actionlistener, bah. figured it out, sorry to trouble you :)

  • Ldap Search getting a javax.naming.AuthenticationNotSupportedException

    Hi,
    Can anyone help me why i am getting Authentication Exception, is there anything wrong in the Code.(This Code i got from sun site)
    I have passed the correct admin user id and password, The PROVIDER_URL is also ok.
    If i comment the below two line it works fine. But Search doesnot go inside the if block
    env.put(Context.SECURITY_CREDENTIALS,"<admin id given>");
    env.put(Context.SECURITY_AUTHENTICATION, "<password given>");
    Can any one help me.
    Or can any help me with a sample code for userAuthentication in LDAP using JNDI for MS-ADS
    My Code is as followes
    =======================================================================
    import javax.naming.directory.*;
    import javax.naming.*;
    import java.util.*;
    import java.io.*;
    public class LDAPConn
         public java.lang.Object Conn;
         public void startSearch() throws Exception
              Hashtable env = new Hashtable(11);
              DirContext ctx = null;
              try
                   ctx = new InitialDirContext(env);
                   env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
                   env.put(Context.PROVIDER_URL, "ldap://ipaddress:389/dc=xyz,dc=com");
                   env.put(Context.SECURITY_CREDENTIALS,"<admin id given>");
                   env.put(Context.SECURITY_AUTHENTICATION, "<password given>");
                   ctx = new InitialDirContext(env);
                   String[] attrIDs = {"sn", "telephonenumber", "mail"};
                   Attributes matchAttrs = new BasicAttributes(true);
                   matchAttrs.put(new BasicAttribute("sn", "Anil"));
                   matchAttrs.put(new BasicAttribute("mail","[email protected]"));
                   NamingEnumeration answer = ctx.search("cn=Users",matchAttrs, attrIDs);
                   if (answer.hasMore())
                        System.out.println("Search Success");
                   ctx.close();
              }catch(Exception e)
                   e.printStackTrace();
              return ctx;
         public static void main(String str[])
              try
                   (new LDAPConn()).startSearch();
              }     catch(Exception e)
                   e.printStackTrace();
    =======================================================================
    Thanks
    Gopi

    Hi kenty
    Thanks for your help.
    My Code is working now. I am able to connect to LDAP server.
    for the following code i am getting the output like this
    ===================== Code ===================
    String[] attrIDs = {"cn"};
    Attributes matchAttrs = new BasicAttributes(true);
    matchAttrs.put(new BasicAttribute("cn", "Souvik Mukherjee"));
    NamingEnumeration results = ctx.search("cn=Users",matchAttrs, attrIDs);
    while (results != null && results.hasMore())
    SearchResult si = (SearchResult)results.next();
    System.out.println("name: " + si.getName());
    Attributes attrs = si.getAttributes();
    if (attrs == null)
    System.out.println("No attributes");
    } else {
    for (NamingEnumeration ae = attrs.getAll();
    ae.hasMoreElements();) {
    Attribute attr = (Attribute)ae.next();
    String attrId = attr.getID();
    for (Enumeration vals = attr.getAll();
    vals.hasMoreElements();
    System.out.println(attrId + ": " + vals.nextElement()));
    ==================Output==================
    name: CN=Souvik Mukherjee
    cn: Souvik Mukherjee
    My Requirement is now By passing the userid and validating the password of "Souvik Mukherjee" Or listing all attributes of "Souvik Mukherjee".
    How to do this?
    Where will i see in MS-ADS attributes like 'cn' etc.. Because my SysAdmin told me he has used default settings while installing ADS.
    Regards & Thanks
    Gopi

  • [OBPM 10gR3]How to configer a hybrid directory with Oracle LDAP Server

    Hey, guys,
    Does anyone have experience on configering a hybrid directory with Oracle LDAP Server? How to config the mapping conf file for Oracle LDAP in the directory of \OraBPMwlHome\conf?
    Here is my conf file. But I got some LDAP mapping errors. It's really weird OBPM doesn't support Oracle's self LDAP, at least it does not provide the conf file.
    -----------errors------------
    Exception [javax.naming.OperationNotSupportedException: [LDAP: error code 53 - Function Not Implemented]; remaining name '']. Reason: [LDAP: error code 53 - Function Not Implemented] fuego.directory.DirectoryRuntimeException: Exception [javax.naming.OperationNotSupportedException: [LDAP: error code 53 - Function Not Implemented]; remaining name '']. at fuego.directory.DirectoryRuntimeException.wrapException(DirectoryRuntimeException.java:85) at fuego.directory.hybrid.ldap.JNDIQueryExecutor.select(JNDIQueryExecutor.java:203) at fuego.directory.hybrid.ldap.JNDIQueryExecutor.selectAllFromView(JNDIQueryExecutor.java:84) at fuego.directory.hybrid.ldap.JNDIQueryExecutor.selectAllFromView(JNDIQueryExecutor.java:64) at fuego.directory.hybrid.ldap.Repository.selectAllFromView(Repository.java:54) at fuego.directory.hybrid.ldap.LDAPPollingEventGenerator.buildCurrentProxies(LDAPPollingEventGenerator.java:98) at fuego.directory.provider.notifiers.BasePollingEventGenerator.generateEvents(BasePollingEventGenerator.java:41) at fuego.directory.hybrid.HybridMultipleEventGenerator.generateEvents(HybridMultipleEventGenerator.java:43) at fuego.directory.provider.notifiers.DirectoryNotifier.notifyChanges(DirectoryNotifier.java:403) at fuego.server.service.DirectoryListener.updateEngineFromDirectoryImpl(DirectoryListener.java:309) at fuego.server.service.DirectoryListener$DirectoryPollingItem.execute(DirectoryListener.java:351) at fuego.server.execution.DefaultEngineExecution$AtomicExecutionTA.runTransaction(DefaultEngineExecution.java:304) at fuego.transaction.TransactionAction.startBaseTransaction(TransactionAction.java:470) at fuego.transaction.TransactionAction.startTransaction(TransactionAction.java:551) at fuego.transaction.TransactionAction.start(TransactionAction.java:212) at fuego.server.execution.DefaultEngineExecution.executeImmediate(DefaultEngineExecution.java:123) at fuego.server.execution.DefaultEngineExecution.executeAutomaticWork(DefaultEngineExecution.java:62) at fuego.server.execution.EngineExecution.executeAutomaticWork(EngineExecution.java:42) at fuego.ejbengine.ejb.EngineStartupBean.executeItem(EngineStartupBean.java:192) at fuego.ejbengine.ejb.EngineStartupBean.updateFromDirectory(EngineStartupBean.java:172) at fuego.ejbengine.ejb.engine_startup_bpmengine_wodkyx_ELOImpl.updateFromDirectory(engine_startup_bpmengine_wodkyx_ELOImpl.java:365) at fuego.ejbengine.servlet.SchedulerServlet$DirectoryPollingTask.runImpl(SchedulerServlet.java:269) at fuego.ejbengine.servlet.SchedulerServlet$ScheduledTask.run(SchedulerServlet.java:208) at java.util.TimerThread.mainLoop(Timer.java:512) at java.util.TimerThread.run(Timer.java:462) Caused by: javax.naming.OperationNotSupportedException: [LDAP: error code 53 - Function Not Implemented]; remaining name '' at com.sun.jndi.ldap.LdapCtx.mapErrorCode(LdapCtx.java:3078) at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2951) at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2758) at com.sun.jndi.ldap.LdapCtx.searchAux(LdapCtx.java:1812) at com.sun.jndi.ldap.LdapCtx.c_search(LdapCtx.java:1735) at com.sun.jndi.toolkit.ctx.ComponentDirContext.p_search(ComponentDirContext.java:368) at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.search(PartialCompositeDirContext.java:338) at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.search(PartialCompositeDirContext.java:321) at javax.naming.directory.InitialDirContext.search(InitialDirContext.java:248) at fuego.jndi.FaultTolerantDirContext.search(FaultTolerantDirContext.java:867) at fuego.directory.hybrid.ldap.JNDIQueryExecutor.select(JNDIQueryExecutor.java:190) ... 23 more
    -----------mapping conf file for Oracle LDAP---------
    <?xml version="1.0" encoding="UTF-8"?>
    <?fuego version="6.1 ALPHA" application="albpmenterprise"?>
    <!-- This file contains the propper attribute mapping for the FDI Generic Ldap Provider using Oracle Directory Service.          
    * Preference for group object
              <preference id="assignedParticipants.containsId" value="true"/>
              This preference is useful to speed up the provider and it can only be used if the assignedParticipant value is the dn of the user and the dn contains the participant id
              <preference id="assignedParticipants.containsId" value="true"/>
              This preference is useful to speed up the provider and it can only be used if the assignedGroup value is the dn of the group and the dn contains the group id
              <preference id="modifyTimeStamp.suffix" value="Z"/>
              This preference is useful when the suffix mofidyTimeStamp format of your ldap is not .OZ.
    -->
    <config>
         <object id="person">
              <object-filter>
                   <![CDATA[
                        (objectclass=inetOrgPerson)
                   ]]>
              </object-filter>
              <relative-dn>
                   <!-- the relative dn for person -->
              </relative-dn>
              <attribute id="id" value="uid"/>
              <attribute id="lastName" value="sn"/>
              <attribute id="firstName" value="givenname"/>
              <attribute id="accountLock" value="orclIsEnabled">
                   <attribute-comparator operation="EQUALS" compareTo="ENABLED"/>
                   <filter>
                        <![CDATA[
                             ($accountLock=ENABLED)
                        ]]>
                   </filter>
              </attribute>
              <attribute id="facsimileTelephoneNumber" value="facsimileTelephoneNumber"/>
              <attribute id="displayName" value="displayName"/>
              <attribute id="mail" value="mail"/>
              <attribute id="telephoneNumber" value="telephoneNumber"/>
              <attribute id="employeeId" value="employeeNumber"/>
              <attribute id="thumbnailPhoto" value="jpegPhoto"/>
              <attribute id="manager" value="manager"/>
              <attribute id="modifyTimeStamp" value="modifytimestamp"/>
         </object>
         <object id="group">
              <object-filter>
                   <![CDATA[
                        (objectclass=orclGroup)
                   ]]>
              </object-filter>
              <relative-dn>
                   <!-- the relative dn for group -->
    </relative-dn>
              <attribute id="id" value="dn"/>
              <attribute id="modifyTimeStamp" value="modifytimestamp"/>
              <attribute id="displayName" value="displayName"/>
              <attribute id="name" value="cn"/>
              <attribute id="description" value="description"/>
              <attribute id="assignedParticipants" value="uniquemember"/>
              <!--attribute id="assignedGroups" value="memberOf"/-->
              <attribute id="ou" value="uniquemember"/>
         </object>
         <object id="ou">
              <object-filter>
                   <![CDATA[
                        (objectclass=domain)
                   ]]>
              </object-filter>
              <relative-dn>
                   <!-- the relative dn for ous -->
    </relative-dn>
              <attribute id="name" value="orclsubscriberfullname"/>
              <attribute id="description" value="description"/>
         </object>
    </config>
    Edited by: Lemonice on 2009-3-30 上午2:08
    Edited by: Lemonice on 2009-3-30 下午7:01
    Edited by: Lemonice on 2009-3-30 下午8:43

    Hi,
    in my case, I am trying to configure the OBPM directory using ALUI and its native LDAP service.
    Now, I found that the first name and the last name in BPM are retrieved from the ALUI display name : provided we enter the display name in the format %first name% + %last name% we get them into BPM. But the display name is not always in this format...
    In addition, it's the portal telephone number information which is retrieved into BPM Telephone and Fax numbers.
    And, the email adress remains blank
    I have installed the latest patch for OBPM (Version: 10.3.1.0.0 Build: #97172)
    Would you have any documentation about creating a Profile Web Service in ALUI and specifying which LDAP attributes to map to which ALUI properties in the Profile Source ?
    Thanks !
    Edited by: vVince on May 6, 2009 3:46 PM

  • Javax.naming.NameAlreadyBoundException [LDAP: error code 68

    I am getting the below Error when I am trying to add the entry into the LPAD Server.
    javax.naming.NameAlreadyBoundException: [LDAP: error code 68 - Entry Already Exists]; remaining name 'ou=People,dc=company,dc=co,dc=in'
         at com.sun.jndi.ldap.LdapCtx.mapErrorCode(Unknown Source)
         at com.sun.jndi.ldap.LdapCtx.processReturnCode(Unknown Source)
         at com.sun.jndi.ldap.LdapCtx.processReturnCode(Unknown Source)
         at com.sun.jndi.ldap.LdapCtx.c_bind(Unknown Source)
         at com.sun.jndi.ldap.LdapCtx.c_bind(Unknown Source)
         at com.sun.jndi.toolkit.ctx.ComponentContext.p_bind(Unknown Source)
         at com.sun.jndi.toolkit.ctx.PartialCompositeContext.bind(Unknown Source)
         at com.sun.jndi.toolkit.ctx.PartialCompositeContext.bind(Unknown Source)
         at javax.naming.InitialContext.bind(Unknown Source)
         at com.test.CreateUser.main(CreateUser.java:54)
    I am using the following sample program to test this.
    public class CreateUser {     
    public static void main(String[] args) {
         java.util.Hashtable env = new java.util.Hashtable();
         env.put( javax.naming.Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory" );
         env.put( javax.naming.Context.PROVIDER_URL, "ldap://c-4966:62260");
         env.put( javax.naming.Context.SECURITY_AUTHENTICATION, "simple");
         env.put( javax.naming.Context.SECURITY_PRINCIPAL, "cn=Directory Manager");
         env.put( javax.naming.Context.SECURITY_CREDENTIALS, "test");
         String dn = "ou=People,dc=company,dc=co,dc=in";     
         try {
         // create DirContext
         DirContext ctx = new InitialDirContext(env);
         // Attributes for new entry
         Attributes attrs = new BasicAttributes();
         Attribute attr = new BasicAttribute("objectclass");
         attr.add( 0, "top" );
         attr.add( 1, "person" );
         attr.add( 2, "organizationalPerson" );
         attr.add( 3, "inetorgperson" );
         attrs.put(attr);
         System.out.println("1...........");           
         attrs.put("cn", "Sai Krishna");
         attrs.put("sn", "Potluri");
         attrs.put("givenName","Sia Potluri");
         attrs.put("uid","saipotluri");
         attrs.put("userPassword", "balaji");
         /*attr = new javax.naming.directory.BasicAttribute("mail");
         attr.add( 0, "[email protected]" );
         attr.add( 1, "[email protected]" );
         attrs.put( attr );
         attrs.put( "telephonenumber", "111-1111-3333" );*/
         System.out.println("2...........");
         ctx.bind(dn, attrs);
         } catch ( javax.naming.NamingException ex ) {
         System.err.println("Fail to Add Entry\n");
         ex.printStackTrace();
    Any help is highly appreciated.
    Thanks in Advance
    DARMA

    You're adding the entry "ou=people,dc=company,dc=co,dc=in" and not an entry under "ou=people,dc=company,dc=co,dc=in".
    The dn of the new entry should be something like "cn=Sai Krishna,ou=people,dc=company,dc=co,dc=in" when you call ctx.bind(dn,...)

  • Handlling exception: javax.naming.PartialResultException: Unprocessed Conti

    I am running the following Java Code (in an agent in Lotus Notes, hence some of the odd bits). I've searched long and hard. I know I'm getting my error because I am searching the from the base DN in AD.
    It also appears you can't get around this with referrals settings as AD doesn't support them. I having trouble with the whole global catalog thing too.
    However, my code is working and returning the field I need. I would like to handle the error and get on with things.
    Now I am not a java programmer. Is it possible to handle the error and return to the code that generated it, or am I finished with the 'try' stuff as soon as my first exception is thrown?
    Sorry if this is a stupid question.
    import lotus.domino.*;
    import javax.naming.*;
    import javax.naming.directory.*;
    import java.util.Hashtable;
    import java.util.Vector;
    public class JavaAgent extends AgentBase {
         public void NotesMain() {
              String userName="jmbramich";
              try {
                   Session session = getSession();
                   AgentContext agentContext = session.getAgentContext();
              // Hashtable stores LDAP connection specifics.
                   Hashtable env = new Hashtable();
                   env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
                   env.put(Context.PROVIDER_URL, "ldap://hqdc01.prisons.ie:389");
    //               env.put(Context.PROVIDER_URL, "ldap://hqdc01.prisons.ie:3268");
                   env.put(Context.SECURITY_PRINCIPAL, "CN=L D. dapsearch,OU=LDAP,OU=Rescon,OU=Administrators,DC=PRISONS,DC=IE");
                   env.put(Context.SECURITY_CREDENTIALS, "gu1nne55");
                   DirContext ctx = new InitialDirContext(env);
                   // Specify the ids of the attributes to return
                   String[] attrIDs = {"postOfficeBox"};
                   SearchControls ctls = new SearchControls();
                   ctls.setReturningAttributes(attrIDs);
                   ctls.setSearchScope(SearchControls.SUBTREE_SCOPE);
                   // Specify the search filter to match
                   String filter = "(&(sAMAccountName=" + userName + ")(postOfficeBox=*))";
                   // Search the subtree for objects by using the filter
                   NamingEnumeration answer = ctx.search("DC=PRISONS,DC=IE", filter, ctls);
                   while (answer.hasMore()) {
                   SearchResult sr = (SearchResult)answer.next();
                   System.out.println(">>>" + sr.getName());
                   Attributes attrs = sr.getAttributes();
                   System.out.println(attrs.get("postOfficeBox").get());                                    
                   answer.close();
                   ctx.close();               
              } catch(Exception e) {
                   e.printStackTrace();
    Errors:
    javax.naming.PartialResultException: Unprocessed Continuation Reference(s); remaining name 'DC=PRISONS,DC=IE'
         at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2528)
         at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2502)
         at com.sun.jndi.ldap.LdapNamingEnumeration.getNextBatch(LdapNamingEnumeration.java:145)
         at com.sun.jndi.ldap.LdapNamingEnumeration.hasMore(LdapNamingEnumeration.java:181)
         at JavaAgent.NotesMain(JavaAgent.java:38)
         at lotus.domino.AgentBase.runNotes(Unknown Source)
         at lotus.domino.NotesThread.run(NotesThread.java:208)
    Error cleaning up agent threads

    Ok, managed to work this out. Needed a baby try/catch around a bit of my code so the error can be ignored - once this is done the notes agent doesn't have any problems taking out the garbage at the end.
    Final code:
    import lotus.domino.*;
    import javax.naming.*;
    import javax.naming.directory.*;
    import java.util.Hashtable;
    import java.util.Vector;
    public class JavaAgent extends AgentBase {
         public void NotesMain() {
              String userName="jmbramich";
              try {
                   Session session = getSession();
                   AgentContext agentContext = session.getAgentContext();
              // Hashtable stores LDAP connection specifics.
                   Hashtable env = new Hashtable();
                   env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
                   env.put(Context.PROVIDER_URL, "ldap://hqdc01.prisons.ie:389");
    //               env.put(Context.PROVIDER_URL, "ldap://hqdc01.prisons.ie:3268");
                   env.put(Context.SECURITY_PRINCIPAL, "CN=L D. dapsearch,OU=LDAP,OU=Rescon,OU=Administrators,DC=PRISONS,DC=IE");
                   env.put(Context.SECURITY_CREDENTIALS, "gu1nne55");
         System.out.println("Creating Context.");
                   DirContext ctx = new InitialDirContext(env);
                   // Specify the ids of the attributes to return
                   String[] attrIDs = {"postOfficeBox"};
                   SearchControls ctls = new SearchControls();
                   ctls.setReturningAttributes(attrIDs);
                   ctls.setSearchScope(SearchControls.SUBTREE_SCOPE);
                   // Specify the search filter to match
                   String filter = "(&(sAMAccountName=" + userName + ")(postOfficeBox=*))";
                   // Search the subtree for objects by using the filter
         System.out.println("Running Search...");
                   NamingEnumeration answer = ctx.search("DC=PRISONS,DC=IE", filter, ctls);
                   try {
                        while (answer.hasMore()) {
                        SearchResult sr = (SearchResult)answer.next();
                        System.out.println(">>>" + sr.getName());
                        Attributes attrs = sr.getAttributes();
                             System.out.println(attrs.get("postOfficeBox").get());                                    
                   catch(PartialResultException e) {
                        //e.printStackTrace();
                   answer.close();
                   ctx.close();
              catch(Exception e) {
                   e.printStackTrace();
    }

  • Javax.naming.NotContextException when trying to bind to a context

    Hi all.
    I am trying to use file system service provider.
    This is how I create the context:
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY,
    "com.sun.jndi.fscontext.RefFSContextFactory");
    env.put(Context.PROVIDER_URL, "file:/test");
    DirContext ctx = new InitialDirContext(env);
    When I try to invoke bind on ctx ;
    ctx.bind(name, obj, attrs)
    I get exception:
    javax.naming.NotContextException: Not an instance of DirContext
    at javax.naming.directory.InitialDirContext.getURLOrDefaultInitDirCtx(Unknown Source)
    Can anyone help me get around this problem.
    thanks.

    I don't think that
    com.sun.jndi.fscontext.RefFSContextFactory
    supports DirContext; just Context.

Maybe you are looking for

  • At what point is a user record created in the WWSEC_PERSON$ table?

    Hello - We are using OID for our SSO into the Oracle Portal. When we sync AD -> OID, when I query the Portal WWSEC_PERSON$ table and the new users are not present. I have to go into the Portal Administration page, query one of the users and set a def

  • Ipod touch is disabled and will not sync  to our new computer.

    My daughter's ipod touch is disabled and says connect to itunes. However, we have a new computer and the ipod has never been synced to it. The last computer it was synced to does not work. We have itunes on the current computer but I cannot get it to

  • RFC to exchange the tax data from r3 to srm

    Hi Gurus, We are using SRM ECS and our backend is connected to TAXWARE. Currently tax code in backend is determined using condition technique, can you please let me know how can we implement this in SRM. or is there any  RFC/BAPI that can be used to

  • ICR Process 003 Uploads

    We are currently running process 003 for ICR for all of our companies on SAP 6.0.  I would like to incorporate the companies not on SAP via the upload of vendor and customer items feature.  There doesn't seem to be mention of exactly how to do this i

  • PBXX condition price

    Hi all, When i create a new PO, prices from previous POs (which have the same material and the same vendor as the new PO) are automatically reused, does anyone know where is it customised? If the currency is different  (ex:previous po in USD, new po