Service exception continues to impede

helpflightInternet και Εφαρμογές Web

10 Νοε 2013 (πριν από 3 χρόνια και 11 μήνες)

279 εμφανίσεις

Added by Laura Kolker, last edited by Laura Kolker on Nov 08, 2011Service exception continues to impedeUserVoice developmentTable of ContentsOverviewStacktraceRelated JIRA issues?ObservationsNext stepsOverviewThe uservoice plugin uses a service to pull data from Uservoice. Sometimes this service is destroyed for somereason: sometimes for reasons I can't identify, but (almost?) always after re-installing the plugin with AMPS:atlas-cli 'pi' command.This makes the process of dev'ing the plugin sometimes very slow (especially when working on theservice) as I'm often having to restart amps jira from scratch.Stacktrace[INFO] [talledLocalContainer] org.springframework.osgi.service.importer.ServiceProxyDestroyedException:[INFO] [talledLocalContainer] at org.springframework.osgi.service.importer.support.internal.aop.ServiceDynamicInterceptor$ServiceLookUpC[INFO] [talledLocalContainer] at org.springframework.osgi.service.importer.support.internal.support.Ret[INFO] [talledLocalContainer] at org.springframework.osgi.service.importer.support.internal.aop.ServiceDynamicInterceptor.lookupService([INFO] [talledLocalContainer] at org.springframework.osgi.service.importer.support.internal.aop.ServiceDynamicInterceptor.getTarget(Serv[INFO] [talledLocalContainer] at org.springframework.osgi.service.importer.support.internal.aop.Service[INFO] [talledLocalContainer] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(R[INFO] [talledLocalContainer] at org.springframework.aop.support.DelegatingIntroductionInterceptor.doPr[INFO] [talledLocalContainer] at org.springframework.aop.support.DelegatingIntroductionInterceptor.invo[INFO] [talledLocalContainer] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(R[INFO] [talledLocalContainer] at org.springframework.osgi.service.util.internal.aop.ServiceTCCLIntercep[INFO] [talledLocalContainer] at org.springframework.osgi.service.util.internal.aop.ServiceTCCLIntercep[INFO] [talledLocalContainer] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(R[INFO] [talledLocalContainer] at org.springframework.osgi.service.importer.support.LocalBundleContextAd[INFO] [talledLocalContainer] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(R[INFO] [talledLocalContainer] at org.springframework.aop.support.DelegatingIntroductionInterceptor.doPrService exception continues to impede UserVoice development ...https://wiki.appfusions.com/display/AF025/2011/11/08/Service...1 of 711/16/11 5:44 PM
Related JIRA issues?WhichJIRAIssueOurshttps://jira.appfusions.com/browse/AF025-70AtlassiansThe closest I've found is this:https://jira.atlassian.com/browse/JRA-16363which isn't exactly the same, but seems pretty similar. However, that one's resolved and hasbeen for some time.[INFO] [talledLocalContainer] at org.springframework.aop.support.DelegatingIntroductionInterceptor.invo[INFO] [talledLocalContainer] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(R[INFO] [talledLocalContainer] at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamic[INFO] [talledLocalContainer] at $Proxy1202.createSettingsForKey(Unknown Source)[INFO] [talledLocalContainer] at com.appfusions.license.support.manager.impl.BaseAppFusionsLicenseManag[INFO] [talledLocalContainer] at com.appfusions.license.support.manager.impl.BaseAppFusionsLicenseManag[INFO] [talledLocalContainer] at com.appfusions.license.support.manager.impl.BaseAppFusionsLicenseManag[INFO] [talledLocalContainer] at com.appfusions.jira.uservoice.service.UserVoiceSyncService.isLicenseIn[INFO] [talledLocalContainer] at com.appfusions.jira.uservoice.service.UserVoiceSyncService.run(UserVoi[INFO] [talledLocalContainer] at com.atlassian.jira.service.JiraServiceContainerImpl.run(JiraServiceCon[INFO] [talledLocalContainer] at com.atlassian.jira.service.ServiceRunner.execute(ServiceRunner.java:[INFO] [talledLocalContainer] at org.quartz.core.JobRunShell.run(JobRunShell.java:195)[INFO] [talledLocalContainer] at com.atlassian.multitenant.quartz.MultiTenantThreadPool$MultiTenantRunn[INFO] [talledLocalContainer] at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.ja[INFO] [talledLocalContainer] 2011-11-08 12:52:27,212 StreamsCompletionService::thread-[atlassian.streams.internal.FeedBuilder] Error fetching feed[INFO] [talledLocalContainer] java.lang.NullPointerException[INFO] [talledLocalContainer] at java.net.URI$Parser.parse(URI.java:3003)[INFO] [talledLocalContainer] at java.net.URI.<init>(URI.java:578)[INFO] [talledLocalContainer] at java.net.URI.create(URI.java:840)[INFO] [talledLocalContainer] at com.atlassian.applinks.core.auth.oauth.ServiceProviderUtil.getServiceP[INFO] [talledLocalContainer] at com.atlassian.applinks.core.auth.oauth.OAuthRequestFactoryImpl.createR[INFO] [talledLocalContainer] at com.atlassian.applinks.core.auth.ApplicationLinkRequestFactoryFactoryImpl$AbsoluteURLRequestFactory.cre[INFO] [talledLocalContainer] at com.atlassian.streams.internal.AppLinksActivityProvider.fetch(AppLinks[INFO] [talledLocalContainer] at com.atlassian.streams.internal.AppLinksActivityProvider.access$[INFO] [talledLocalContainer] at com.atlassian.streams.internal.AppLinksActivityProvider$[INFO] [talledLocalContainer] at com.atlassian.streams.internal.AppLinksActivityProvider$[INFO] [talledLocalContainer] at com.atlassian.streams.internal.FeedBuilder$ToFeedCallable$[INFO] [talledLocalContainer] at com.atlassian.streams.internal.FeedBuilder$ToFeedCallable$[INFO] [talledLocalContainer] at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:[INFO] [talledLocalContainer] at java.util.concurrent.FutureTask.run(FutureTask.java:138[INFO] [talledLocalContainer] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:[INFO] [talledLocalContainer] at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:[INFO] [talledLocalContainer] at java.util.concurrent.FutureTask.run(FutureTask.java:138[INFO] [talledLocalContainer] at com.atlassian.util.concurrent.LimitedExecutor$Runner.run(LimitedExecut[INFO] [talledLocalContainer] at com.atlassian.sal.core.executor.ThreadLocalDelegateRunnable.run(Thread[INFO] [talledLocalContainer] at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecu[INFO] [talledLocalContainer] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.[INFO] [talledLocalContainer] at java.lang.Thread.run(Thread.java:680)Service exception continues to impede UserVoice development ...https://wiki.appfusions.com/display/AF025/2011/11/08/Service...2 of 711/16/11 5:44 PM
ObservationsSeems in the above case at least that the issue is triggered while we're checking the license? I'm guessingits not relevant, but since this is kind of mysterious, does anyone know where the license code is kept so Ican see if there's anything obvious in there to worry about?1.This is definitely occuring with all versions of JIRA 5 we've tested. I don't know if it occurs against JIRA 4.2.Next stepsSee if anyone in AppFusions or Atlassian knows what this is about?11 CommentsNov 08, 2011David SimpsonI'm scratching here, but does this suggest that on redeployment, the old version plugin doesn'tcorrectly destroy itself and the subsequent newly installed plugin cannot initialise itself correctly?Does the service require a (currently missing) destroy method to successfully uninstall itself? –I'm looking at comment #3 here for similarities.Nov 08, 2011Laura KolkerThat's a good idea. It definitely doesn't have an explicit destroy method. TheAbstractService its extending has one, but I don't know what that's doing. I'll tryimplementing it and see if that helps.Nov 08, 2011Laura KolkerOk. I've learned a couple more things:implementing a destroy method appears to have no impact. It doesn't seem to getcalled when the 'pi' command is run. Although it is most definitely called when weshutdown the amps JIRA. Not sure if that's a bad sign or not because the licensingcode is starting to look more problematic:1.Here are repeatable steps to watch this in action:launch atlas-debug,a.set up a tomcat listener in your eclipse andb.set a breakpoint at the beginning of the run() method inUserVoiceSyncService.c.Use pi to reinstall the plugin. d.Wait for the service to get triggerede.You'll find yourself walking through the service (which appear to befunctioning)f.until you request if the license is valid at which pointg.looks like an exception is triggered and the service is destroyedh.2.Service exception continues to impede UserVoice development ...https://wiki.appfusions.com/display/AF025/2011/11/08/Service...3 of 711/16/11 5:44 PM
So I'm not sure if it's the service that's at fault here or the licensing or some combination ofthe two. At first I was figuring that the license call just happened to be in the wrong place atthe wrong time (because the service could get called whenever and maybe interrupted it),but now I'm leaning towards thinking the licensing is (at least part of) the issue becauseit's been the exact same place where the problem happens several times in a rowand1.it looks very much like an exception is triggered from within the license code, but2.I ran a different action after the 'pi' command, but before the service was called thatneeded to check the license as well, and no exception was triggered.3.Nov 08, 2011David SimpsonI've never been exactly convinced about pi, but maybe I've misunderstood quitewhat it does.Somehow, atlas-package ; atlas-install-plugin always feels safer.Nov 08, 2011Laura KolkerJust tried out atlas-package and then atlas-install-plugin to see if that made adifference: Nope. Same problem surfaces.I'm wondering if there's something about the AppFusionsLicenseManagerthat is not sufficiently threadsafe for the service?Anyone know where the code for that object is?Nov 08, 2011Colin GoudieProbably worth just removing the license checks from the service tosee if it works fine then with a pi command. Then at least you knowwhere to lookI've always thought that JIRA services are treated a little differently inOSGi land, in that they aren't really even defined as Plugin modulesare they?Nov 11, 2011Laura KolkerProbably worth just removing the license checks from theservice to see if it works fine then with a pi command. Thenat least you know where to lookService exception continues to impede UserVoice development ...https://wiki.appfusions.com/display/AF025/2011/11/08/Service...4 of 711/16/11 5:44 PM
So, I tried that out. Before I even ran 'pi' I got the secondexception listed above:That being said, the service ran fine afterwards. Then I triedrunning 'pi', and got the original error, but this time it appears tofail out when we ask for the Application Link.[INFO] [talledLocalContainer] 2011-11-11 17:25:Synchorinisation Service running...[INFO] [talledLocalContainer] 2011-11-11 17:26:[atlassian.streams.internal.FeedBuilder] Error fetching feed[INFO] [talledLocalContainer] java.lang.NullPointerException[INFO] [talledLocalContainer] at java.net.URI$Parser.parse(URI.j[INFO] [talledLocalContainer] at java.net.URI.<init>(URI.java:[INFO] [talledLocalContainer] at java.net.URI.create(URI.java:[INFO] [talledLocalContainer] at com.atlassian.applinks.core.aut[INFO] [talledLocalContainer] at com.atlassian.applinks.core.aut[INFO] [talledLocalContainer] at com.atlassian.applinks.core.auth.ApplicationLinkRequestFactoryFa[INFO] [talledLocalContainer] at com.atlassian.streams.internal.[INFO] [talledLocalContainer] at com.atlassian.streams.internal.[INFO] [talledLocalContainer] at com.atlassian.streams.internal.[INFO] [talledLocalContainer] at com.atlassian.streams.internal.[INFO] [talledLocalContainer] at com.atlassian.streams.internal.[INFO] [talledLocalContainer] at com.atlassian.streams.internal.[INFO] [talledLocalContainer] at java.util.concurrent.FutureTask[INFO] [talledLocalContainer] at java.util.concurrent.FutureTask[INFO] [talledLocalContainer] at java.util.concurrent.Executors$[INFO] [talledLocalContainer] at java.util.concurrent.FutureTask[INFO] [talledLocalContainer] at java.util.concurrent.FutureTask[INFO] [talledLocalContainer] at com.atlassian.util.concurrent.L[INFO] [talledLocalContainer] at com.atlassian.sal.core.executor[INFO] [talledLocalContainer] at java.util.concurrent.ThreadPool[INFO] [talledLocalContainer] at java.util.concurrent.ThreadPool[INFO] [talledLocalContainer] at java.lang.Thread.run(Thread.javINFO] [talledLocalContainer] 2011-11-11 17:33:03occured while trying to run service 'UserVoice Service'[INFO] [talledLocalContainer] org.springframework.osgi.service.i[INFO] [talledLocalContainer] at org.springframework.osgi.service.importer.support.internal.aop.S[INFO] [talledLocalContainer] at org.springframework.osgi.servic[INFO] [talledLocalContainer] at org.springframework.osgi.service.importer.support.internal.aop.S[INFO] [talledLocalContainer] at org.springframework.osgi.service.importer.support.internal.aop.S[INFO] [talledLocalContainer] at org.springframework.osgi.servic[INFO] [talledLocalContainer] at org.springframework.aop.framewo[INFO] [talledLocalContainer] at org.springframework.aop.support[INFO] [talledLocalContainer] at org.springframework.aop.support[INFO] [talledLocalContainer] at org.springframework.aop.framewo[INFO] [talledLocalContainer] at org.springframework.osgi.servic[INFO] [talledLocalContainer] at org.springframework.osgi.servic[INFO] [talledLocalContainer] at org.springframework.aop.framewo[INFO] [talledLocalContainer] at org.springframework.osgi.servicService exception continues to impede UserVoice development ...https://wiki.appfusions.com/display/AF025/2011/11/08/Service...5 of 711/16/11 5:44 PM
I've always thought that JIRA services are treated a littledifferently in OSGi land, in that they aren't really evendefined as Plugin modules are they?As I understand it, we just install the class through the adminconsole normally. Although, in the case of this intergration we'reautomatically installing it with the DefaultUserVoiceInitializeclass which (I think) is being loaded as a plugin component. [INFO] [talledLocalContainer] at org.springframework.aop.framewo[INFO] [talledLocalContainer] at org.springframework.aop.support[INFO] [talledLocalContainer] at org.springframework.aop.support[INFO] [talledLocalContainer] at org.springframework.aop.framewo[INFO] [talledLocalContainer] at org.springframework.aop.framewo[INFO] [talledLocalContainer] at $Proxy1199.getPrimaryApplicatio[INFO] [talledLocalContainer] at com.appfusions.jira.uservoice.manager.impl.DefaultUserVoiceAppli[INFO] [talledLocalContainer] at com.appfusions.jira.uservoice.manager.impl.DefaultUserVoiceAppli[INFO] [talledLocalContainer] at com.appfusions.jira.uservoice.manager.impl.DefaultUserVoiceAppli[INFO] [talledLocalContainer] at com.appfusions.jira.uservoice.s[INFO] [talledLocalContainer] at com.atlassian.jira.service.Jira[INFO] [talledLocalContainer] at com.atlassian.jira.service.Serv[INFO] [talledLocalContainer] at org.quartz.core.JobRunShell.run[INFO] [talledLocalContainer] at com.atlassian.multitenant.quart[INFO] [talledLocalContainer] at org.quartz.simpl.SimpleThreadPoNov 09, 2011Patrick LiWhen the plugin fails to "uninstall" itself and you install it again, mostof your plugin's components are not actually "active", which will failwhen you need to use them. I have also seen this in Confluence wheninstall/uninstall the plugin (and the module is not a service).A better test, since you are using JIRA 5, is to install and uninstall theplugin via UPM and see if you get the same issue.Service exception continues to impede UserVoice development ...https://wiki.appfusions.com/display/AF025/2011/11/08/Service...6 of 711/16/11 5:44 PM
Nov 11, 2011Laura KolkerA better test, since you are using JIRA 5, is to install anduninstall the plugin via UPM and see if you get the sameissue.I don't get exactly the same issue, but the service won't run atall when installed via UPM. I've tested this on jira-stage2 andalso on a local jira created with atlas-run-standaloneNov 08, 2011Colin GoudieWhich branch on the AF025 is this on? I was going to checkout the uservoice code for kicks so Icould try see if I can find anything.The licensing is at https://svn.appfusions.com/svn/license/trunkNov 11, 2011Laura Kolkerwas configreboot but I just merged back to trunk today, so you can operate off trunk if youlike.I've currently got the license calls turned off. I'd like to point you to the lines in fisheye, butnone of my commits appear to have been picked up by fisheye since October. :/Anyway, the class is UserVoiceSyncService. Look for comments with the keyword:AF025-70 in the run method.Service exception continues to impede UserVoice development ...https://wiki.appfusions.com/display/AF025/2011/11/08/Service...7 of 711/16/11 5:44 PM