My customer is using AD , and I need to authenticate my user in java via LDAP, I wrote this simple code

Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.PROVIDER_URL, "ldap://10.254.***.***);
env.put(Context.SECURITY_AUTHENTICATION, "Simple");
env.put(Context.SECURITY_PRINCIPAL, "cn=s***.u***,ou=All Users,dc=p***,dc=net,dc=**");
env.put(Context.SECURITY_CREDENTIALS, "******");

try {
DirContext ctx = new InitialDirContext(env);
System.out.println("connected");
System.out.println(ctx.getEnvironment());

// do something useful with the context...

ctx.close();

} catch (AuthenticationNotSupportedException ex) {
System.out.println("The authentication is not supported by the server"+ex);
} catch (AuthenticationException ex) {
System.out.println("incorrect password or username"+ex);
} *catch (NamingException ex) {
System.out.println("error when trying to create the context"+ex);
}
}*
This code throw following exception

incorrect password or usernamejavax.naming.AuthenticationException: [LDAP: error code 49 - 80090308: LdapErr: DSID-0C090453, comment: AcceptSecurityContext error r, data 52e, v3839 ]

however I can connect from the same user via Ad Explorer

enter image description here

enter image description here

As i am able to connect with Ad Explorer , Should be able to connect with Java application as well.

What is wrong inside my code , any help