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

Automated Error Report: NumberFormatException on AddPersonController

    XMLWordPrintable

Details

    Description

      I'm not sure how this happened, but the user got an error when trying to create a new Person or a new Patient.

      The simple fix for this ticket should be to catch the error on AddPersonController:151 (in 1.8.x branch) or AddPersonController:153 in trunk and give the user a more helpful error message.

      The more complex fix is to parse the given birthdate correctly with the date format returned by Context.getDateFormat() instead of the hacky substring(6) call a few lines up.

      Version: 1.8.2 Build 21762
      Implementation ID:
      User ID: admin
      Started Modules: serialization.xstream v0.2.5, logic v0.5, reporting v0.6.1, htmlformentry v1.7.3, xforms v4.0.4, reportingcompatibility v1.5.4.1, formentry v4.5.9.2, htmlwidgets v1.5.6.2

      Summary:
      java.lang.NumberFormatException: For input string:

      Description:
      Stack trace:
      java.lang.NumberFormatException.forInputString(Unknown Source)
      java.lang.Integer.parseInt(Unknown Source)
      java.lang.Integer.valueOf(Unknown Source)
      org.openmrs.web.controller.person.AddPersonController.formBackingObject(AddPersonController.java:151)
      org.openmrs.web.controller.person.AddPersonController.formBackingObject(AddPersonController.java:39)
      at [ignored] ...
      javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
      <snip>

      Gliffy Diagrams

        Attachments

          1. Patch1_TRUNK-2751.patch
            1 kB
          2. Patch2_TRUNK-2751.patch
            2 kB
          3. Patch3_TRUNK-2751.patch
            5 kB
          4. Patch4_TRUNK-2751.patch
            16 kB
          5. TRUNK-2751-modified.patch
            5 kB
          6. TRUNK-2751-modified.patch
            5 kB

          Activity

            People

              wyclif Wyclif Luyima
              bwolfe Ben Wolfe
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 2 hours
                  2h