Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Troubleshooting BundleException "missing requirement spring.scanner.annotation.imports"

Henrik Heimbuerger December 9, 2015

I'm building a plugin for Bitbucket Server 4.1.3 using the SDK 6.1.2 (tested with the same SDK version on Linux and Windows). My plugin uses autowiring for all services using the Atlassian Spring Scanner and that is generally working well. In development, I'm reloading after changes with Quick Reload (FastDev is disabled).

This usually goes well for a couple of hours, until suddenly during a plugin reload or a full atlas-run startup:

[INFO] [talledLocalContainer] 2015-12-09 14:30:07,583 ERROR [spring-startup]  c.a.p.o.f.OsgiPluginInstalledHelper Cannot determine required plugins, cannot resolve bundle 'com.example.myplugin'

[INFO] [talledLocalContainer] 2015-12-09 14:30:14,671 ERROR [spring-startup]  c.a.plugin.osgi.factory.OsgiPlugin Detected an error (BundleException) enabling the plugin 'com.example.my-plugin' : Unresolved constraint in bundle com.example.myplugin [114]: Unable to resolve 114.0: missing requirement [114.0] osgi.wiring.package; (&(osgi.wiring.package=com.atlassian.plugin.spring.scanner.annotation.imports)(version>=0.0.0)).  This error usually occurs when your plugin imports a package from another bundle with a specific version constraint and either the bundle providing that package doesn't meet those version constraints, or there is no bundle available that provides the specified package. For more details on how to fix this, see https://developer.atlassian.com/x/mQAN

(Full stacktrace here.)

Now I know this isn't the real cause, because if I stop the server, run atlas-mvn clean && atlas-run, everything starts working fine again for a few hours. Even though I didn't change my code at all.

What could be triggering this? Can I troubleshoot this somehow to figure out why it can't resolve the Spring Scanner? Is there an easier way to fix this issue than rebuilding my entire test setup?

---

Research notes:

  • Probably the same issues as discussed in the comments of the 'Create a HelloWorld Plugin Project' article. The <Import-Package> is mentioned but no clear explanation what the problem is and how that is supposed to solve it.
  • On Windows, this occurs reproudicibly immediately at the first reload with Quick Reload (rendering it entirely unusable). The only fix I have discovered so far is to recreate the target environment from scratch.
  • For a moment, it seemed as if upgrading to atlassian-spring-scanner-core v1.2.12 fixes the issues. After installing that, a few reloads worked on Windows. However, then the issue returned.
  • Checking the OSGi console (/bitbucket/plugins/servlet/upm/osgi), I see no 'spring-scanner' anywhere. Neither when the plugin works, nor when the system is in the broken state.
  • I've since upgraded to Bitbucket Server 4.2.0 (still with Atlassian Spring Scanner 1.2.12) and this still occurs at roughly the same frequency.

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Powpow Shen August 4, 2016

In my cause, quickreload always fail to detect java code change, so I remove all compiled classes under target folder and run "atlas-package". This is faster than building from scratch.

TAGS
AUG Leaders

Atlassian Community Events