component-import injection not working with <merge-check> plugins

XMLWordPrintable

    • Type: Suggestion
    • Resolution: Fixed
    • 4.5.1
    • Component/s: None
    • None

      I've been racking my brain on this issue for several days now.

      When following the Atlassian Developer Tutorial for using merge-check module:
      (Via atlassian-plugin-sdk-6.2.2)

      https://developer.atlassian.com/bitbucket/server/docs/latest/tutorials-and-examples/controlling-when-pull-requests-can-be-merged.html

      I continually receive the following error:

      ( Basically the dynamic component injection is not working the way the tutorial hints it should, which is likely due to an underlying Springboot change? ) Either way, I'm going to donate $75 to the cause of choice for anyone who can point me at a resolution. I've had several other people try it out here, and get the same results - so the code is verbatim what the tutorial states.

      (Oh, i'm using Java8, with atlas-create-bitbucket-plugin rather then: atlas-create-stash-plugin - which is outdated).

      [INFO] [talledLocalContainer] 2016-02-19 15:58:49,501 ERROR [http-nio-7990-exec-7] admin @OJX1QEx958x1031x5 olqddm 10.35.50.12 "GET /rest/ap
      i/latest/projects/PROJECT_1/repos/rep_1/pull-requests/1/merge HTTP/1.1" c.a.p.m.PrefixDelegatingModuleFactory Detected an error instantiatin
      g the module via Spring. This usually means that you haven't created a <component-import> for the interface you're trying to use. https://de
      veloper.atlassian.com/x/TAEr for more details.
      [INFO] [talledLocalContainer] 2016-02-19 15:58:49,577 ERROR [http-nio-7990-exec-7] admin @OJX1QEx958x1031x5 olqddm 10.35.50.12 "GET /rest/ap
      i/latest/projects/PROJECT_1/repos/rep_1/pull-requests/1/merge HTTP/1.1" c.a.s.i.r.e.DefaultUnhandledExceptionMapperHelper Unhandled exceptio
      n while processing REST request: "GET /rest/api/latest/projects/PROJECT_1/repos/rep_1/pull-requests/1/merge HTTP/1.1"
      [INFO] [talledLocalContainer] org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'com.mycompany
      .bitbucket.merge.checks.IsAdminMergeCheck': Unsatisfied dependency expressed through constructor argument with index 0 of type [com.atlassia
      n.bitbucket.permission.PermissionService]: : No qualifying bean of type [com.atlassian.bitbucket.permission.PermissionService] found for dep
      endency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}; nested exception is
      org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.atlassian.bitbucket.permission.PermissionS
      ervice] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}

      [INFO] [talledLocalContainer] at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.jav
      a:749) ~[ConstructorResolver.class:4.2.2.RELEASE]
      [INFO] [talledLocalContainer] at com.atlassian.plugin.module.ClassPrefixModuleFactory.createModule(ClassPrefixModuleFactory.java:39) ~[Cla
      ssPrefixModuleFactory.class:na]
      [INFO] [talledLocalContainer] at com.atlassian.plugin.module.PrefixDelegatingModuleFactory.createModule(PrefixDelegatingModuleFactory.java
      :100) ~[PrefixDelegatingModuleFactory.class:na]
      [INFO] [talledLocalContainer] at com.atlassian.plugin.module.PrefixDelegatingModuleFactory$$FastClassBySpringCGLIB$$e05be356.invoke(<gener
      ated>) ~[ReflectUtils.class:na]
      [INFO] [talledLocalContainer] at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) ~[MethodProxy.class:4.2.2.RELEAS
      E]
      [INFO] [talledLocalContainer] at com.atlassian.stash.internal.plugin.OsgiSafeProxyProvider$1.invoke(OsgiSafeProxyProvider.java:93) ~[OsgiS
      afeProxyProvider$1.class:na]
      [INFO] [talledLocalContainer] at com.atlassian.plugin.module.PrefixDelegatingModuleFactory$$EnhancerBySpringCGLIB$$d419edf4.createModule(<
      generated>) ~[ReflectUtils.class:na]
      [INFO] [talledLocalContainer] at com.atlassian.bitbucket.scm.pull.MergeRequestCheckModuleDescriptor.getModule(MergeRequestCheckModuleDescr
      iptor.java:24) ~[MergeRequestCheckModuleDescriptor.class:na]
      [INFO] [talledLocalContainer] at com.atlassian.stash.internal.pull.DefaultMergeRequestCheckService.doCheck(DefaultMergeRequestCheckService
      .java:70) ~[DefaultMergeRequestCheckService.class:na]
      [INFO] [talledLocalContainer] at com.atlassian.stash.internal.pull.DefaultMergeRequestCheckService.checkMergeability(DefaultMergeRequestCh
      eckService.java:56) ~[DefaultMergeRequestCheckService.class:na]
      [INFO] [talledLocalContainer] at com.atlassian.stash.internal.pull.DefaultPullRequestService.canMerge(DefaultPullRequestService.java:262)
      ~[DefaultPullRequestService.class:na]
      [INFO] [talledLocalContainer] at com.atlassian.plugin.util.ContextClassLoaderSettingInvocationHandler.invoke(ContextClassLoaderSettingInvo
      cationHandler.java:30) ~[ContextClassLoaderSettingInvocationHandler.class:na]
      [INFO] [talledLocalContainer] at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker
      .java:56) ~[na:na]
      [INFO] [talledLocalContainer] at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.j
      ava:60) ~[na:na]
      [INFO] [talledLocalContainer] at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceT
      CCLInterceptor.java:70) ~[na:na]
      [INFO] [talledLocalContainer] at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLIntercept
      or.java:53) ~[na:na]
      [INFO] [talledLocalContainer] at org.eclipse.gemini.blueprint.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextA
      dvice.java:57) ~[na:na]
      [INFO] [talledLocalContainer] at com.atlassian.stash.internal.rest.pull.PullRequestResource.canMerge(PullRequestResource.java:428) ~[bitbu
      cket-rest-4.3.2.jar:na]
      [INFO] [talledLocalContainer] at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:26) [applinks-plugin-5
      .0.5_1453887622000.jar:na]
      [INFO] [talledLocalContainer] at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:26) [applinks-plugin-5
      .0.5_1453887622000.jar:na]
      [INFO] [talledLocalContainer] at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:26) [applinks-plugin-5
      .0.5_1453887622000.jar:na]
      [INFO] [talledLocalContainer] at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:26) [applinks-plugin-5
      .0.5_1453887622000.jar:na]
      [INFO] [talledLocalContainer] at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:26) [applinks-plugin-5
      .0.5_1453887622000.jar:na]
      [INFO] [talledLocalContainer] at com.atlassian.labs.httpservice.resource.ResourceFilter.doFilter(ResourceFilter.java:59) [httpservice-brid
      ge-0.6.2.jar:na]
      [INFO] [talledLocalContainer] at com.atlassian.plugin.connect.plugin.auth.scope.ApiScopingFilter.doFilter(ApiScopingFilter.java:89) [atlas
      sian-connect-plugin-1.1.65-bitbucket-03.jar:na]
      [INFO] [talledLocalContainer] at com.atlassian.stash.internal.spring.security.StashAuthenticationFilter.doFilter(StashAuthenticationFilter
      .java:88) [StashAuthenticationFilter.class:na]
      [INFO] [talledLocalContainer] at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doInsideSpringSecurityChain(B
      eforeLoginPluginAuthenticationFilter.java:109) [BeforeLoginPluginAuthenticationFilter.class:na]

            Assignee:
            Bryan Turner (Inactive)
            Reporter:
            Phil Johnson
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: