0

We have set up accounts for users with temporary passwords. The user receives the password through email and then is suppose to be able to log in with it. We have since fixed our previous problem of our passwords not meeting the AD requirements and are using defaults for testing. Here is the error we receive in the console. Please let me know if there is anything else that can be supplied. Thanks:

Console

2014-09-10 13:25:32,685 [ajp-0.0.0.0-8009-4] ERROR com.util.ADUtil - Error building user from attributes
    java.lang.NumberFormatException: For input string: "exampletest"
        at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Integer.parseInt(Integer.java:492)
    at java.lang.Integer.parseInt(Integer.java:527)
    at com.example.publicwebsite.example.account.util.ADUtil.buildAccount(ADUtil.java:742)
    at com.example.publicwebsite.example.account.util.ADUtil.searchForUsers(ADUtil.java:841)
    at com.example.publicwebsite.example.account.util.AccountUtil.searchForUsers(AccountUtil.java:157)
    at org.apache.jsp.public_.example.admin.searchActiveAccountsJson_jsp._jspService(searchActiveAccountsJson_jsp.java:77)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:322)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:249)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:183)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:442)
    at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:95)
    at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
    at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
    at org.jboss.web.tomcat.service.sso.ClusteredSingleSignOn.invoke(ClusteredSingleSignOn.java:692)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:566)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.internalProcess(ActiveRequestResponseCacheValve.java:74)
    at org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(ActiveRequestResponseCacheValve.java:47)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
    at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:437)
    at org.apache.coyote.ajp.AjpProtocol$AjpConnectionHandler.process(AjpProtocol.java:385)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:451)
    at java.lang.Thread.run(Thread.java:745)

Here is a link to our previous question:

How to reset password in AD, getting an LDP OperationNotSupported error

Java

UserCreation

...

ldapContext = new InitialDirContext(ldapEnv);
        Attributes attributes = new BasicAttributes(true);
        Attribute objClasses = new BasicAttribute("objectClass");
        objClasses.add("top");
        objClasses.add("user");
        objClasses.add("person");
        objClasses.add("organizationalPerson");

        Attribute cn = new BasicAttribute("cn", "" + userId);
        Attribute description = new BasicAttribute("description", "user account");
        Attribute distinguishedName = new BasicAttribute("name", "" + userId);
        Attribute firstName = new BasicAttribute("givenName", fName);
        Attribute lastName = new BasicAttribute("sn", lName);
        Attribute mail = new BasicAttribute("mail", email);
        Attribute organization = new BasicAttribute("department", org);
        Attribute phoneNumber = new BasicAttribute("homePhone", pNumber);
        Attribute samAccountName = new BasicAttribute("sAMAccountName", "" + userId);
        Attribute name = new BasicAttribute("distinguishedName", createDN("" + userId,usersOU)); 
        Attribute objectCategory = new BasicAttribute("objectCategory", usersCategoryDN);

        Attribute accountControl = new BasicAttribute("userAccountControl", "512");
        Attribute password = new BasicAttribute("unicodePwd", formatPassword(temporaryPassword));
            logger.info("userscat" + usersCategoryDN);

        attributes.put(objClasses);

        attributes.put(cn);
        attributes.put(description);
        attributes.put(distinguishedName);
        attributes.put(firstName);
        attributes.put(lastName); 
        attributes.put(mail);
        attributes.put(organization);
        attributes.put(phoneNumber);
        attributes.put(samAccountName);
        attributes.put(name);
        attributes.put(objectCategory);
        attributes.put(accountControl);
        attributes.put(password);

        account.setPassword(temporaryPassword);

...

**formatPassword is a function from this article to encode:

http://www.ramblingtech.com/will_not_perform-error-from-ad-on-password-change-using-java/

Community
  • 1
  • 1
PT_C
  • 1,178
  • 5
  • 24
  • 57

1 Answers1

1

I don't know much Java, but the StackTrace seems to say that it can't convert exampletest into a number.

On line 742 of the ADUtil.java-class you call parseInt which has a problem parsing exampletest into an integer. So without the actual code all further investigation is a bit far fetched.

Hope that helps though

heiglandreas
  • 3,803
  • 1
  • 17
  • 23