My Bitbucket plugin includes a config page powered by an HttpServlet. The servlet depends on some SAL classes, e.g. UserManager. I use the @Autowired annotation on the class and @ComponentImport on the parameters to the constructor. When I deploy the plugin to Bitbucket version 5.4.3 (running as a service locally) the log shows
c.a.p.s.s.r.i.ComponentImportBeanFactoryPostProcessor Unable to load class 'com.atlassian.sal.api.user.UserManager' for component importation purposes. Skipping...
and
c.a.plugin.osgi.factory.OsgiPlugin Unable to start the plugin container for plugin 'gov.ssa.mde.v1-4-bb-plugin.versionone-for-bitbucket-plugin'
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'adminServlet': Resolution of declared constructors on bean Class [gov.ssa.mde.v1_4_bb_plugin.AdminServlet] from ClassLoader [gov.ssa.mde.v1-4-bb-plugin.versionone-for-bitbucket-plugin [135]] failed; nested exception is java.lang.NoClassDefFoundError: com/atlassian/sal/api/user/UserManager
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.determineCandidateConstructors(AutowiredAnnotationBeanPostProcessor.java:289)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:866)
at org.eclipse.gemini.blueprint.context.support.AbstractDelegatedExecutionApplicationContext.access$1600(AbstractDelegatedExecutionApplicationContext.java:60)
at org.eclipse.gemini.blueprint.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:325)
at org.eclipse.gemini.blueprint.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
at org.eclipse.gemini.blueprint.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:290)
at org.eclipse.gemini.blueprint.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:137)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.lang.Thread.run(Unknown Source)
... 10 frames trimmed
Caused by: java.lang.NoClassDefFoundError: com/atlassian/sal/api/user/UserManager
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
at java.lang.Class.getDeclaredConstructors(Unknown Source)
... 9 common frames omitted
Caused by: java.lang.ClassNotFoundException: com.atlassian.sal.api.user.UserManager not found by gov.ssa.mde.v1-4-bb-plugin.versionone-for-bitbucket-plugin [135]
at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1532)
... 12 common frames omitted
All of the classes needed are part of the SAL API.
I think I’ve accounted for all the dependencies in the POM file:
<dependency>
<groupId>com.atlassian.sal</groupId>
<artifactId>sal-api</artifactId>
<scope>provided</scope>
<version>3.1.0</version>
</dependency>
<dependency>
<groupId>com.atlassian.bitbucket.server</groupId>
<artifactId>bitbucket-api</artifactId>
<version>${bitbucket.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.atlassian.bitbucket.server</groupId>
<artifactId>bitbucket-spi</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.atlassian.bitbucket.server</groupId>
<artifactId>bitbucket-page-objects</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.atlassian.plugins</groupId>
<artifactId>atlassian-plugins-webfragment</artifactId>
<version>3.0.9</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.atlassian.plugin</groupId>
<artifactId>atlassian-spring-scanner-annotation</artifactId>
<version>${atlassian.spring.scanner.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.atlassian.templaterenderer</groupId>
<artifactId>atlassian-template-renderer-api</artifactId>
<scope>provided</scope>
</dependency>
What more do I need to do to resolve this?