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

Error when creating Patient Identifier with duplicate value

    XMLWordPrintable

    Details

    • Complexity:
      Medium

      Description

      To reproduce:

      1) Go to Admin->Manage Patients, then find an arbitrary patient

      2) Add a new identifier. For the identifier, pick a number that is already in use.

      3) Upon submit, you'll get, correctly, the error message "Patient identifier is already in use by another patient"

      4) Now go back and change the identifier to something that is unique and resubmit.

      You'll get the error listed below. It looks like on this second submit, it's trying to perform an update on the identifier, when it still needs to be created, and therefore is getting an array out-of-bounds exception?

      An Internal Error has Occurred
      org.springframework.beans.InvalidPropertyException

      Invalid property 'identifiersrev:1' of bean class [org.openmrs.Patient]: Cannot get element with index 1 from Set of size 1, accessed using property path 'identifiersrev:1'

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

      Hide stack trace
      org.springframework.beans.BeanWrapperImpl.getPropertyValue(BeanWrapperImpl.java:569)
      org.springframework.beans.BeanWrapperImpl.getNestedBeanWrapper(BeanWrapperImpl.java:447)
      org.springframework.beans.BeanWrapperImpl.getBeanWrapperForPropertyPath(BeanWrapperImpl.java:424)
      org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:641)
      org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:78)
      org.springframework.validation.DataBinder.applyPropertyValues(DataBinder.java:587)
      org.springframework.validation.DataBinder.doBind(DataBinder.java:489)
      org.springframework.web.bind.WebDataBinder.doBind(WebDataBinder.java:149)
      org.springframework.web.bind.ServletRequestDataBinder.bind(ServletRequestDataBinder.java:110)
      org.springframework.web.servlet.mvc.BaseCommandController.bindAndValidate(BaseCommandController.java:391)
      org.springframework.web.servlet.mvc.AbstractFormController.handleRequestInternal(AbstractFormController.java:263)
      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:875)
      org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:807)
      org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
      org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:511)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:76)
      org.openmrs.module.web.filter.ModuleFilter.doFilter(ModuleFilter.java:58)
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      org.openmrs.web.filter.OpenmrsFilter.doFilterInternal(OpenmrsFilter.java:112)
      org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      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:235)
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:82)
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:82)
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:82)
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)
      org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
      org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
      org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
      org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
      org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
      org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
      org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
      java.lang.Thread.run(Unknown Source)

      OpenMRS Version: 1.6.2 dev Build 13082

        Attachments

          Activity

            People

            Assignee:
            suho Sriskandarajah Suhothayan
            Reporter:
            mogoodrich Mark Goodrich [X] (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: