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

NPE possible when invalid state conversion triggered

    Details

    • Complexity:
      Low

      Description

      See stack trace below. If invalid state conversion is triggered, then we should probably throw an APIException that describes this problem and catch this to display an appropriate message to the user.

      INFO - LoggingAdvice.invoke(111) |2008-08-25 16:38:35,633| In method PatientService.exitFromCare. Arguments: Patient=PatientTRAC-20882, Date=Mon Aug 25 00:00:00 GMT+02:00 2008, Concept=1744,
      INFO - LoggingAdvice.invoke(111) |2008-08-25 16:38:35,640| In method ObsService.saveObs. Arguments: Obs=null, String=null,
      INFO - LoggingAdvice.invoke(136) |2008-08-25 16:38:35,643| Exiting method saveObs
      INFO - LoggingAdvice.invoke(111) |2008-08-25 16:38:35,645| In method ProgramWorkflowService.triggerStateConversion. Arguments: Patient=PatientTRAC-20882, Concept=1744, Date=Mon Aug 25 00:00:00 GMT+02:00 2008,
      INFO - ProgramWorkflowServiceImpl.triggerStateConversion(451) |2008-08-25 16:38:35,660| State Conversion Triggered: patientProgram=PatientProgram(id=1247, patient=PatientTRAC-20882, program=Program(id=2, concept=1648, workflows=[concept=1568, states=[State UNKNOWN initial=true terminal=false, State CURRENTLY IN TREATMENT initial=true terminal=false, State TREATMENT COMPLETE initial=false terminal=true, State PATIENT DIED initial=false terminal=true, State PATIENT TRANSFERRED OUT initial=false terminal=true, State PATIENT DEFAULTED initial=false terminal=true, State PATIENT CURED initial=false terminal=true, State SYMPTOMATIC BUT NOT IN TREATMENT initial=true terminal=false, State REGIMEN FAILURE initial=false terminal=true|ProgramWorkflow(id=3,])])) transition from State CURRENTLY IN TREATMENT initial=true terminal=false to State PATIENT TRANSFERRED OUT initial=false terminal=true on Mon Aug 25 00:00:00 GMT+02:00 2008
      INFO - ProgramWorkflowServiceImpl.triggerStateConversion(451) |2008-08-25 16:38:35,675| State Conversion Triggered: patientProgram=PatientProgram(id=1451, patient=PatientTRAC-20882, program=Program(id=1, concept=1482, workflows=[concept=1484, states=[State FOLLOWING initial=true terminal=false, State FOLLOWING - TREATMENT NOT NEEDED initial=true terminal=false, State FOLLOWING - WAITING FOR LAB TESTS initial=true terminal=false, State FOLLOWING - NEED EDUCATION AND ACCOMPAGNATEUR initial=true terminal=false, State TREATMENT NEVER STARTED - PATIENT REFUSED initial=true terminal=false, State ON ANTIRETROVIRALS initial=true terminal=false, State TREATMENT STOPPED initial=false terminal=false, State TREATMENT STOPPED - PATIENT REFUSED initial=false terminal=false, State TREATMENT STOPPED - SIDE EFFECTS initial=false terminal=false, State PATIENT DIED initial=false terminal=true, State PATIENT TRANSFERRED OUT initial=false terminal=true, State PATIENT DEFAULTED initial=false terminal=true|ProgramWorkflow(id=1,]), ProgramWorkflow(id=2, concept=1377, states=[GROUP FOLLOWING initial=true terminal=false, State PATIENT TRANSFERRED OUT initial=false terminal=true, State PATIENT DEFAULTED initial=false terminal=false, State PATIENT DIED initial=false terminal=true, State GROUP FOLLOWING NEGATIVE initial=true terminal=false|State])])) transition from State PATIENT DIED initial=false terminal=true to State PATIENT TRANSFERRED OUT initial=false terminal=true on Mon Aug 25 00:00:00 GMT+02:00 2008
      ERROR - LoggingAdvice.invoke(120) |2008-08-25 16:38:35,677| An error occurred while executing this method. Error message: null
      java.lang.NullPointerException
              at org.openmrs.api.impl.ProgramWorkflowServiceImpl.triggerStateConversion(ProgramWorkflowServiceImpl.java:447)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:585)
              at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:301)
              at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
              at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
              at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
              at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
              at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
              at $Proxy71.triggerStateConversion(Unknown Source)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:585)
              at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:301)
              at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
              at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
              at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
              at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
              at org.openmrs.aop.LoggingAdvice.invoke(LoggingAdvice.java:116)
              at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
              at org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:50)
              at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
              at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
              at $Proxy72.triggerStateConversion(Unknown Source)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:585)
              at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:301)
              at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
              at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
              at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
              at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
              at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
              at $Proxy72.triggerStateConversion(Unknown Source)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:585)
              at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:301)
              at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:198)
              at $Proxy115.triggerStateConversion(Unknown Source)
              at org.openmrs.api.impl.PatientServiceImpl.exitFromCare(PatientServiceImpl.java:1116)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:585)
              at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:301)
              at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
              at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
              at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
              at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
              at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
              at $Proxy51.exitFromCare(Unknown Source)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:585)
              at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:301)
              at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
              at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
              at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
              at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
              at org.openmrs.aop.LoggingAdvice.invoke(LoggingAdvice.java:116)
              at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
              at org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:50)
              at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
              at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
              at $Proxy52.exitFromCare(Unknown Source)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:585)
              at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:301)
              at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
              at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
              at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
              at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
              at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
              at $Proxy52.exitFromCare(Unknown Source)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:585)
              at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:301)
              at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:198)
              at $Proxy112.exitFromCare(Unknown Source)
              at org.openmrs.web.dwr.DWRPatientService.exitPatientFromCare(DWRPatientService.java:341)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:585)
              at uk.ltd.getahead.dwr.impl.ExecuteQuery.execute(ExecuteQuery.java:239)
              at uk.ltd.getahead.dwr.impl.DefaultExecProcessor.handle(DefaultExecProcessor.java:48)
              at uk.ltd.getahead.dwr.impl.DefaultProcessor.handle(DefaultProcessor.java:81)
              at uk.ltd.getahead.dwr.AbstractDWRServlet.doPost(AbstractDWRServlet.java:162)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
              at org.openmrs.web.filter.GZIPFilter.doFilterInternal(GZIPFilter.java:57)
              at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
              at org.openmrs.web.OpenmrsFilter.doFilter(OpenmrsFilter.java:122)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
              at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
              at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
              at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
              at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
              at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
              at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
              at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
              at java.lang.Thread.run(Thread.java:595)
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              mseaton Mike Seaton
            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: