TimesheetJobScheduler Runs Too Early
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 (20)
-
-
reporter Testing a potential fix right now... but you'll need to polish it and finish it off ;)
-
reporter The really easy way is to use
awaitInitialization
or checkisInitialized
: https://bitbucket.org/activeobjects/ao-plugin/src/e2ca10ec33912528e5c281aacfff4094a2d6cd63/activeobjects-core/src/main/java/com/atlassian/activeobjects/external/ActiveObjectsModuleMetaData.java?at=masterHowever that isn't available for you in JIRA < 6.4, so not really a good option.
-
reporter Please don't use a timeout - the instant-on environments may sit idle for days until the tenant/database arrives, so we cannot use magic numbers any more.
Something like this pattern is what we would like to use: https://bitbucket.org/cfuller/atlassian-scheduler-jira-example/src/90a07c5af0fbd6272c034100923a50f892ce7d07/src/main/java/com/atlassian/jira/plugins/example/scheduler/impl/AwesomeLauncher.java?at=master
-
reporter Still testing... will get back to you tomorrow.
-
Ok, thank you for your help!
-
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
? -
The right way is to fork and create pull request, would you mind please doing this?
-
reporter Heh... you caught me being lazy... forked and PR'd: https://bitbucket.org/azhdanov/jiratimesheet/pull-request/1/560-waits-for-pluginenabledevent-and
-
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.
-
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...
-
-
- changed status to resolved
-
reporter Going through the test/release process now.
-
Hi Alexander,
If it's possible, please use version 2.8.2.2 just released with fix for Internet Explorer 9 problems.
Thank you.
-
reporter -
I don't have access, but never mind, my previous comment is just for the case if it's possible, no worries.
-
reporter Ah sorry... just linked the internal issue for the sake of completeness.
2.8.2.2 it is.
-
Great, thanks!
-
- removed version
Removing version: 2.8 (automated comment)
- Log in to comment
Hi Alex,
Do you have anything better in mind than the following?