Uploaded image for project: 'OpenMRS Core'
  1. OpenMRS Core
  2. TRUNK-3236

Unlocking account: number format exception when LockoutTimestamp set to blank

    Details

    • Complexity:
      Low

      Description

      To reproduce:
      1) Log in (NOT as admin!) with a bad password until the account locks up.
      2) Log in as admin. Go to Administration > Manage Users; type in the locked username, and click to view it. Click "show advanced options". Notice the lockout time and number of login attempts are set.
      3) Erase the value in lockout timestamp and save the user.
      4) Log in as the unlocked user.

      Error on screen:

      An Internal Error has Occurred
      java.lang.NumberFormatException

      For input string: ""

      Consult the help document.
      Contact your friendly neighborhood administrator if it cannot be resolved.

      Show stack trace

      The following data will be submitted with the report to enable the team to resolve the problem.

      The error message and stack trace
      OpenMRS version
      Application server name and version
      Username of the user currently logged in
      The implementation id of this installation (if defined)
      Names and versions of all installed modules

      catalina.out says:

      ERROR - AbstractReportsTask.run(38) |2012-03-30 16:09:20,207| An error occurred while running scheduled reporting task
      java.lang.NumberFormatException: For input string: ""
      at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
      at java.lang.Long.parseLong(Long.java:431)
      at java.lang.Long.valueOf(Long.java:525)
      at org.openmrs.api.db.hibernate.HibernateContextDAO.authenticate(HibernateContextDAO.java:110)
      at sun.reflect.GeneratedMethodAccessor6122.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
      at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
      at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
      at $Proxy4492.authenticate(Unknown Source)
      at org.openmrs.api.context.UserContext.authenticate(UserContext.java:100)
      at org.openmrs.api.context.Context.authenticate(Context.java:296)
      at org.openmrs.module.reporting.report.task.AbstractReportsTask.authenticate(AbstractReportsTask.java:55)
      at org.openmrs.module.reporting.report.task.AbstractReportsTask.run(AbstractReportsTask.java:33)
      at java.util.TimerThread.mainLoop(Timer.java:512)
      at java.util.TimerThread.run(Timer.java:462)

      The workaround is to enter 0 in the timestamp.

        Attachments

          Activity

            People

            • Assignee:
              bwolfe Ben Wolfe
              Reporter:
              jriley Janet Riley
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: