Uploaded image for project: 'ID Generation'
  1. ID Generation
  2. IDGEN-34

Should not log NPEs while OpenMRS is starting up

    Details

    • Type: Bug
    • Status: Closed
    • Priority: TBD
    • Resolution: Fixed
    • Affects Version/s: 2.7
    • Fix Version/s: 2.8
    • Labels:
      None
    • Complexity:
      Low

      Description

      If OpenMRS startup is slow (e.g. because you're running lots of modules, as in the RefApp and Mirebalais distros) then NPEs like the following will be logged during startup:

      ERROR - AuthenticatedTask.run(57) |2014-01-23 10:34:07,180| An error occurred while running scheduled task
      java.lang.NullPointerException
      	at org.hibernate.cache.impl.bridge.RegionFactoryCacheProviderBridge.nextTimestamp(RegionFactoryCacheProviderBridge.java:93)
      	at org.hibernate.impl.SessionFactoryImpl.openSession(SessionFactoryImpl.java:639)
      	at org.hibernate.impl.SessionFactoryImpl.openSession(SessionFactoryImpl.java:648)
      	at org.springframework.orm.hibernate3.SessionFactoryUtils.doGetSession(SessionFactoryUtils.java:318)
      	at org.springframework.orm.hibernate3.SessionFactoryUtils.getSession(SessionFactoryUtils.java:200)
      	at org.openmrs.api.db.hibernate.HibernateContextDAO.openSession(HibernateContextDAO.java:245)
      	at sun.reflect.GeneratedMethodAccessor171.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      	at java.lang.reflect.Method.invoke(Method.java:597)
      	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
      	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:196)
      	at com.sun.proxy.$Proxy78.openSession(Unknown Source)
      	at org.openmrs.api.context.Context.openSession(Context.java:726)
      	at org.openmrs.module.idgen.task.AuthenticatedTask.run(AuthenticatedTask.java:49)
      	at java.util.TimerThread.mainLoop(Timer.java:512)
      	at java.util.TimerThread.run(Timer.java:462)
      

      We should avoid logging this spurious error message.

        Gliffy Diagrams

          Attachments

            Attachments-Category-Modification

              Activity

                People

                • Assignee:
                  darius Darius Jazayeri
                  Reporter:
                  darius Darius Jazayeri
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Time Tracking

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