TimesheetJobScheduler Runs Too Early

Issue #560 resolved
Alex Courtis created an issue

Afternoon Andriy

We're experiencing the following exception during startup in our development on-demand (soon to be production) environment.

It seems that ActiveObjects is being accessed just before the <ao> configuration module has been loaded.

I'll scratch together some ideas for a fix on a branch.

Exception in thread "Timesheet Delayed Subscriptions Initialization" java.lang.IllegalStateException: plugin [{com.fdu.jira.plugin.jira-timesheet-plugin}] invoking ActiveObjects before <ao> configuration module is enabled or plugin is missing an <ao> configuration module. Note that scanning of entities from the ao.model package is no longer supported.
at com.atlassian.activeobjects.osgi.TenantAwareActiveObjects.delegate(TenantAwareActiveObjects.java:175)
at com.atlassian.activeobjects.osgi.TenantAwareActiveObjects.find(TenantAwareActiveObjects.java:323)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
at org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:58)
at org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:62)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.osgi.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceTCCLInterceptor.java:56)
at org.springframework.osgi.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:39)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.osgi.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:59)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at com.sun.proxy.$Proxy4379.find(Unknown Source)
at jira.timesheet.plugin.job.TimesheetJobConfigurationManagerImpl.getAllJobConfigurations(TimesheetJobConfigurationManagerImpl.java:103)
at jira.timesheet.plugin.job.TimesheetJobScheduler.schedule(TimesheetJobScheduler.java:64)
at jira.timesheet.plugin.job.TimesheetJobScheduler.access$000(TimesheetJobScheduler.java:21)
at jira.timesheet.plugin.job.TimesheetJobScheduler$1.run(TimesheetJobScheduler.java:57)
at java.util.TimerThread.mainLoop(Timer.java:555)
at java.util.TimerThread.run(Timer.java:505)

Alex

Comments (19)

  1. Andriy Zhdanov

    Hi Alex,

    Do you have anything better in mind than the following?

    --- a/src/main/java/jira/timesheet/plugin/job/TimesheetJobScheduler.java    Mon Oct 20 17:30:39 2014 +0200
    +++ b/src/main/java/jira/timesheet/plugin/job/TimesheetJobScheduler.java    Wed Oct 22 09:11:53 2014 +0200
    @@ -57,7 +57,7 @@
                     schedule();
                 }
    
    -        }, 15 * 1000); // in 15 seconds
    +        }, 60 * 1000); // in a minute
         }
    
         private void schedule() {
    
  2. Alex Courtis reporter

    Testing a potential fix right now... but you'll need to polish it and finish it off ;)

  3. Alex Courtis reporter

    It's working with a new lifecycle... couldn't push the branch...

    Can you please allow me access to push to a branch #560-ideas ?

  4. Andriy Zhdanov

    You don't look lazy ;) thank you a lot for the patch! Looks great! I will try it on JIRA 5.0.5 at least for safety. Regarding release, I don't plan one earlier than by the end of next month, so if needed earlier please let me know, I can do it any time.

  5. Alex Courtis reporter

    This should work against your oldest JIRA version - no newer API is used.

    We do need this... kind of soon... looking at going live in 2 weeks...

  6. Andriy Zhdanov

    Hi Alexander,

    Version 2.8.2.1 with your patch is released.

    Sorry it took me longer, I was trying to get IE9 problems fixed. Just in case you may look at it too, please see JRA-40647.

    Thank you once again for the improvement!

  7. Andriy Zhdanov

    I don't have access, but never mind, my previous comment is just for the case if it's possible, no worries.

  8. Alex Courtis reporter

    Ah sorry... just linked the internal issue for the sake of completeness.

    2.8.2.2 it is.

  9. Log in to comment