Java & LDAP, "anonymous unbind" = err=80

Dear experts,
I've found something strange in my performance tests against DSEE 6.3
Please see below some explanations about this "issue":
I use a simple Java code to test my newly created directory server. When I use a search request with the anonymous user (i.e. Context.SECURITY_AUTHENTICATION="none")...I can notice that a connection code & an error code (A1 - Client aborted connection AND err=80 (unknown error)) are always present in the corresponding logs of this request!
When I use the ldapsearch command line to "simulate" the same request (anonymous), I can see that the logs are completely different (connection code is different AND there is no error code (err=80)), that is: "U1 - Connection closed by unbind client" ; Those last logs are really as expected!
When I use a bind user (Context.SECURITY_AUTHENTICATION="simple") instead of anonymous, both tests (Java and ldapsearch) produce the same result, and the connection code is always the same, that is: U1 - Connection closed by unbind client
Here are the two connection codes:
U1: The server closed the client connection because client sent an UNBIND request.
A1: The client has closed the connection without performing an UNBIND.
I've found this article (http://java.sun.com/docs/books/tutorial/jndi/ldap/operations.html) about "How LDAP Operations Map to JNDI APIs"....
We can see that the UNBIND operation correspond to the (Java) procedure: context.close()....this procedure being of course in my code!
Is there a way in Java to "bypass" this issue for the anonymous user?
Thanks a lot in advance.
Regards,
-Franck

I have updated the ldap java.schema with below entries, it is working fine
objectclass ( 1.3.6.1.4.1.42.2.27.4.2.1
     NAME 'javaContainer'
     DESC 'Container for a Java object'
     SUP top
     STRUCTURAL
     MAY ( o $ cn))

Similar Messages

  • Ldap anonymous directory access

    I have a PCI vulnerability titled "LDAP Anonymous Directory Access permitted" which I need to fix. I disabled anonymous binds in the props of the ldap server object in question. However I guess this was not the fix.
    Is there a difference between anonymous binds and anonymous directory access? I was being told this is my problem - that bind is different than directory access so I fixed the wrong thing. I thought ldap was the directory access protocol, and bind was the connection being made to the directory using ldap. Ok. I'll quit typing now. any help is appreciated.
    Stacie White

    I would recommend this forum: novell.support.edirectory.netware
    Far more traffic.
    Craig Wilson - MCNE, MCSE, CCNA
    Novell Support Forums Volunteer Sysop
    Novell does not officially monitor these forums.
    Suggestions/Opinions/Statements made by me are solely my own.
    These thoughts may not be shared by either Novell or any rational human.
    "StacieWhite" <[email protected]> wrote in message
    news:[email protected]..
    >
    > I have a PCI vulnerability titled "LDAP Anonymous Directory Access
    > permitted" which I need to fix. I disabled anonymous binds in the props
    > of the ldap server object in question. However I guess this was not the
    > fix.
    >
    > Is there a difference between anonymous binds and anonymous directory
    > access? I was being told this is my problem - that bind is different
    > than directory access so I fixed the wrong thing. I thought ldap was
    > the directory access protocol, and bind was the connection being made
    > to the directory using ldap. Ok. I'll quit typing now. any help is
    > appreciated.
    >
    > Stacie White
    >
    >
    > --
    > StacieWhite
    > ------------------------------------------------------------------------
    > StacieWhite's Profile: http://forums.novell.com/member.php?userid=1719
    > View this thread: http://forums.novell.com/showthread.php?t=331489
    >

  • Resetting passwords in AD LDS not honoring password history via Java ldap api

    I am trying to implement reset password functionality for accounts in Windows 2012 R2 AD
    LDS via java ldap api. But it is not honoring password history constraint. When I tried to implement change password it is enforcing password history. I am using the following code to reset password.
    @Override
    public void updatePassword(String password) throws LdapException {
    try {
    String quotedPassword = "\"" + password + "\""; 
    char unicodePwd[] = quotedPassword.toCharArray(); 
    byte pwdArray[] = new byte[unicodePwd.length * 2]; 
    for (int i=0; i pwdArray[i*2 + 1] = (byte) (unicodePwd[i] >>> 8); 
    pwdArray[i*2 + 0] = (byte) (unicodePwd[i] & 0xff); 
    ModificationItem[] mods = new ModificationItem[]{new ModificationItem(DirContext.REPLACE_ATTRIBUTE,new
    BasicAttribute("UnicodePwd", pwdArray))};
    LdapContext ldapContext = (LdapContext)ldapTemplate.getContextSource().getReadWriteContext();
    final byte[] controlData = {48,(byte)132,0,0,0,3,2,1,1};
    BasicControl[] controls = new BasicControl[1];
    final String LDAP_SERVER_POLICY_HINTS_OID = "1.2.840.113556.1.4.2239";
    controls[0] = new BasicControl(LDAP_SERVER_POLICY_HINTS_OID, true, controlData);
    ldapContext.setRequestControls(controls);
    ldapContext.modifyAttributes(getRelativeDistinguishedName(), mods);
    } catch (Exception e) {
    throw new LdapException("Failed to update password for:" + this.getDistinguishedName(),
    e);
    Please let me know if I am doing anything wrong.

    Hi,
    I suggest you check password policy on the AD LDS server.
    If the server is under workgroup mode, then local password policy is applied; if it is domain-joined, domain password policy over-rides local password policy, you may also need to check if there is any PSO configured.
    More information for you:
    AD DS: Fine-Grained Password Policies
    https://technet.microsoft.com/en-us/library/cc770394(v=ws.10).aspx
    Step 4: View a Resultant PSO for a User or a Global Security Group
    https://technet.microsoft.com/en-us/library/cc770848(v=ws.10).aspx
    Best Regards,
    Amy
    Please remember to mark the replies as answers if they help and un-mark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact [email protected]

  • LDAP - Anonymous Search

    Hi,
    I have a piece of code that came with an application that tries to bind to an LDAP server, but, it tries to do so directly with the uid provided, rather than doing a search through the tree before that to get the right DN to authenticate with. I was wondering if someone could help me add the anonymous searching to the script below, which would allow for the authenticate after that to use the DN obtained from the anonymous search.
    -- Script --
    import java.io.IOException;
    import java.sql.SQLException;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import org.apache.log4j.Logger;
    import java.util.Hashtable;
    import javax.naming.directory.*;
    import javax.naming.*;
    public class LDAP extends AppServlet
    /** log4j logger */
    private static Logger log = Logger.getLogger(LDAP.class);
    /** ldap email result */
    private String ldapEmail;
    /** ldap name result */
    private String ldapGivenName;
    private String ldapSurname;
    private String ldapPhone;
    protected void doDSGet(Context context,
    HttpServletRequest request,
    HttpServletResponse response)
    throws ServletException, IOException, SQLException, AuthorizeException
    // check if ldap is enables and forward to the correct login form
    boolean ldap_enabled = ConfigurationManager.getBooleanProperty("ldap.enable");
    if (ldap_enabled)
    JSPManager.showJSP(request, response, "/login/ldap.jsp");
    else
    JSPManager.showJSP(request, response, "/login/password.jsp");
    protected void doDSPost(Context context,
    HttpServletRequest request,
    HttpServletResponse response)
    throws ServletException, IOException, SQLException, AuthorizeException
    // Process the POSTed email and password
    String netid = request.getParameter("login_netid");
    String password = request.getParameter("login_password");
    // Locate the eperson
    EPerson eperson = EPerson.findByNetid(context, netid.toLowerCase());
    EPerson eperson2 = EPerson.findByEmail(context, netid.toLowerCase());
    boolean loggedIn = false;
    // make sure ldap values are null with every request
    ldapGivenName = null;
    ldapSurname = null;
    ldapEmail = null;
    ldapPhone = null;
    // if they entered a netid that matches an eperson
    if (eperson != null && eperson.canLogIn())
    // e-mail address corresponds to active account
    if (eperson.getRequireCertificate())
    // they must use a certificate
    JSPManager.showJSP(request,
    response,
    "/error/require-certificate.jsp");
    return;
    else
    if (ldapAuthenticate(netid, password, context))
    // Logged in OK.
    Authenticate.loggedIn(context, request, eperson);
    log.info(LogManager
    .getHeader(context, "login", "type=ldap"));
    // resume previous request
    Authenticate.resumeInterruptedRequest(request, response);
    return;
    else
    JSPManager.showJSP(request, response, "/login/ldap-incorrect.jsp");
    return;
    // if they entered an email address that matches an eperson
    else if (eperson2 != null && eperson2.canLogIn())
    // e-mail address corresponds to active account
    if (eperson2.getRequireCertificate())
    // they must use a certificate
    JSPManager.showJSP(request,
    response,
    "/error/require-certificate.jsp");
    return;
    else
    if (eperson2.checkPassword(password))
    // Logged in OK.
    Authenticate.loggedIn(context, request, eperson2);
    log.info(LogManager
    .getHeader(context, "login", "type=password"));
    // resume previous request
    Authenticate.resumeInterruptedRequest(request, response);
    return;
    else
    JSPManager.showJSP(request, response, "/login/ldap-incorrect.jsp");
    return;
    // the user does not already exist so try and authenticate them with ldap and create an eperson for them
    else {
    if (ldapAuthenticate(netid, password, context))
    if (ConfigurationManager.getBooleanProperty("webui.ldap.autoregister"))
    // Register the new user automatically
    log.info(LogManager.getHeader(context,
    "autoregister", "netid=" + netid));
    if ((ldapEmail!=null)&&(!ldapEmail.equals("")))
    eperson = EPerson.findByEmail(context, ldapEmail);
    if (eperson!=null)
    log.info(LogManager.getHeader(context,
    "failed_autoregister", "type=ldap_but_already_email"));
    JSPManager.showJSP(request, response,
    "/register/already-registered.jsp");
    return;
    // TEMPORARILY turn off authorisation
    context.setIgnoreAuthorization(true);
    eperson = EPerson.create(context);
    if ((ldapEmail!=null)&&(!ldapEmail.equals(""))) eperson.setEmail(ldapEmail);
    else eperson.setEmail(netid);
    if ((ldapGivenName!=null)&&(!ldapGivenName.equals(""))) eperson.setFirstName(ldapGivenName);
    if ((ldapSurname!=null)&&(!ldapSurname.equals(""))) eperson.setLastName(ldapSurname);
    if ((ldapPhone!=null)&&(!ldapPhone.equals(""))) eperson.setMetadata("phone", ldapPhone);
    eperson.setNetid(netid);
    eperson.setCanLogIn(true);
    Authenticate.getSiteAuth().initEPerson(context, request, eperson);
    eperson.update();
    context.commit();
    context.setIgnoreAuthorization(false);
    Authenticate.loggedIn(context, request, eperson);
    log.info(LogManager.getHeader(context, "login",
    "type=ldap-login"));
    Authenticate.resumeInterruptedRequest(request, response);
    return;
    else
    // No auto-registration for valid certs
    log.info(LogManager.getHeader(context,
    "failed_login", "type=ldap_but_no_record"));
    JSPManager.showJSP(request, response,
    "/login/not-in-records.jsp");
    return;
    // If we reach here, supplied email/password was duff.
    log.info(LogManager.getHeader(context,
    "failed_login",
    "netid=" + netid));
    JSPManager.showJSP(request, response, "/login/ldap-incorrect.jsp");
    * contact the ldap server and attempt to authenticate
    protected boolean ldapAuthenticate(String netid, String password, Context context)
    //--------- START LDAP AUTH SECTION -------------
    if (!password.equals(""))
    String ldap_provider_url = ConfigurationManager.getProperty("ldap.provider_url");
    String ldap_id_field = ConfigurationManager.getProperty("ldap.id_field");
    String ldap_search_context = ConfigurationManager.getProperty("ldap.search_context");
    String ldap_object_context = ConfigurationManager.getProperty("ldap.object_context");
    // Set up environment for creating initial context
    Hashtable env = new Hashtable(11);
    env.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
    env.put(javax.naming.Context.PROVIDER_URL, ldap_provider_url);
    // Authenticate
    env.put(javax.naming.Context.SECURITY_AUTHENTICATION, "simple");
    env.put(javax.naming.Context.SECURITY_PRINCIPAL, ldap_id_field+"="+netid+","+ldap_object_context);
    env.put(javax.naming.Context.SECURITY_CREDENTIALS, password);
    try
    // Create initial context
    DirContext ctx = new InitialDirContext(env);
    String ldap_email_field = ConfigurationManager.getProperty("ldap.email_field");
    String ldap_givenname_field = ConfigurationManager.getProperty("ldap.givenname_field");
    String ldap_surname_field = ConfigurationManager.getProperty("ldap.surname_field");
    String ldap_phone_field = ConfigurationManager.getProperty("ldap.phone_field");
    Attributes matchAttrs = new BasicAttributes(true);
    matchAttrs.put(new BasicAttribute(ldap_id_field, netid));
    String attlist[] = {ldap_email_field, ldap_givenname_field, ldap_surname_field, ldap_phone_field};
    // look up attributes
    try
    NamingEnumeration answer = ctx.search(ldap_search_context, matchAttrs, attlist);
    while(answer.hasMore()) {
    SearchResult sr = (SearchResult)answer.next();
    Attributes atts = sr.getAttributes();
    Attribute att;
    if (attlist[0]!=null)
         att = atts.get(attlist[0]);
         if (att != null) ldapEmail = (String)att.get();
    if (attlist[1]!=null)
              att = atts.get(attlist[1]);
              if (att != null) ldapGivenName = (String)att.get();
    if (attlist[2]!=null)
                   att = atts.get(attlist[2]);
                   if (att != null) ldapSurname = (String)att.get();
    if (attlist[3]!=null)
                   att = atts.get(attlist[3]);
                   if (att != null) ldapPhone = (String)att.get();
    catch (NamingException e)
    // if the lookup fails go ahead and create a new record for them because the authentication
    // succeeded
    log.warn(LogManager.getHeader(context,
    "ldap_attribute_lookup", "type=failed_search "+e));
    return true;
    // Close the context when we're done
    ctx.close();
    catch (NamingException e)
    log.warn(LogManager.getHeader(context,
    "ldap_authentication", "type=failed_auth "+e));
    return false;
    else
    return false;
    //--------- END LDAP AUTH SECTION -------------
    return true;
    -- Script --
    Thanks.

    Originally Posted by peterkuo
    Use the Rights role | Modify Trustees; select your tree root. You'll see
    [Public] listed as one of the trustees. Click on the Assigned Rights link,
    and use the Add Property button to add what you need. Make sure you flag
    the assignment Inherit.
    Peter
    eDirectory Rules!
    DreamLAN Network Consulting Ltd. - Leading Authority on eDirectory and LDAP technologies
    Hi, Peter:
    Yeah. I have found the place to set it. But it doesn't work.
    I don't know how to paste screenshot here, so copy only texts from iManager, with format somewhat incorrect:
    Object name: Security
    Trustee name: [Public]
    Property Name Assigned Rights Inherit
    Group Membership Read (only have this ticked) TRUE
    NDSPKI:Tree CA DN Read (only have this ticked) FALSE
    Actually, the rights are "Supervisor Compare Read Write Self Dynamic", but I only have "Read" ticked.
    And the second row of "NDSPKI: Tree CA DN" is not added by me. It is the only original entry there.
    But after I add this attribute (and make it inheritable), click "Done" and "Apply" thereafter, the attribute "groupMembership" still can't appear in anonymous binding.
    Anyting I did wrong?
    thank,
    johny

  • Java LDAP Authentification - problem!!!

    I found application in .NET (C#), and it's work perfectly! (http://www.codeproject.com/KB/system/arbauthentication.aspx)
    I want do this logic in my java web application. All users in our domain in first leg must be log-in in web application!
    And it - authetification must be over Active Directory (AD). Help me please.
                Hashtable authEnv = new Hashtable();
                String userName = "";
                String passWord = "";
                InputStreamReader converter = new InputStreamReader(System.in);
                BufferedReader in = new BufferedReader(converter);
                System.out.println("Input your username:");
                userName = in.readLine();
                System.out.println("Input your password:");
                passWord = in.readLine();           
                base = userName + "@" + "xxxyyyzzz.com";
                String ldapURL = "ldap://192.168.0.99:389/";
                authEnv.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
                authEnv.put(Context.PROVIDER_URL, ldapURL);
                authEnv.put(Context.SECURITY_AUTHENTICATION, "simple");
                authEnv.put(Context.SECURITY_PRINCIPAL, base);
                authEnv.put(Context.SECURITY_CREDENTIALS, passWord);
                try {
                    DirContext authContext = new InitialDirContext(authEnv);
                    System.out.println("Authentication Success!");               
                catch (AuthenticationException authEx)
                    System.out.println("Authentication failed!");
                catch (NamingException namEx) {
                    System.out.println("Something went wrong!");
                    namEx.printStackTrace();
                }This code is not working when truely input username & password. Exception!
    javax.naming.AuthenticationException:
    [LDAP: error code 49 - 80090308: LdapErr: DSID-0C090334, comment: AcceptSecurityContext error, data 525, vece]
    And when input truely username, but password is a blank (password="") it's work...     
    Authentication Success!
    may be this is anonymous authentification.

    If you would have searched through the forum you would have discovered that the Active Directory error code 525 means username not found.
    And you may also have discovered that a null password implies an anonymous logon.
    Either the user has mistyped their username, or you have made an incorrect assumption when constructing the userPrincipalName and appending the upn suffix "xxxyyyzzz.com".

  • IView Personalization (Web Dynpro Java) for Anonymous User

    Hello All,
    Is it possible for anonymous user to see iView personalization (Web Dynpro Java) when personalized by an administrator?  What I did was create new role and iView making available to anonymous user.  This work fine meaning I can view iView using URL http://<servername>:<port>/irj/portal/anonymous .  But the personalization I made to iView using administrator mode launching iView in preview mode and then using personalization dialog by choosing Ctrl and secondary mouse button to personalize is not showing.  Iu2019m currently on EP7 SP15 and using iView type Web Dynpro Java for the development component sap.com/tcsecumewdenduser application name LogonHelpApp.  
    Any help is very much appreciated.
    Many Thanks,
    Gary

    Hello Michael,
    Yes, the Web Dynpro  for Java Personalization is working perfect for non-anonymous users.  The issue is when I view same iView using anonymous URL http://<servername>:<port>/irj/portal/anonymous the personalization is not showing just defaults back to the original Web Dynpro Java application settings.  The iView that I created and personalized is the new Logon Help Dynpro Java application (LogonHelpApp).  Is there some permissions that restricts anonymous user to view personalization?
    Koti Reddy Iu2019m using the Web Dynpro for Java Administrator Personalization.  Here is the documentation [http://help.sap.com/saphelp_nw70/helpdata/en/42/ed3ce7f8593eebe10000000a1553f7/frameset.htm |http://help.sap.com/saphelp_nw70/helpdata/en/42/ed3ce7f8593eebe10000000a1553f7/frameset.htm ]
    Thank You for your help,
    Gary

  • Java LDAP

    I am currently planning on working on a small application (to help keep myself current) for my company.
    I was hoping to have an Employee management application which would allow EMployees to go in and edit thier details/book holiday and the such.
    But what I wanted was for there to be LDAP authentication to it, rather than creating the users on a seperate database somewhere.
    And was wondering a few things
    a] Does java come with a library that allows my to conenct to an LDAP server and talkt o it
    b] Does LDAP give back information like "this person is an employee" or "this person is a company director" (or user/admin type thing)
    For the LDAP libraries if the do exist but arent bundled into the main java framework, I am looking for one that isnt too hard to use, as I'm doing this outside of work and my personnal time is very precious to me.

    My standard approach is very similar to what malcolmmc describes. First I create an InitialDirContext which tells me if the username and password is good (it throws an exception if it isn't). Then I tend to use one of the search methods in the InitialDirContext to look up individual entries and get attributes from it.
    For your requirements you need to find something about the user which you can check to differentiate their type. It may be an attribute, or a group they are in. It will be of great benefit to look through your directory with an LDAP browser.
    //Create an environment
    Properties props = new Properties();
    props.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
    props.put(Context.SECURITY_AUTHENTICATION, "simple");
    props.put(Context.PROVIDER_URL, "ldap://anycorp.co.uk:389/");     //Port 389 is standard for LDAP
    props.put(Context.SECURITY_PRINCIPAL, "myDomain\\username");
    props.put(Context.SECURITY_CREDENTIALS, "password");
    //Create a directory context, this will throw an exception if
    //the logon is not valid
    InitialDirContext ctx = new InitialDirContext(props);Notes:
    1. For your provider URL you should be able to use just your company DNS suffix. Your company DNS should route your request to a directory server.
    2. You may also want to look into using a higher security level than "simple", which is a clear text password. Googling should give some answers.
    3. Your SECURITY_PRINCIPLE may vary depending on what type of directory server you have. MS Active Directory usually uses a email type format, Novell uses the format I give in my example. If you code on a Windows XP workstation, click Ctrl-Alt-Delete and have a look at what it says you are logged in as.

  • Java, ldap and german "umlauts"

    Hi everybody,
    Our developers ran in some problems with german characters "��"etc. They are using Java SDK 4.1 for LDAP for retrieving, creating and updating entries. If names have umlauts like in "J�RG" they are not presented right. Both systems have solaris 8 (engl) and they are using UTF-8 in the java application. As i know the server stores the values also in UTF-8, so why is the presentation wrong? Any idea?
    Many thanks
    Kai
    PS: A perl script has no problems with umlauts.

    I know there are various versions of ldapsearch which have differing qualifiers. The one that comes with SUN ONE or iPlanet has the qualifier of -e which means that it will print out german characters. We had this trouble with spanish characters.
    However other versions of ldapsearch do not have this qualifier and hence any such data comes out as binary.
    If your java application uses ldapsearch it must have a qualifier like this. Perhaps the java application can call the ldapsearch function provided by SUN ONE.
    John reddington

  • Java, LDAP, DSML

    Hi!
    I need to write a software that will execute different LDAP requests
    and handle responses. The main idea is that the requests must be
    configured by the user and for different LDAP (eDirectory, OpenLDAP).
    The question is how can I implement such requests configuration and how
    to handle them later.
    I'v read about LDIF and DSML. There are LDIFReader and DSMLReader in
    Novell JLDAP, which allows to convert DSML and LDIF files to
    LDAPMessages. LDIF and DSML files attributes contains real values, but I
    need user to fill them in the runtime.
    So I need template for DSML or LDIF. Is there something like that?
    I can leave values in the DSML empty and fill them in LDAPMessage, but
    I think its not good idea.
    dima376
    dima376's Profile: http://forums.novell.com/member.php?userid=70903
    View this thread: http://forums.novell.com/showthread.php?t=392744

    Hard to say form your description.
    But you could write a Java program to do LDAP requests and responses,
    almost, regardless of the target LDAP provider.
    I say almost, because issuing a partition create against OpenLdap would
    not work.
    But certainly, reads, adds, modifies and deletes should work well.
    Thanks
    -jim
    On 11/16/2009 1:36 PM, dima376 wrote:
    >
    > Hi!
    >
    > I need to write a software that will execute different LDAP requests
    > and handle responses. The main idea is that the requests must be
    > configured by the user and for different LDAP (eDirectory, OpenLDAP).
    >
    > The question is how can I implement such requests configuration and how
    > to handle them later.
    >
    > I'v read about LDIF and DSML. There are LDIFReader and DSMLReader in
    > Novell JLDAP, which allows to convert DSML and LDIF files to
    > LDAPMessages. LDIF and DSML files attributes contains real values, but I
    > need user to fill them in the runtime.
    >
    > So I need template for DSML or LDIF. Is there something like that?
    >
    > I can leave values in the DSML empty and fill them in LDAPMessage, but
    > I think its not good idea.
    >
    >

  • Java LDAP Tag Query Issue

    I am using the ldap tag library to view users and output info. There are specific attributes I want to pull back that it wont. The attributes are passwordretrycount pwdaccountlockedtime pwdfailuretime.
    <!-- LDAP Call -->
    <ldap:property name="url" value="<%= \"ldap://\" + request.getParameter(\"ldapserver\") %>"/>
    <ldap:property name="dn" value="<%= binddn %>"/>
    <ldap:property name="password" value="<%= bindpw %>"/>
    <ldap:connect>
    <ldap:query id="var" basedn="o=tlhc" filter="<%= cn %>">
    <table border="0" cellpadding="1" cellspacing="0">
    <tr><td valign="top"><b>Last Name:</b> </td><td valign="top"><ldap:getAttribute name="sn"/></td></tr>
    <tr><td valign="top"><b>First Name:</b> </td><td valign="top"><ldap:getAttribute name="givenname"/>
    </td></tr>
    <tr><td valign="top">Middle Name: </td><td valign="top"><ldap:getAttribute name="tlhcmiddlename"/><
    /td></tr>
    <tr><td valign="top">UserID: </td><td valign="top"><ldap:getAttribute name="uid"/></td></tr>
    <tr><td valign="top">GUID: </td><td valign="top"><ldap:getAttribute name="tlhcguid"/></td></tr>
    <tr><td valign="top">Employee Number: </td><td valign="top"><ldap:getAttribute name="employeeNumber
    "/></td></tr>
    <tr><td valign="top">Title: </td><td valign="top"><ldap:getAttribute name="title"/></td></tr>
    <tr><td valign="top">Email: </td><td valign="top"><ldap:getAttribute name="mail"/></td></tr>
    <tr><td valign="top">Password Retry Count: </td><td valign="top"><ldap:getAttribute name="passwordr
    etrycount"/></td></tr>
    <tr><td valign="top">Password Failure Time: </td><td valign="top"><ldap:getAttribute name="pwdfailu
    retime" delimiter="<br>"/><br><br></td></tr>
    </table>
    </ldap:query>
    </ldap:connect>

    Is this the easyldap tag library?
    i think it is the implementation of ldap operations in the tag library that causes it.
    I m lookin for a tag library for the same use too.

  • Java LDAP client

    Hi to all:
    Somebody knows if exists any classes, package or api that works as ldap client?
    Best regards,
    Fabio.

    You asked this somewhere else. Please do not cross-post.

  • Anonymous Functions (Lambda expressions) in Java?

    Hello,
    I need to know if there are anonymous functions in Java. I am writing a platform independent shell, and I would like to use anonymous functions to make the shell better.
    Does Java support anonymous functions or is it unsupported?
    Thanks.

    functions without a name? no
    functions belong to classes, and every class method has a name.
    you want to use lisp.
    %

  • LDAP Programming using Java

    Hi,
    How do I do validation of userid's using LDAP, using a java class. Please help me out in this...........
    Krsna

    hi,
    http://docs.sun.com/source/816-6402-10/writing.htm
    http://today.java.net/pub/a/today/2006/04/18/ldaptemplate-java-ldap-made-simple.html

  • How to print an Doc file(MS Word File)on a printer in JAVA

    Hi.I am Prakash.
    Folowing is the code that i have used to print an doc file on a printer. Problem is that , when i run this code it will provide me an printout of a doc file.,but not in well formate as the actual formate of the file. If any one tried this before plz help me.Thanks
    import java.lang.reflect.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.Graphics2D;
    import java.io.*;
    import javax.swing.*;
    import javax.print.*;
    import javax.print.attribute.*;
    import javax.print.attribute.standard.*;
    import javax.print.event.*;
    public class BasicPrint {
         JFrame frame;
         JButton btn;
         private boolean PrintJobDone = false;
         protected void MakeGui() {
              frame = new JFrame("PrintService");
              btn = new JButton("Cancel Print Job");
              btn.disable();
              frame.getContentPane().add(btn, BorderLayout.SOUTH);
              frame.pack();
              frame.setVisible(true);
         BasicPrint(String FileToPrint, String pMode) {
              try {
                   MakeGui();
                   File baseDir = new File("d:/doc");
    File outDir = new File(baseDir, FileToPrint);
                   // Open the image file
                   InputStream is = new BufferedInputStream(new FileInputStream(
                             outDir));
                   // Find the default service
                   DocFlavor flavor = DocFlavor.INPUT_STREAM.AUTOSENSE;
                   //DocFlavor flavor = new DocFlavor("application/msword", "java.io.InputStream");
                   //DocFlavor docFlavor = new DocFlavor("application/vnd.ms-word", "java.io.InputStream");
                   if (pMode != null && pMode.equalsIgnoreCase("PS"))
                        flavor = DocFlavor.INPUT_STREAM.POSTSCRIPT;
                   else if (pMode != null && pMode.equalsIgnoreCase("PDF"))
                        flavor = DocFlavor.INPUT_STREAM.PDF;
                   else if (pMode != null && pMode.equalsIgnoreCase("JPG"))
                        flavor = DocFlavor.INPUT_STREAM.JPEG;
                   else if (pMode != null && pMode.equalsIgnoreCase("GIF"))
                        flavor = DocFlavor.INPUT_STREAM.GIF;
                   else if (pMode != null && pMode.equalsIgnoreCase("PNG"))
                        flavor = DocFlavor.INPUT_STREAM.PNG;
                   else if (pMode != null && pMode.equalsIgnoreCase("PCL"))
                        flavor = DocFlavor.INPUT_STREAM.PCL;
                   else if (pMode != null && pMode.equalsIgnoreCase("RAW"))
                        flavor = DocFlavor.INPUT_STREAM.AUTOSENSE;
                   else if (pMode != null && pMode.equalsIgnoreCase("TXT16"))//****                                   *********
                        flavor = DocFlavor.INPUT_STREAM.TEXT_PLAIN_UTF_16;
                        System.out.println("****ACTIVE***");
                   else if (pMode != null && pMode.equalsIgnoreCase("TXTBE"))//****
                        flavor = DocFlavor.INPUT_STREAM.TEXT_PLAIN_UTF_16BE;
                   else if (pMode != null && pMode.equalsIgnoreCase("TXTHOST"))//***
                        flavor = DocFlavor.INPUT_STREAM.TEXT_PLAIN_HOST;
                   else if (pMode != null && pMode.equalsIgnoreCase("TXT8"))
                        flavor = DocFlavor.INPUT_STREAM.TEXT_PLAIN_UTF_8;
                   else if (pMode != null && pMode.equalsIgnoreCase("TXTASCI"))
                        flavor = DocFlavor.INPUT_STREAM.TEXT_PLAIN_US_ASCII;
                   else if(pMode != null && pMode.equalsIgnoreCase("TXTLE"))
                        flavor = DocFlavor.INPUT_STREAM.TEXT_PLAIN_UTF_16LE;                                        //*******
                   else if(pMode != null && pMode.equalsIgnoreCase("SEVICE"))
                        flavor = DocFlavor.SERVICE_FORMATTED.PRINTABLE;
                   String type = flavor.getMediaType();
                   System.out.println("Type ="+ type);
                   //IMPRIMIR prakashCV.doc TXT text/plain; charset="utf-16le"; class="java.io.InputStream"
                   System.err.println("* IMPRIMIR " + FileToPrint + " " + pMode + " "
                             + flavor);
                   PrintService dservice = PrintServiceLookup
                             .lookupDefaultPrintService();
                   PrintService[] services = PrintServiceLookup.lookupPrintServices(
                             flavor, null);
                   if (services == null || services.length < 1)
                        services = PrintServiceLookup.lookupPrintServices(null, null);
                   PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet();
                   aset.add(new Copies(1));
                   aset.add(OrientationRequested.PORTRAIT);
                   // aset.add(MediaTray.MAIN);
                   aset.add(Sides.ONE_SIDED);
                   aset.add(MediaSizeName.ISO_A4);
                   PrintService service = ServiceUI.printDialog(
                             (GraphicsConfiguration) null, 60, 60, services,
                             (PrintService) dservice, (DocFlavor) flavor, aset);
                   if (service != null) {
                        // Create the print job
                        final DocPrintJob job = service.createPrintJob();
                        Doc doc = new SimpleDoc(is, flavor, null);
                        // Monitor print job events; for the implementation of
                        // PrintJobWatcher,
                        PrintJobWatcher pjDone = new PrintJobWatcher(job);
                        if (job instanceof CancelablePrintJob) {
                             btn.addActionListener(new ActionListener() {
                                  public void actionPerformed(ActionEvent evt) {
                                       CancelablePrintJob cancelJob = (CancelablePrintJob) job;
                                       try {
                                            cancelJob.cancel();
                                       } catch (PrintException e) {
                                            // Possible reason is job was already finished
                             btn.enable();
                        try {
                             // Print it
                             job.print(doc, (PrintRequestAttributeSet) aset);
                        } catch (PrintException e) {
                             e.printStackTrace();
                        System.err.println("* Impresion Realizada - Esperando ..");
                        // Wait for the print job to be done
                        pjDone.waitForDone();
                   // It is now safe to close the input stream
                   is.close();
              } catch (IOException e) {
                   e.printStackTrace();
              } catch (Exception e) {
                   e.printStackTrace();
              } finally {
                   try {
                        synchronized (BasicPrint.this) {
                             PrintJobDone = true;
                             BasicPrint.this.notify();
                   } catch (Exception e) {
                        e.printStackTrace();
         public synchronized void waitForDone() {
              try {
                   while (!PrintJobDone) {
                        wait();
              } catch (InterruptedException e) {
                   e.printStackTrace();
         public static void main(String[] args) {
              try {
                   //args[0]="t";
                   //args[1]="rr";
    //               if (args.length < 1) {
    //                    System.err.println("\nSintaxis:\n\n java BasicPrint FileToPrint [pMode]\n");
    //                    System.exit(0);
                   BasicPrint bp = null;
                   //if (args.length < 2){
                        //bp = new BasicPrint(args[0], null);
                   //}else{
                        //bp = new BasicPrint(args[0], args[1]);
                        bp = new BasicPrint("prakashCV.doc","SEVICE");                                                       //****/***
                   bp.waitForDone();
                   System.exit(0);
              } catch (Exception e) {
                   e.printStackTrace();
         class PrintJobWatcher {
              // true iff it is safe to close the print job's input stream
              boolean done = false;
              int lastEvent = 0;
              PrintJobWatcher(DocPrintJob job) {
                   // Add a listener to the print job
                   job.addPrintJobListener(new PrintJobAdapter() {
                        public void printJobRequiresAttention(PrintJobEvent pje) {
                             lastEvent = pje.getPrintEventType();
                             System.err
                                       .println("* La impresora requiere de su Atencion ! * "
                                                 + pje);
                             // allDone();
                        public void printDataTransferCompleted(PrintJobEvent pje) {
                             lastEvent = pje.getPrintEventType();
                             System.err
                                       .println("* Transferencia de datos a la impresora OK. * "
                                                 + pje);
                             // allDone();
                        public void printJobCanceled(PrintJobEvent pje) {
                             lastEvent = pje.getPrintEventType();
                             System.err.println("* Trabajo de impresion CANCELADO ! * "
                                       + pje);
                             allDone();
                        public void printJobCompleted(PrintJobEvent pje) {
                             lastEvent = pje.getPrintEventType();
                             System.err.println("* Impresion completa OK. * " + pje);
                             allDone();
                        public void printJobFailed(PrintJobEvent pje) {
                             lastEvent = pje.getPrintEventType();
                             System.err.println("* ERROR en la Impresion ! * " + pje);
                             // allDone();
                        public void printJobNoMoreEvents(PrintJobEvent pje) {
                             lastEvent = pje.getPrintEventType();
                             System.err
                                       .println("* No mas eventos de impresion * " + pje);
                             allDone();
                        void allDone() {
                             synchronized (PrintJobWatcher.this) {
                                  done = true;
                                  PrintJobWatcher.this.notify();
              /** Description of the Method */
              public synchronized void waitForDone() {
                   try {
                        while (!done) {
                             wait();
                   } catch (InterruptedException e) {
                        e.printStackTrace();
    }

    Hi Maxpkh
    Do you mean attachment? You can't do that with free Adobe Reader you need Acrobat to do this.
    ~Deepak

  • Windows task scheduler to run batch file running a java program

    I have created a batch file that runs my SendEmail program. The batch file is in the same directory as the java program. The only line in the batch file is
    java SendEmail
    This works fine from the command prompt but from the windows task scheduler it fails to function. Any help on how I can overcome this problem will be greatly appreciated.
    THanks

    Looks okay. The classpath is set, too, I guess? Btw, try running javaw instead of java. I may err, but I think it can show a console, so you can watch any error messages.

Maybe you are looking for

  • How do I access my icloud contacts from windows mail?

    My PC is synced with iCloud - my contacts are there, but when I try and send an email from Windows Mail (I have g-mail), I can't access my contacts to retrieve an email address. Can anyone help me with this? Do I have to switch to Outlook?

  • Can't Install Win XP on Neo Platinum

    I just upgraded my NForce2 system to a nForce 3 Neo Platinum with an Athlon 64 3400+. I can not get past the initial text setup with the Windows XP setup disk. 1) If I enable my two SATA drives as a RAID 0 stripe I get errors of the sort "Line xxx of

  • G4 quicksilver dual 1ghz: how many video cards can i install?

    i've kept this great old machine on the shelf, now i've found a use for it!  i've been programming video installations for theatre using isadora (on more modern machines) and would love to utilize my old G4.  currently installed is the stock card wit

  • Unable to add AP Invoice

    Unable to add AP Invoice based on a Purchase order or even directly for one particular item. We get the following error Stock Account is not defined [ AP Invoice Rows- Warehouse Code] Line 2 'Item Code' Message Message 173-77 We are unable to create

  • ISight with Magnets

    My daughter just received an ISight camera which has been backorderd for six weeks - unpacked it - and watched her computer screen go blue. Apparently the camera is shipped with some unmarked magnets (which are only mentioned in the fine print of the