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

Error when adding a patient to a program: java.lang.NumberFormatException

    XMLWordPrintable

    Details

    • Complexity:
      Low

      Description

      When you try to add a patient to a program but don't specify what program to add the patient to, you get the following ugly error message.

      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.

      Hide stack trace
      java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
      java.lang.Integer.parseInt(Integer.java:470)
      java.lang.Integer.valueOf(Integer.java:554)
      org.openmrs.web.controller.program.PatientProgramFormController.enroll(PatientProgramFormController.java:85)
      sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      java.lang.reflect.Method.invoke(Method.java:597)
      org.springframework.web.servlet.mvc.multiaction.MultiActionController.invokeNamedMethod(MultiActionController.java:471)
      org.springframework.web.servlet.mvc.multiaction.MultiActionController.handleRequestInternal(MultiActionController.java:408)
      org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
      org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
      org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:790)
      org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
      org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
      org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:560)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      org.openmrs.module.web.filter.ForcePasswordChangeFilter.doFilter(ForcePasswordChangeFilter.java:65)
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:76)
      org.openmrs.module.xforms.web.XformsFilter.doFilter(XformsFilter.java:60)
      org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:74)
      org.openmrs.module.web.filter.ModuleFilter.doFilter(ModuleFilter.java:58)
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      org.openmrs.web.filter.OpenmrsFilter.doFilterInternal(OpenmrsFilter.java:111)
      org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
      org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:109)
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:109)
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:109)
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
      org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)
      org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
      org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
      org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
      org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
      org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
      org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
      org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
      org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:999)
      org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:565)
      org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:309)
      java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      java.lang.Thread.run(Thread.java:662)

      OpenMRS Version: 1.9.0 Build 27760

      This also happens on OpenMRS 1.8.3. It should have a pretty error message.

        Attachments

        1. openmrs_jsp.patch
          0.6 kB
        2. openmrs 2.patch
          2 kB

          Activity

            People

            Assignee:
            kua Anderson Ku
            Reporter:
            arbaughj James Arbaugh
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 1 hour
                1h
                Remaining:
                Time Spent - 10 minutes Remaining Estimate - 50 minutes
                50m
                Logged:
                Time Spent - 10 minutes Remaining Estimate - 50 minutes
                10m