Error when activating the add-on

Hello everyone,

My name is Carlos, I’m an add-on developer.

Currently, we have several problems, in Jira Server, when disable and enable our add-on and try to access to the database, thought ActiveObject class. Our add-on load successful, however, in the first call to ActiveObject we get the following error:

2020-05-19 19:03:02,931 http-nio-7780-exec-2 ERROR admin 1143x443x1 15nyb1k 0:0:0:0:0:0:0:1 /rest/profields/api/2.0/layouts/default [c.d.j.p.impl.configuration.ConfigurationServiceImpl] service proxy has been destroyed
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.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
	at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:136)
	at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:124)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
	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:185)
	at org.eclipse.gemini.blueprint.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:57)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
	at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:136)
	at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:124)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
	at com.sun.proxy.$Proxy4618.find(Unknown Source)
	at com.deiser.jira.profields.ao.v2.AoBaseManagerImpl.get(AoBaseManagerImpl.java:151)
	at com.deiser.jira.profields.ao.v2.AoBaseManagerImpl.getByFilter(AoBaseManagerImpl.java:202)
	at com.deiser.jira.profields.ao.v2.configuration.ConfigurationMgrImpl.lambda$0(ConfigurationMgrImpl.java:108)
	at com.deiser.jira.profields.ao.v2.configuration.ConfigurationMgrImpl.validateAndGetConfiguration(ConfigurationMgrImpl.java:122)
	at com.deiser.jira.profields.ao.v2.configuration.ConfigurationMgrImpl.getConfiguration(ConfigurationMgrImpl.java:109)
	at com.deiser.jira.profields.configuration.ConfigurationInternalServiceImpl.getConfigurationInStore(ConfigurationInternalServiceImpl.java:318)
	at com.deiser.jira.profields.configuration.ConfigurationInternalServiceImpl.lambda$hasCache$0(ConfigurationInternalServiceImpl.java:203)
	at com.deiser.jira.profields.configuration.CacheConfiguration.getValue(ConfigurationInternalServiceImpl.java:344)
	at com.deiser.jira.profields.configuration.ConfigurationInternalServiceImpl.hasCache(ConfigurationInternalServiceImpl.java:203)
	at com.deiser.jira.profields.impl.configuration.ConfigurationServiceImpl.hasCache(ConfigurationServiceImpl.java:140)
	at com.deiser.jira.profields.cache.CacheDatabaseAspect.hasCacheActive(CacheDatabaseAspect.java:74)
	at com.deiser.jira.profields.cache.CacheDatabaseAspect.getOperationPointCut(CacheDatabaseAspect.java:28)
	at com.deiser.jira.profields.ao.v2.viewitem.ViewItemMgrImpl.getByLayoutWithStream(ViewItemMgrImpl.java)
	at com.deiser.jira.profields.viewitem.ViewItemServiceImpl.getStructureForModel(ViewItemServiceImpl.java:200)
	at com.deiser.jira.profields.viewitem.ViewItemServiceImpl.getStructure(ViewItemServiceImpl.java:81)
	at com.deiser.jira.profields.impl.layout.LayoutServiceImpl.createLayoutWithStructure(LayoutServiceImpl.java:359)
	at com.deiser.jira.profields.impl.layout.LayoutServiceImpl.createLayoutWithStructure(LayoutServiceImpl.java:328)
	at com.deiser.jira.profields.impl.layout.LayoutServiceImpl.get(LayoutServiceImpl.java:161)
	at com.deiser.jira.profields.impl.layout.LayoutServiceImpl.get(LayoutServiceImpl.java:150)
	at com.deiser.jira.profields.impl.layout.LayoutServiceImpl.getDefault(LayoutServiceImpl.java:301)
	at com.deiser.jira.profields.rest.api.v2.layout.LayoutRest.lambda$getDefault$2(LayoutRest.java:389)
	at java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948)
	at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:580)
	at com.deiser.jira.profields.rest.api.v2.layout.LayoutRest.getDefault(LayoutRest.java:387)
	... 3 filtered
	at java.lang.reflect.Method.invoke(Method.java:498)
	... 19 filtered
	at com.atlassian.plugins.rest.module.RestDelegatingServletFilter$JerseyOsgiServletContainer.doFilter(RestDelegatingServletFilter.java:159)
	... 1 filtered
	at com.atlassian.plugins.rest.module.RestDelegatingServletFilter.doFilter(RestDelegatingServletFilter.java:69)
	... 32 filtered
	at com.atlassian.servicedesk.internal.web.ExternalCustomerLockoutFilter.doFilter(ExternalCustomerLockoutFilter.java:55)
	... 8 filtered
	at com.atlassian.jira.plugin.mobile.web.filter.MobileAppRequestFilter.doFilter(MobileAppRequestFilter.java:37)
	... 4 filtered
	at com.atlassian.jira.plugin.mobile.login.MobileLoginSuccessFilter.doFilter(MobileLoginSuccessFilter.java:54)
	... 3 filtered
	at com.atlassian.diagnostics.internal.platform.monitor.http.HttpRequestMonitoringFilter.doFilter(HttpRequestMonitoringFilter.java:55)
	... 8 filtered
	at com.atlassian.web.servlet.plugin.request.RedirectInterceptingFilter.doFilter(RedirectInterceptingFilter.java:21)
	... 57 filtered
	at com.atlassian.jira.security.JiraSecurityFilter.lambda$doFilter$0(JiraSecurityFilter.java:66)
	... 1 filtered
	at com.atlassian.jira.security.JiraSecurityFilter.doFilter(JiraSecurityFilter.java:64)
	... 16 filtered
	at com.atlassian.plugins.rest.module.servlet.RestSeraphFilter.doFilter(RestSeraphFilter.java:37)
	... 19 filtered
	at com.atlassian.jira.servermetrics.CorrelationIdPopulatorFilter.doFilter(CorrelationIdPopulatorFilter.java:30)
	... 5 filtered
	at com.atlassian.servicedesk.internal.web.CustomerContextSettingFilter.lambda$invokeFilterChain$0(CustomerContextSettingFilter.java:213)
	at com.atlassian.servicedesk.internal.api.util.context.ReentrantThreadLocalBasedCodeContext.rteInvoke(ReentrantThreadLocalBasedCodeContext.java:136)
	at com.atlassian.servicedesk.internal.api.util.context.ReentrantThreadLocalBasedCodeContext.runOutOfContext(ReentrantThreadLocalBasedCodeContext.java:89)
	at com.atlassian.servicedesk.internal.utils.context.CustomerContextServiceImpl.runOutOfCustomerContext(CustomerContextServiceImpl.java:47)
	at com.atlassian.servicedesk.internal.web.CustomerContextSettingFilter.outOfCustomerContext(CustomerContextSettingFilter.java:204)
	at com.atlassian.servicedesk.internal.web.CustomerContextSettingFilter.doFilterImpl(CustomerContextSettingFilter.java:135)
	at com.atlassian.servicedesk.internal.web.CustomerContextSettingFilter.doFilter(CustomerContextSettingFilter.java:124)
	... 4 filtered
	at com.atlassian.jwt.internal.servlet.JwtAuthFilter.doFilter(JwtAuthFilter.java:37)
	... 8 filtered
	at com.atlassian.web.servlet.plugin.request.RedirectInterceptingFilter.doFilter(RedirectInterceptingFilter.java:21)
	... 4 filtered
	at com.atlassian.web.servlet.plugin.LocationCleanerFilter.doFilter(LocationCleanerFilter.java:36)
	... 26 filtered
	at com.atlassian.jira.servermetrics.MetricsCollectorFilter.doFilter(MetricsCollectorFilter.java:25)
	... 25 filtered
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Thread.java:748)

We have to uninstall and install again so as to solve the problem.

It seems that the ActiveObject we inject into our service is valid but the connection it makes inside to the database fails.

Our steps to reproduce are the follows:

  1. Install Add-on
  2. Disable Add-on
  3. Enable Add-on again
  4. Go to any page that requires consultation with the DDBB. (Example: Layout page of Profields)
  5. We get the issue with the already mentioned error

For more information, we check in Jira 8.5.1 with UPM 4.0.13

Is there anyone who knows about this problem or has experienced something similar?
Thank you all very much.

Hi @carlos.martin,

the described exception only occurs in my development instances if I do very large changes to an app and while using QuickReload. While I do receive the exception, my app works fine as the exception occurs only during disabling of the app.

In your particular case, it is very hard to tell the error. There are plenty of places where you might have something wrong. Could you tell us more about the the way you inject/load the ActiveObjects class?

Hi @dennis.fischer,
First of all, thank you for your answer.

We have the problem without using QuickReload and it occurs only when enabling or installing without first uninstalling.

We inject the dependence by the constructor. Just like that:

 public FieldMgrImpl(ActiveObjects ao){...}

And this class we have included like a “component” in our “atlassian-plugin.xml” file.

Thanks for everything