I have developed a JIRA plugin using the hellish punishment of the Atlassian Spring Scanner. Althogh I have not found anything but awful difficulties, finally I could barely grasp how to use JIRA components such as CustomFieldManager, UserManager, IssueManager... etc by using the annotations Named on the class, Inject on the constructor and ComponentImport on components provided by JIRA. Even I cared of adding JIRA components packages to a <Package-Import> structure in the pom.xml.
Everything fine so far, but now the plugin has "misteriously" stopped working. There are several locations on its code where I call methods of JIRA's component classes, for example UserManager.getUserByName("...") and these methods throwing ServiceProxyDestroyedException. What the hell is this? So, I take the effort of developing the plugin, test it over and over and over again and it always works fine and then, without any reason, it starts to throw senseless exceptions every time I call a method on a JIRA component? Seriously, I think JIRA is teasing me or something like that. The other option could be that my computer is haunted.
What do you think about it?
Well I missed something, the humongously nasty exception stack trace...
java.lang.RuntimeException: service proxy has been destroyed at com.atlassian.event.internal.SingleParameterMethodListenerInvoker.invoke(SingleParameterMethodListenerInvoker.java:54) at com.atlassian.event.internal.AsynchronousAbleEventDispatcher$1$1.run(AsynchronousAbleEventDispatcher.java:48) at com.google.common.util.concurrent.MoreExecutors$DirectExecutorService.execute(MoreExecutors.java:299) at com.atlassian.event.internal.AsynchronousAbleEventDispatcher.dispatch(AsynchronousAbleEventDispatcher.java:107) at com.atlassian.event.internal.EventPublisherImpl.invokeListeners(EventPublisherImpl.java:160) at com.atlassian.event.internal.EventPublisherImpl.publish(EventPublisherImpl.java:79) at com.atlassian.jira.event.issue.DefaultIssueEventManager.publishEvent(DefaultIssueEventManager.java:120) at com.atlassian.jira.event.issue.DefaultIssueEventManager.publishAsRedundant(DefaultIssueEventManager.java:132) at com.atlassian.jira.event.issue.DefaultIssueEventManager.dispatchRedundantEvent(DefaultIssueEventManager.java:83) at com.atlassian.jira.workflow.function.event.FireIssueEventFunction.execute(FireIssueEventFunction.java:53) at com.opensymphony.workflow.AbstractWorkflow.executeFunction(AbstractWorkflow.java:1050) at com.opensymphony.workflow.AbstractWorkflow.transitionWorkflow(AbstractWorkflow.java:1446) at com.opensymphony.workflow.AbstractWorkflow.initialize(AbstractWorkflow.java:615) at com.atlassian.jira.workflow.OSWorkflowManager.createIssue(OSWorkflowManager.java:741) at com.atlassian.jira.issue.managers.DefaultIssueManager.createIssue(DefaultIssueManager.java:580) at com.atlassian.jira.issue.managers.DefaultIssueManager.createIssue(DefaultIssueManager.java:494) at com.atlassian.jira.bc.issue.DefaultIssueService.create(DefaultIssueService.java:230) at com.atlassian.jira.bc.issue.DefaultIssueService.create(DefaultIssueService.java:199) ... 3 filtered at java.lang.reflect.Method.invoke(Method.java:497) at com.atlassian.plugin.util.ContextClassLoaderSettingInvocationHandler.invoke(ContextClassLoaderSettingInvocationHandler.java:26) at com.sun.proxy.$Proxy33.create(Unknown Source) ... 3 filtered at java.lang.reflect.Method.invoke(Method.java:497) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317) at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:56) at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:60) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:133) at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:121) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceTCCLInterceptor.java:70) at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:53) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.eclipse.gemini.blueprint.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:57) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:133) at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:121) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207) at com.sun.proxy.$Proxy2530.create(Unknown Source) at com.atlassian.servicedesk.internal.feature.customer.request.CustomerRequestManager.com$atlassian$servicedesk$internal$feature$customer$request$CustomerRequestManager$$createCustomerRequest(CustomerRequestManager.scala:107) at com.atlassian.servicedesk.internal.feature.customer.request.CustomerRequestManager$$anonfun$createRequest$2$$anonfun$apply$1$$anonfun$apply$3$$anonfun$apply$4.apply(CustomerRequestManager.scala:86) at com.atlassian.servicedesk.internal.feature.customer.request.CustomerRequestManager$$anonfun$createRequest$2$$anonfun$apply$1$$anonfun$apply$3$$anonfun$apply$4.apply(CustomerRequestManager.scala:85) at scalaz.$bslash$div.flatMap(Either.scala:134) at com.atlassian.servicedesk.internal.feature.customer.request.CustomerRequestManager$$anonfun$createRequest$2$$anonfun$apply$1$$anonfun$apply$3.apply(CustomerRequestManager.scala:85) at com.atlassian.servicedesk.internal.feature.customer.request.CustomerRequestManager$$anonfun$createRequest$2$$anonfun$apply$1$$anonfun$apply$3.apply(CustomerRequestManager.scala:78) at scalaz.$bslash$div.flatMap(Either.scala:134) at com.atlassian.servicedesk.internal.feature.customer.request.CustomerRequestManager$$anonfun$createRequest$2$$anonfun$apply$1.apply(CustomerRequestManager.scala:78) at com.atlassian.servicedesk.internal.feature.customer.request.CustomerRequestManager$$anonfun$createRequest$2$$anonfun$apply$1.apply(CustomerRequestManager.scala:77) at scalaz.$bslash$div.flatMap(Either.scala:134) at com.atlassian.servicedesk.internal.feature.customer.request.CustomerRequestManager$$anonfun$createRequest$2.apply(CustomerRequestManager.scala:77) at com.atlassian.servicedesk.internal.feature.customer.request.CustomerRequestManager$$anonfun$createRequest$2.apply(CustomerRequestManager.scala:75) at scalaz.$bslash$div.flatMap(Either.scala:134) at com.atlassian.servicedesk.internal.feature.customer.request.CustomerRequestManager.createRequest(CustomerRequestManager.scala:75) at com.atlassian.servicedesk.internal.feature.customer.request.InternalCustomerRequestServiceScala$$anonfun$createRequest$2$$anonfun$apply$1$$anonfun$apply$2$$anonfun$apply$3.apply(InternalCustomerRequestServiceScala.scala:127) at com.atlassian.servicedesk.internal.feature.customer.request.InternalCustomerRequestServiceScala$$anonfun$createRequest$2$$anonfun$apply$1$$anonfun$apply$2$$anonfun$apply$3.apply(InternalCustomerRequestServiceScala.scala:123) at scalaz.$bslash$div.flatMap(Either.scala:134) at com.atlassian.servicedesk.internal.feature.customer.request.InternalCustomerRequestServiceScala$$anonfun$createRequest$2$$anonfun$apply$1$$anonfun$apply$2.apply(InternalCustomerRequestServiceScala.scala:123) at com.atlassian.servicedesk.internal.feature.customer.request.InternalCustomerRequestServiceScala$$anonfun$createRequest$2$$anonfun$apply$1$$anonfun$apply$2.apply(InternalCustomerRequestServiceScala.scala:122) at scalaz.$bslash$div.flatMap(Either.scala:134) at com.atlassian.servicedesk.internal.feature.customer.request.InternalCustomerRequestServiceScala$$anonfun$createRequest$2$$anonfun$apply$1.apply(InternalCustomerRequestServiceScala.scala:122) at com.atlassian.servicedesk.internal.feature.customer.request.InternalCustomerRequestServiceScala$$anonfun$createRequest$2$$anonfun$apply$1.apply(InternalCustomerRequestServiceScala.scala:121) at scalaz.$bslash$div.flatMap(Either.scala:134) at com.atlassian.servicedesk.internal.feature.customer.request.InternalCustomerRequestServiceScala$$anonfun$createRequest$2.apply(InternalCustomerRequestServiceScala.scala:121) at com.atlassian.servicedesk.internal.feature.customer.request.InternalCustomerRequestServiceScala$$anonfun$createRequest$2.apply(InternalCustomerRequestServiceScala.scala:120) at scalaz.$bslash$div.flatMap(Either.scala:134) at com.atlassian.servicedesk.internal.feature.customer.request.InternalCustomerRequestServiceScala.createRequest(InternalCustomerRequestServiceScala.scala:120) at com.atlassian.servicedesk.internal.rest.CustomerWeb$$anonfun$16$$anonfun$$$$$bcffe462fb1f3a83ef7575c68fe012$$$$nonfun$apply$25$$anonfun$apply$27$$anonfun$apply$28.apply(CustomerWeb.scala:649) at com.atlassian.servicedesk.internal.rest.CustomerWeb$$anonfun$16$$anonfun$$$$$bcffe462fb1f3a83ef7575c68fe012$$$$nonfun$apply$25$$anonfun$apply$27$$anonfun$apply$28.apply(CustomerWeb.scala:647) at scalaz.$bslash$div.flatMap(Either.scala:134) at com.atlassian.servicedesk.internal.rest.CustomerWeb$$anonfun$16$$anonfun$$$$$bcffe462fb1f3a83ef7575c68fe012$$$$nonfun$apply$25$$anonfun$apply$27.apply(CustomerWeb.scala:647) at com.atlassian.servicedesk.internal.rest.CustomerWeb$$anonfun$16$$anonfun$$$$$bcffe462fb1f3a83ef7575c68fe012$$$$nonfun$apply$25$$anonfun$apply$27.apply(CustomerWeb.scala:646) at scalaz.$bslash$div.flatMap(Either.scala:134) at com.atlassian.servicedesk.internal.rest.CustomerWeb$$anonfun$16$$anonfun$apply$20$$anonfun$apply$21$$anonfun$apply$22$$anonfun$apply$23$$anonfun$apply$24$$anonfun$apply$25.apply(CustomerWeb.scala:646) at com.atlassian.servicedesk.internal.rest.CustomerWeb$$anonfun$16$$anonfun$apply$20$$anonfun$apply$21$$anonfun$apply$22$$anonfun$apply$23$$anonfun$apply$24$$anonfun$apply$25.apply(CustomerWeb.scala:645) at scalaz.$bslash$div.flatMap(Either.scala:134) at com.atlassian.servicedesk.internal.rest.CustomerWeb$$anonfun$16$$anonfun$apply$20$$anonfun$apply$21$$anonfun$apply$22$$anonfun$apply$23$$anonfun$apply$24.apply(CustomerWeb.scala:645) at com.atlassian.servicedesk.internal.rest.CustomerWeb$$anonfun$16$$anonfun$apply$20$$anonfun$apply$21$$anonfun$apply$22$$anonfun$apply$23$$anonfun$apply$24.apply(CustomerWeb.scala:644) at scalaz.$bslash$div.flatMap(Either.scala:134) at com.atlassian.servicedesk.internal.rest.CustomerWeb$$anonfun$16$$anonfun$apply$20$$anonfun$apply$21$$anonfun$apply$22$$anonfun$apply$23.apply(CustomerWeb.scala:644) at com.atlassian.servicedesk.internal.rest.CustomerWeb$$anonfun$16$$anonfun$apply$20$$anonfun$apply$21$$anonfun$apply$22$$anonfun$apply$23.apply(CustomerWeb.scala:643) at scalaz.$bslash$div.flatMap(Either.scala:134) at com.atlassian.servicedesk.internal.rest.CustomerWeb$$anonfun$16$$anonfun$apply$20$$anonfun$apply$21$$anonfun$apply$22.apply(CustomerWeb.scala:643) at com.atlassian.servicedesk.internal.rest.CustomerWeb$$anonfun$16$$anonfun$apply$20$$anonfun$apply$21$$anonfun$apply$22.apply(CustomerWeb.scala:642) at scalaz.$bslash$div.flatMap(Either.scala:134) at com.atlassian.servicedesk.internal.rest.CustomerWeb$$anonfun$16$$anonfun$apply$20$$anonfun$apply$21.apply(CustomerWeb.scala:642) at com.atlassian.servicedesk.internal.rest.CustomerWeb$$anonfun$16$$anonfun$apply$20$$anonfun$apply$21.apply(CustomerWeb.scala:641) at scalaz.$bslash$div.flatMap(Either.scala:134) at com.atlassian.servicedesk.internal.rest.CustomerWeb$$anonfun$16$$anonfun$apply$20.apply(CustomerWeb.scala:641) at com.atlassian.servicedesk.internal.rest.CustomerWeb$$anonfun$16$$anonfun$apply$20.apply(CustomerWeb.scala:640) at scalaz.$bslash$div.flatMap(Either.scala:134) at com.atlassian.servicedesk.internal.rest.CustomerWeb$$anonfun$16.apply(CustomerWeb.scala:640) at com.atlassian.servicedesk.internal.rest.CustomerWeb$$anonfun$16.apply(CustomerWeb.scala:639) at scalaz.$bslash$div.flatMap(Either.scala:134) at com.atlassian.servicedesk.internal.rest.CustomerWeb.submitForm(CustomerWeb.scala:639) ... 3 filtered at java.lang.reflect.Method.invoke(Method.java:497) at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60) ... 13 filtered at com.atlassian.plugins.rest.module.RestDelegatingServletFilter$JerseyOsgiServletContainer.doFilter(RestDelegatingServletFilter.java:154) ... 1 filtered at com.atlassian.plugins.rest.module.RestDelegatingServletFilter.doFilter(RestDelegatingServletFilter.java:68) ... 37 filtered at com.atlassian.servicedesk.internal.web.PopulateEyeballForRestFilter.doFilter(PopulateEyeballForRestFilter.java:27) ... 41 filtered at com.atlassian.jira.security.JiraSecurityFilter.doFilter(JiraSecurityFilter.java:70) ... 12 filtered at org.techtime.jira.plugins.easysso.integration.filtering.PrincipalUserComponent.processPrincipalUser(PrincipalUserComponent.java:177) at org.techtime.jira.plugins.easysso.logic.FullyEnabledStrategy.doPrincipalFiltering(FullyEnabledStrategy.java:80) at org.techtime.jira.plugins.easysso.interfaces.JespaPrincipalFilter.doFilter(JespaPrincipalFilter.java:27) ... 12 filtered at com.atlassian.servicedesk.internal.web.CustomerContextSettingFilter.doFilter(CustomerContextSettingFilter.java:107) ... 7 filtered at org.techtime.jira.plugins.easysso.logic.FullyEnabledStrategy.doNTLMFiltering(FullyEnabledStrategy.java:65) at org.techtime.jira.plugins.easysso.interfaces.JespaFilter.doFilter(JespaFilter.java:27) ... 26 filtered at com.atlassian.labs.httpservice.resource.ResourceFilter.doFilter(ResourceFilter.java:59) ... 21 filtered at com.atlassian.servicedesk.project.internal.web.filters.NormaliseUrlFilter.doFilter(NormaliseUrlFilter.java:25) ... 16 filtered at com.atlassian.jira.security.JiraSecurityFilter.doFilter(JiraSecurityFilter.java:70) ... 15 filtered at org.techtime.jira.plugins.easysso.integration.filtering.PrincipalUserComponent.processPrincipalUser(PrincipalUserComponent.java:177) at org.techtime.jira.plugins.easysso.logic.FullyEnabledStrategy.doPrincipalFiltering(FullyEnabledStrategy.java:80) at org.techtime.jira.plugins.easysso.interfaces.JespaPrincipalFilter.doFilter(JespaPrincipalFilter.java:27) ... 18 filtered at com.atlassian.servicedesk.internal.web.CustomerContextSettingFilter.lambda$invokeFilterChain$0(CustomerContextSettingFilter.java:169) at com.atlassian.servicedesk.internal.util.scala.ScalaJavaInterOp$1.apply(ScalaJavaInterOp.java:25) at com.atlassian.servicedesk.internal.utils.context.CustomerContextUtil$.inCustomerContext(CustomerContextUtil.scala:24) at com.atlassian.servicedesk.internal.utils.context.CustomerContextUtil.inCustomerContext(CustomerContextUtil.scala) at com.atlassian.servicedesk.internal.utils.context.CustomerContextServiceImpl.inCustomerContext(CustomerContextServiceImpl.java:19) at com.atlassian.servicedesk.internal.web.CustomerContextSettingFilter.inCustomerContext(CustomerContextSettingFilter.java:160) at com.atlassian.servicedesk.internal.web.CustomerContextSettingFilter.doFilterImpl(CustomerContextSettingFilter.java:118) at com.atlassian.servicedesk.internal.web.CustomerContextSettingFilter.doFilter(CustomerContextSettingFilter.java:112) ... 3 filtered at com.atlassian.fastdev.AutoReloadFilter.doFilter(AutoReloadFilter.java:63) ... 12 filtered at org.techtime.jira.plugins.easysso.integration.filtering.JespaComponent$FilterChainWrapper.doFilter(JespaComponent.java:595) at jespa.http.HttpSecurityService.doFilter(HttpSecurityService.java:1596) ... 2 filtered at java.lang.reflect.Method.invoke(Method.java:497) at org.techtime.jira.plugins.easysso.integration.filtering.JespaComponent.invokeMethod(JespaComponent.java:565) at org.techtime.jira.plugins.easysso.integration.filtering.JespaComponent.doFilter(JespaComponent.java:520) at org.techtime.jira.plugins.easysso.logic.FullyEnabledStrategy.doNTLMFiltering(FullyEnabledStrategy.java:61) at org.techtime.jira.plugins.easysso.interfaces.JespaFilter.doFilter(JespaFilter.java:27) ... 46 filtered at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745) Caused by: org.eclipse.gemini.blueprint.service.importer.ServiceProxyDestroyedException: service proxy has been destroyed at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceDynamicInterceptor$ServiceLookUpCallback.doWithRetry(ServiceDynamicInterceptor.java:101) at org.eclipse.gemini.blueprint.service.importer.support.internal.support.RetryTemplate.execute(RetryTemplate.java:81) at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceDynamicInterceptor.lookupService(ServiceDynamicInterceptor.java:427) at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceDynamicInterceptor.getTarget(ServiceDynamicInterceptor.java:400) at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:60) at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:133) at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:121) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceTCCLInterceptor.java:70) at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:53) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.eclipse.gemini.blueprint.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:57) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:133) at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:121) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207) at com.sun.proxy.$Proxy2138.getUserByName(Unknown Source) at com.xeridia.jira.sigdjira7plugin.commons.components.UserUtilsComponent.getConnectedUsers(UserUtilsComponent.java:109) at com.xeridia.jira.sigdjira7plugin.listeners.components.BalancedAssignmentComponent.assignBalancedWay(BalancedAssignmentComponent.java:106) at com.xeridia.jira.sigdjira7plugin.listeners.GenericEventListener.dispatchEvent(GenericEventListener.java:228) at com.xeridia.jira.sigdjira7plugin.listeners.GenericEventListener.onIssueEvent(GenericEventListener.java:429) ... 3 filtered at java.lang.reflect.Method.invoke(Method.java:497) at com.atlassian.event.internal.SingleParameterMethodListenerInvoker.invoke(SingleParameterMethodListenerInvoker.java:36) ... 422 more
Community moderators have prevented the ability to post new answers.
Hello! Did you find a solution for this? Or at least an idea of what's going on?
Hi @Mikel,
Exception indicating the accessed OSGi service proxy has been destroyed. Usually this exception is thrown when certain operations (normally those that involve accessing the proxy target service ) are called on an OSGi service proxy that has been destroyed.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am calling well-known JIRA components. They are supposed to work. For example if I call UserManager.getUserByName() it MUST give me a JIRA user. Why could these components be destroyed? Even JIRA itself needs those components to work. If they got destroyed continuously, then JIRA would never work at all.
So in a nutshell I have not been able to understand anything from your response. Could you please give me more details? Also note that I understand the Atlassian Spring Scanner at a very high level, so I don't know anything about what a service proxy is, neither about the guts of OSGi neither Spring framework.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.