How can I get the people's attribute from LDAP?

The LDAP Server is Netscape Directory Server 4.1.
I have been trying to connect to my LDAP server from WLS, but when I try to get an Attributes , I get a "No attributes".
The source code is following:
Hashtable env = new Hashtable(11);
env.put(Context.INITIAL_CONTEXT_FACTORY,
"com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.PROVIDER_URL, "ldap://10.0.1.253:389/o=rl.com");
// Create the initial directory context
DirContext ctx = new InitialDirContext(env);
// Ask for all attributes of object
Attributes attrs = ctx.getAttributes("uid=joe,ou=People");
// Find the surname ("sn") and print it out
System.out.println("sn: " + attrs);
dn: uid=joe,ou=People, o=rl.com
objectclass: top
objectclass: person
objectclass: organizationalPerson
objectclass: inetOrgPerson
cn: Joe Ken
uid: joe
givenName: Joe
sn: Ken

When you initialize the context, you must have read priviledges.
I have resolve it.
Cui Qiang <[email protected]> wrote in message
news:39fe94ac$[email protected]..
>
The LDAP Server is Netscape Directory Server 4.1.
I have been trying to connect to my LDAP server from WLS, but when I tryto get an Attributes , I get a "No attributes".
The source code is following:
Hashtable env = new Hashtable(11);
env.put(Context.INITIAL_CONTEXT_FACTORY,
"com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.PROVIDER_URL, "ldap://10.0.1.253:389/o=rl.com");
// Create the initial directory context
DirContext ctx = new InitialDirContext(env);
// Ask for all attributes of object
Attributes attrs = ctx.getAttributes("uid=joe,ou=People");
// Find the surname ("sn") and print it out
System.out.println("sn: " + attrs);
dn: uid=joe,ou=People, o=rl.com
objectclass: top
objectclass: person
objectclass: organizationalPerson
objectclass: inetOrgPerson
cn: Joe Ken
uid: joe
givenName: Joe
sn: Ken

Similar Messages

  • I have about 800 more songs on my nano than itunes, due to a crash. How can I get the songs onto itunes from the ipod, or at least get the new music ive gotten since the crash onto my ipod without deleting all the other songs when it syncs?

    i have about 800 more songs on my nano than itunes, due to a crash. How can I get the songs onto itunes from the ipod, or at least get the new music ive gotten since the crash onto my ipod without deleting all the other songs when it syncs?

    It has always been very basic to always maintain a backup copy of your computer for just such an occasion.  Use your backup copy to put everything back.
    If you have failed to bakup, then you can transfer itunes purchases from an ipod: File>Transfer Purchases

  • How can I get the built in apps from iPad 2 to my iPad 1?

    How can I get the built in apps from ipad2 to my iPad 1?

    Is your iPad 2 running iOS 5.0.1 and your ipad 1 running iOS 4? If this is the case then go through the update process on your iPad 1. All the iPad 2 apps running on iOS 5 that are compatible with the iPad 1 will be put on your iPad 1. Those apps that require a camera will not appear because the iPad 1 does not have a camera.

  • How can we get the selected line number from JTextArea ?

    how can we get the selected line number from JTextArea ? and want to insert line/string given line number into JTextArea??? is it possible ?

    Praitheesh wrote:
    how can we get the selected line number from JTextArea ?
    textArea.getLineOfOffset(textArea.getCaretPosition());
    and want to insert line/string given line number into JTextArea??? is it possible ?
    int lineToInsertAt = 5; // Whatever you want.
    int offs = textArea.getLineStartOffset(lineToInsertAt);
    textArea.insert("Text to insert", offs);

  • How can i get the music ive copied from cd onto my new computer

       how can i get the music that i have copied from cd's on to my new computer.(the computer my phone was sync to blew up)  if i sync to the newit i will all the music  thats on my phone, 

    Restore from the backup of your old computer. Copy it from the CDs.
    Look for a 3rd party app that can do what you want. Senuti has been
    mentioned in the past - I do not use it so cannot comment on how
    well it works. I would assume there are others as well.
    iOS does not natively support syncing music back from the iPhone
    to a computer.

  • How can I get the username and password from Oracle Forms to PJC !

    Dear Sir,
    I have username,password and push button fields in oracle forms. When user clicks the push button, I need to get username and password field contents to my Pluggable Java Program to authenticate the user trying to login. How can I get those text field contents to my java program..? Looking forward from you soon sir.
    Thanks in Advance,
    S Ramkumar

    I tried that trigger but nothing reflects. I write that method in WHEN_BUTTON_PRESSED trigger.
    In the form module I written,
    Set_Custom_Property('BL.USERNAME',1,'NAME','');
    Set_Custom_Property('BL.PASSWORD',1,'PASS','');
    Implementation class of the push button I gave my java class file name.
    In Java Code I tried register the form fields like,
    public static final ID userName = ID.registerProperty("NAME");
    public static final ID passWord = ID.registerProperty("PASS");
    In Java Code I tried get the contents from registered properties,
    public boolean setProperty(ID property, Object value) {
    if(property == userName) {
    System.out.println("Just I wish to see the name entered" + value.toString());
    if(property == passWord) {
    System.out.println("Just I wish to see the pass entered" + value.toString());
    But even System.out.println() is working.
    What's wrong with this code sir ???
    Can you tell me How to register and get those field values in Java ?

  • I somehow lost a large amount of my music downloads and albums that I had uploaded to iTunes.  How can I get the items I downloaded from iTunes Store again?

    I upgraded my Anti-Virus and it included a storage box which I tried to use but it filled up with my iTunes music so I deleted that but evidently it also removed a lot of my music from my iTunes libraries.  I can re-upload all the music from CDs but how do I replace the music I bought from the iTunes Store?  I really don't want to buy the music again, in fact I just can't do that.  Any suggestions?

    LindyLouToo wrote:
    ...  how do I replace the music I bought from the iTunes Store? 
    Download Past Purchases
    Sign in with the Apple ID that you used for the original purchase. See which Apple ID you used to download an item.
    2 )See if the content is available for redownload. Previously purchased items might not be available if they're no longer on the iTunes Store

  • How can i get the reference to Controls from VI-reference

    Hello,
    i have a VI with ~5 controls on it.
    And with the Object "Current VIs path" and "Open VI reference" i can create a reference to the current VI.
    How can i create now a reference to the controls? (Starting with VI-reference?
    Of course i know how to create directly a reference from a control.
    My idea wasm that there areperhaps properties like:
    - Number of controls
    - Name of control
    - Type of control (string, bool. number...)
    Is this somewhere there and i just dont find it?
    Thanks for your help

    Once you have the VI Refnum, it's a two-step process. Wire the VI Refnum into a property node and get a reference to the Front Panel. Output the Front Panel reference into another property node and select the property Controls[ ], which outputs an array of references for all the controls on the front panel.
    Message Edited by Jarrod S. on 04-20-2007 11:06 AM
    Jarrod S.
    National Instruments
    Attachments:
    get_ref.PNG ‏5 KB

  • How can I get the last 18 numbers from this string

    Hi,
    I'm querying this field from a table. How can I only get the last 18 numbers:
    The numbers look like this:
    500000000818118

    If it is always the last 18 numbers just use the Right() function.  Examples:
    Right("500000000818118", 18)
    or
    <cfset mystring = "500000000818118">
    <cfset mynewstring = Right(mystring, 18)>
    or
    #Right(yourquerycolumn, 18)#
    etc.
    Edit:
    Well I just noticed that your example string is only 15 characters long.  Perhaps I mis-understood your question?
    Message was edited by: Miguel-F

  • How can I get the list of tabs from history (URLs) which Mozilla opened using "restore session"

    Hi
    I'm using Mozilla 7.0.1
    Today I got Mozilla crashed, and during the reopening, it crashed the second time. After reopening it second time, it showed me only "about:home" tab.
    At last, I lost my previous session - about 50 tabs.
    History -> "Restore Previous session" command is disabled, also "recently closed tabs" and "recently closed windows" are disabled too.
    History is on, so I can see all history of my Mozilla usage.
    Every day I'm closing my Mozilla with that 50 tabs, and then the next day I'm reopening it. It loads all the tabs.
    Today, before the crash, I opened my Mozilla as usually and it loaded that 50 tabs, so logically he have to write about it in history, or logs, or somewhere else. How can I filter my history to find only that tabs?
    How can I find all 50 tabs, which Mozilla loaded today morning? Is it possible?
    Thanks in advance
    Zorayr

    Upgrade your browser to Firefox 8 and check
    * getfirefox.com

  • How can i get the 10.7 version from a 10.5.8 on my Mac?

    I have a Mac with the 10.5.8 version and everytime i try to check for updates a window pops up and says "YOUR SOFTWARE IS UP TO DATE". I purchased a iPhone 4 and need a version 6.0  How do i download or update so i will have a 6.0 or 10.7??? Please help

    You cannot install iTunes 10.7 unless you upgrade your iMac to Mac OS X 10.6.8 or later, and that upgrade is not free. You can try iTunes 10.6.3:
    http://support.apple.com/kb/DL1575
    That's worked for some people who updated their iOS device to iOS 6 or have wished to do so. If not, then you'll need to upgrade your Mac to Mac OS X 10.6.8 at minimum so you can run iTunes 10.7.
    Regards.

  • How can I get the "BackColor" of button from WinForm application in codedUI?

    I'm newbie in codedUI, I meet some problem when try to get "BackColor" property of WinForm control. I don't see it from property list. Please help me if you know or have some ideas about that. Thanks

    Hi Duy.Hung,
    Based on your issue, I think that you will have to extend the supported properties for controls used by the Coded UI framework.  The following articles will show you how to accomplish this. 
    Extending supported properties set of a control (WinForms example)
    http://blogs.msdn.com/b/gautamg/archive/2010/03/25/extending-supported-properties-set-of-a-control.aspx
    Coded UI Test Extension for 3rd party Windows Forms controls–How to?
    http://blogs.msdn.com/b/visualstudioalm/archive/2011/10/28/coded-ui-test-extension-for-3rd-party-windows-forms-controls-how-to.aspx
    Hope it help you!
    Best Regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How can I get the music I download from an app to show in my library to use my dj app?

    I need to get my music but I can't use iTunes so help me

    What app?  What music?  Why can't you use iTunes?  You want help you have to provide details.  We're not mind readers here.

  • I removed boot camp from my macbook pro and when it restarted it went to disk utility and will not let me restore or set up a new osx , how can i get the macbook to install from the disk i have

    i have tried every possible way in os x utlility to restore or reload from my disk or backup and it will not allow me to do it. I have the original disk with 10.6 but i cant install from it. Please any help would be great as i have a 1200 paper weight

    On the advice of a friend I installed and ran a program on my MacBook called 'IPSecuritas'. This has stopped my wireless network from appearing and disappearing, but I still can't connect. Would really appreciate some help with this.

  • How can I get the black dot wallpaper from my ipad to my iphone. Please help me out

    I would really love to have the black dot wallpaper fro my ipad on my iphone and I cannot find it anywhere. Someone please help me out.

    Why don't you simply do a screen shot of your iPad and then transfer the photo to your iPhone.

Maybe you are looking for

  • How can I switch back to uk store on my iPad

    I Tried to download the bbciplayerglobal app and it stated that it was not available in uk. I was prompted to switch to Ireland store. Now all my apps are displaying in euros and when I try to download it states - you need to switch to uk store. How

  • Double Display on Imac doesn't work under windows, there's a solution?

    Hi, I'm a mac user who needs windows for certain applications, so I've installed it with bootcamp on my Intel based Imac 20''. It's very useful for me having 2 monitors to work also in windows, but there's a problem: when I boot under windows the ima

  • Latest Versions of SonicMQ JMS Provider supported by PI71

    Hello Experts, I have a query on PI-JMS Adapter, where SonicMQ-JMS Provider will be used. As per the below link : http://help.sap.com/saphelp_nwpi71/helpdata/en/cd/d85a9d6fab7d4dbb7ae421f710626c/frameset.htm I do know that the version of SonicMQ supp

  • Photos on Podcast Track

    I have created several podcasts created in Garageband & even have them up on iTunes...all going well. However, even though I have my preferences set to configure the photos to 300x300, sometimes the tops of the photos are getting cut off. Is there a

  • TS1591 iTunes stalling every time it opens

    i just wondered if anyone knew what was wrong with iTunes 10? i cant upgrade until i figure out how to bypass Snow Leopard because dad mac needs Mavericks. His iphone wont show in iTunes and it stalls about every time it is opened..... thanks Kim