org.springframework.osgi.service.importer.ServiceProxyDestroyedException: service proxy has been destroyed

Atlassian JIRA | Igor Sereda [ALM Works] | 5 years ago
  1. 0

    In our plugin, I have an additional JIRA top navigation bar menu with a dynamically generated section (like in the Issues dropdown), implemented via <simple-link-factory> plugin module. The problem is that if I disable the plugin, and then enable it again, the factory no longer works. The only workaround is to reinstall the plugin or restart JIRA. The important observation is that when the plugin is Enabled and then the drop-down link is clicked, the constructor of StructureBoardLinkFactory (our instance of SimpleLinkFactory) is not getting called -- therefore, the old instance of the module with stale references to all other components is used. (First posted as a question here: https://answers.atlassian.com/questions/26118 - assuming this is really a bug) Having an old instance with bad links leads to the exceptions like this: {code} [WARNING] [talledLocalContainer] SEVERE: Internal server error [WARNING] [talledLocalContainer] org.springframework.osgi.service.importer.ServiceProxyDestroyedException: service proxy has been destroyed [WARNING] [talledLocalContainer] at org.springframework.osgi.service.importer.support.internal.aop.ServiceDynamicInterceptor$ServiceLookUpCallback.doWithRetry(ServiceDynamicInterceptor.java:105) [WARNING] [talledLocalContainer] at org.springframework.osgi.service.importer.support.internal.support.RetryTemplate.execute(RetryTemplate.java:83) [WARNING] [talledLocalContainer] at org.springframework.osgi.service.importer.support.internal.aop.ServiceDynamicInterceptor.lookupService(ServiceDynamicInterceptor.java:430) [WARNING] [talledLocalContainer] at org.springframework.osgi.service.importer.support.internal.aop.ServiceDynamicInterceptor.getTarget(ServiceDynamicInterceptor.java:415) [WARNING] [talledLocalContainer] at org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:62) [WARNING] [talledLocalContainer] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) [WARNING] [talledLocalContainer] at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131) [WARNING] [talledLocalContainer] at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119) [WARNING] [talledLocalContainer] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) [WARNING] [talledLocalContainer] at org.springframework.osgi.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceTCCLInterceptor.java:56) [WARNING] [talledLocalContainer] at org.springframework.osgi.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:39) [WARNING] [talledLocalContainer] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) [WARNING] [talledLocalContainer] at org.springframework.osgi.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:59) [WARNING] [talledLocalContainer] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) [WARNING] [talledLocalContainer] at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131) [WARNING] [talledLocalContainer] at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119) [WARNING] [talledLocalContainer] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) [WARNING] [talledLocalContainer] at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) [WARNING] [talledLocalContainer] at $Proxy1354.hasPermission(Unknown Source) [WARNING] [talledLocalContainer] at com.almworks.jira.structure.services.StructurePluginHelper.isAdmin(StructurePluginHelper.java:259) [WARNING] [talledLocalContainer] at com.almworks.jira.structure.services.BackendBasedStructureManager.getPermission0(BackendBasedStructureManager.java:248) [WARNING] [talledLocalContainer] at com.almworks.jira.structure.services.BackendBasedStructureManager.getStructurePermission(BackendBasedStructureManager.java:232) [WARNING] [talledLocalContainer] at com.almworks.jira.structure.services.BackendBasedStructureManager.isAccessible(BackendBasedStructureManager.java:895) [WARNING] [talledLocalContainer] at com.almworks.jira.structure.services.BackendBasedStructureManager.getStructure(BackendBasedStructureManager.java:161) [WARNING] [talledLocalContainer] at com.almworks.jira.structure.web.StructureBoardOpenParams.toDisplayString(StructureBoardOpenParams.java:70) [WARNING] [talledLocalContainer] at com.almworks.jira.structure.web.StructureBoardLinkFactory.createLink(StructureBoardLinkFactory.java:88) [WARNING] [talledLocalContainer] at com.almworks.jira.structure.web.StructureBoardLinkFactory.addLink(StructureBoardLinkFactory.java:82) [WARNING] [talledLocalContainer] at com.almworks.jira.structure.web.StructureBoardLinkFactory.addFromCookie(StructureBoardLinkFactory.java:74) [WARNING] [talledLocalContainer] at com.almworks.jira.structure.web.StructureBoardLinkFactory.getLinks0(StructureBoardLinkFactory.java:51) [WARNING] [talledLocalContainer] at com.almworks.jira.structure.web.StructureBoardLinkFactory.getLinks(StructureBoardLinkFactory.java:39) [WARNING] [talledLocalContainer] at com.atlassian.jira.plugin.webfragment.DefaultSimpleLinkManager.getLinks(DefaultSimpleLinkManager.java:207) {code}

    Atlassian JIRA | 5 years ago | Igor Sereda
    org.springframework.osgi.service.importer.ServiceProxyDestroyedException: service proxy has been destroyed
  2. 0

    In our plugin, I have an additional JIRA top navigation bar menu with a dynamically generated section (like in the Issues dropdown), implemented via <simple-link-factory> plugin module. The problem is that if I disable the plugin, and then enable it again, the factory no longer works. The only workaround is to reinstall the plugin or restart JIRA. The important observation is that when the plugin is Enabled and then the drop-down link is clicked, the constructor of StructureBoardLinkFactory (our instance of SimpleLinkFactory) is not getting called -- therefore, the old instance of the module with stale references to all other components is used. (First posted as a question here: https://answers.atlassian.com/questions/26118 - assuming this is really a bug) Having an old instance with bad links leads to the exceptions like this: {code} [WARNING] [talledLocalContainer] SEVERE: Internal server error [WARNING] [talledLocalContainer] org.springframework.osgi.service.importer.ServiceProxyDestroyedException: service proxy has been destroyed [WARNING] [talledLocalContainer] at org.springframework.osgi.service.importer.support.internal.aop.ServiceDynamicInterceptor$ServiceLookUpCallback.doWithRetry(ServiceDynamicInterceptor.java:105) [WARNING] [talledLocalContainer] at org.springframework.osgi.service.importer.support.internal.support.RetryTemplate.execute(RetryTemplate.java:83) [WARNING] [talledLocalContainer] at org.springframework.osgi.service.importer.support.internal.aop.ServiceDynamicInterceptor.lookupService(ServiceDynamicInterceptor.java:430) [WARNING] [talledLocalContainer] at org.springframework.osgi.service.importer.support.internal.aop.ServiceDynamicInterceptor.getTarget(ServiceDynamicInterceptor.java:415) [WARNING] [talledLocalContainer] at org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:62) [WARNING] [talledLocalContainer] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) [WARNING] [talledLocalContainer] at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131) [WARNING] [talledLocalContainer] at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119) [WARNING] [talledLocalContainer] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) [WARNING] [talledLocalContainer] at org.springframework.osgi.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceTCCLInterceptor.java:56) [WARNING] [talledLocalContainer] at org.springframework.osgi.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:39) [WARNING] [talledLocalContainer] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) [WARNING] [talledLocalContainer] at org.springframework.osgi.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:59) [WARNING] [talledLocalContainer] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) [WARNING] [talledLocalContainer] at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131) [WARNING] [talledLocalContainer] at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119) [WARNING] [talledLocalContainer] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) [WARNING] [talledLocalContainer] at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) [WARNING] [talledLocalContainer] at $Proxy1354.hasPermission(Unknown Source) [WARNING] [talledLocalContainer] at com.almworks.jira.structure.services.StructurePluginHelper.isAdmin(StructurePluginHelper.java:259) [WARNING] [talledLocalContainer] at com.almworks.jira.structure.services.BackendBasedStructureManager.getPermission0(BackendBasedStructureManager.java:248) [WARNING] [talledLocalContainer] at com.almworks.jira.structure.services.BackendBasedStructureManager.getStructurePermission(BackendBasedStructureManager.java:232) [WARNING] [talledLocalContainer] at com.almworks.jira.structure.services.BackendBasedStructureManager.isAccessible(BackendBasedStructureManager.java:895) [WARNING] [talledLocalContainer] at com.almworks.jira.structure.services.BackendBasedStructureManager.getStructure(BackendBasedStructureManager.java:161) [WARNING] [talledLocalContainer] at com.almworks.jira.structure.web.StructureBoardOpenParams.toDisplayString(StructureBoardOpenParams.java:70) [WARNING] [talledLocalContainer] at com.almworks.jira.structure.web.StructureBoardLinkFactory.createLink(StructureBoardLinkFactory.java:88) [WARNING] [talledLocalContainer] at com.almworks.jira.structure.web.StructureBoardLinkFactory.addLink(StructureBoardLinkFactory.java:82) [WARNING] [talledLocalContainer] at com.almworks.jira.structure.web.StructureBoardLinkFactory.addFromCookie(StructureBoardLinkFactory.java:74) [WARNING] [talledLocalContainer] at com.almworks.jira.structure.web.StructureBoardLinkFactory.getLinks0(StructureBoardLinkFactory.java:51) [WARNING] [talledLocalContainer] at com.almworks.jira.structure.web.StructureBoardLinkFactory.getLinks(StructureBoardLinkFactory.java:39) [WARNING] [talledLocalContainer] at com.atlassian.jira.plugin.webfragment.DefaultSimpleLinkManager.getLinks(DefaultSimpleLinkManager.java:207) {code}

    Atlassian JIRA | 5 years ago | Igor Sereda [ALM Works]
    org.springframework.osgi.service.importer.ServiceProxyDestroyedException: service proxy has been destroyed
  3. 0

    stellaritysoftware / TFS Repository Plugin / issues / #33 - TFS plugin has license problems after UPM upgrading — Bitbucket

    bitbucket.org | 1 year ago
    com.atlassian.upm.license.storage.lib.PluginLicenseStoragePluginUnresolvedException: org.springframework.osgi.service.importer.ServiceProxyDestroyedException: service proxy has been destroyed
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

    1 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. org.springframework.osgi.service.importer.ServiceProxyDestroyedException

      service proxy has been destroyed

      at org.springframework.osgi.service.importer.support.internal.aop.ServiceDynamicInterceptor$ServiceLookUpCallback.doWithRetry()
    2. Spring OSGi Core
      ServiceInvoker.invoke
      1. org.springframework.osgi.service.importer.support.internal.aop.ServiceDynamicInterceptor$ServiceLookUpCallback.doWithRetry(ServiceDynamicInterceptor.java:105)
      2. org.springframework.osgi.service.importer.support.internal.support.RetryTemplate.execute(RetryTemplate.java:83)
      3. org.springframework.osgi.service.importer.support.internal.aop.ServiceDynamicInterceptor.lookupService(ServiceDynamicInterceptor.java:430)
      4. org.springframework.osgi.service.importer.support.internal.aop.ServiceDynamicInterceptor.getTarget(ServiceDynamicInterceptor.java:415)
      5. org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:62)
      5 frames
    3. Spring AOP
      ReflectiveMethodInvocation.proceed
      1. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      2. org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
      3. org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
      4. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      4 frames
    4. Spring OSGi Core
      ServiceTCCLInterceptor.invoke
      1. org.springframework.osgi.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceTCCLInterceptor.java:56)
      2. org.springframework.osgi.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:39)
      2 frames
    5. Spring AOP
      ReflectiveMethodInvocation.proceed
      1. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      1 frame
    6. Spring OSGi Core
      LocalBundleContextAdvice.invoke
      1. org.springframework.osgi.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:59)
      1 frame
    7. Spring AOP
      JdkDynamicAopProxy.invoke
      1. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      2. org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
      3. org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
      4. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      5. org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
      5 frames
    8. Unknown
      $Proxy1354.hasPermission
      1. $Proxy1354.hasPermission(Unknown Source)
      1 frame
    9. com.almworks.jira
      StructureBoardLinkFactory.getLinks
      1. com.almworks.jira.structure.services.StructurePluginHelper.isAdmin(StructurePluginHelper.java:259)
      2. com.almworks.jira.structure.services.BackendBasedStructureManager.getPermission0(BackendBasedStructureManager.java:248)
      3. com.almworks.jira.structure.services.BackendBasedStructureManager.getStructurePermission(BackendBasedStructureManager.java:232)
      4. com.almworks.jira.structure.services.BackendBasedStructureManager.isAccessible(BackendBasedStructureManager.java:895)
      5. com.almworks.jira.structure.services.BackendBasedStructureManager.getStructure(BackendBasedStructureManager.java:161)
      6. com.almworks.jira.structure.web.StructureBoardOpenParams.toDisplayString(StructureBoardOpenParams.java:70)
      7. com.almworks.jira.structure.web.StructureBoardLinkFactory.createLink(StructureBoardLinkFactory.java:88)
      8. com.almworks.jira.structure.web.StructureBoardLinkFactory.addLink(StructureBoardLinkFactory.java:82)
      9. com.almworks.jira.structure.web.StructureBoardLinkFactory.addFromCookie(StructureBoardLinkFactory.java:74)
      10. com.almworks.jira.structure.web.StructureBoardLinkFactory.getLinks0(StructureBoardLinkFactory.java:51)
      11. com.almworks.jira.structure.web.StructureBoardLinkFactory.getLinks(StructureBoardLinkFactory.java:39)
      11 frames
    10. com.atlassian.jira
      DefaultSimpleLinkManager.getLinks
      1. com.atlassian.jira.plugin.webfragment.DefaultSimpleLinkManager.getLinks(DefaultSimpleLinkManager.java:207)
      1 frame