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

Error if you click to view or merge patient when creating a new patient

    Details

    • Type: Bug
    • Status: Closed
    • Priority: TBD
    • Resolution: Duplicate
    • Affects Version/s: Platform 1.10.0
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Complexity:
      Undetermined

      Description

      When creating a new patient at...
      http://localhost:8080/openmrs/admin/patients/patient.form
      if you click "View Patient Dashboard" you get the error...

      HTTP Status 500 -
      
      type Exception report
      
      message
      
      description The server encountered an internal error () that prevented it from fulfilling this request.
      
      exception
      
      javax.servlet.ServletException: There is no patient with id: '5'
      	org.openmrs.web.controller.patient.PatientDashboardController.renderDashboard(PatientDashboardController.java:66)
      	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	java.lang.reflect.Method.invoke(Method.java:622)
      	org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176)
      	org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:426)
      	org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:414)
      	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.doGet(FrameworkServlet.java:549)
      	javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
      	javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
      	org.openmrs.module.web.filter.ForcePasswordChangeFilter.doFilter(ForcePasswordChangeFilter.java:65)
      	org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:76)
      	org.openmrs.module.web.filter.ModuleFilter.doFilter(ModuleFilter.java:58)
      	org.openmrs.web.filter.OpenmrsFilter.doFilterInternal(OpenmrsFilter.java:111)
      	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
      	org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
      	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
      	org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:109)
      	org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:109)
      	org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:109)
      	org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
      	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
      note The full stack trace of the root cause is available in the Apache Tomcat/7.0.26 logs.
      
      Apache Tomcat/7.0.26
      

      If you click "Merge this patient with another" you get the error...

      HTTP Status 500 -
      
      type Exception report
      
      message
      
      description The server encountered an internal error () that prevented it from fulfilling this request.
      
      exception
      
      java.lang.ClassCastException: org.openmrs.Person cannot be cast to org.openmrs.Patient
      	org.openmrs.api.db.hibernate.HibernatePatientDAO.getPatient(HibernatePatientDAO.java:76)
      	org.openmrs.api.impl.PatientServiceImpl.getPatient(PatientServiceImpl.java:149)
      	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	java.lang.reflect.Method.invoke(Method.java:622)
      	org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
      	org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
      	org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
      	org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
      	org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
      	org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
      	com.sun.proxy.$Proxy1116.getPatient(Unknown Source)
      	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	java.lang.reflect.Method.invoke(Method.java:622)
      	org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
      	org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
      	org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
      	org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
      	org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
      	org.openmrs.aop.LoggingAdvice.invoke(LoggingAdvice.java:122)
      	org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
      	org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:50)
      	org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
      	org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:50)
      	org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
      	org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
      	com.sun.proxy.$Proxy1117.getPatient(Unknown Source)
      	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	java.lang.reflect.Method.invoke(Method.java:622)
      	org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
      	org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
      	org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
      	org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
      	org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
      	org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
      	com.sun.proxy.$Proxy1117.getPatient(Unknown Source)
      	org.openmrs.web.controller.patient.MergePatientsFormController.formBackingObject(MergePatientsFormController.java:148)
      	org.springframework.web.servlet.mvc.AbstractFormController.getErrorsForNewForm(AbstractFormController.java:361)
      	org.springframework.web.servlet.mvc.AbstractFormController.showNewForm(AbstractFormController.java:341)
      	org.springframework.web.servlet.mvc.AbstractFormController.handleRequestInternal(AbstractFormController.java:281)
      	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.doGet(FrameworkServlet.java:549)
      	javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
      	javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
      	org.openmrs.module.web.filter.ForcePasswordChangeFilter.doFilter(ForcePasswordChangeFilter.java:65)
      	org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:76)
      	org.openmrs.module.web.filter.ModuleFilter.doFilter(ModuleFilter.java:58)
      	org.openmrs.web.filter.OpenmrsFilter.doFilterInternal(OpenmrsFilter.java:111)
      	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
      	org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
      	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
      	org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:109)
      	org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:109)
      	org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:109)
      	org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
      	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
      note The full stack trace of the root cause is available in the Apache Tomcat/7.0.26 logs.
      
      Apache Tomcat/7.0.26
      

      Both links should be disabled and/or a pretty error message when the page is loaded.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                arbaughj James Arbaugh [X] (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: