I am trying to connect to the Bitbucket Database. I try to do this with the H2 driver. The Problem is it needs a lot of other dependencies. I imported all but osgi can't resolve the package "org.apache.lucene" "lucene-queryparser". I cleary imported it in my POM. Somehow it can't be resolved.
How did you guys do your Database connection? I would be glad if i could see a POM of you.
<!-- https://mvnrepository.com/artifact/com.vividsolutions/jts -->
<!-- https://mvnrepository.com/artifact/org.apache.lucene/lucene-core -->
<!-- https://mvnrepository.com/artifact/org.apache.lucene/lucene-queryparser -->
<!-- https://mvnrepository.com/artifact/org.apache.lucene/lucene-queries -->
Caused by: org.osgi.framework.BundleException: Unresolved constraint in bundle
: Unable to resolve 127.0: missing requirement [127.0] osgi.wiring.package;
Thanks for the Help.
The Bitbucket Server database, its schema, and how to connect to it are not part of our API, and are not for plugin developers to use directly. This is true whether the system is using the H2 internal database or has been migrated to an external database such as PostgreSQL or MySQL. As accessing the database directly is unsupported, we won't offer advice or assistance on how to do so.
If your plugin needs to store data in the database in its own tables, you may do so using Active Objects. Active Objects may not be used to access the system's database tables. To access data in the system's database tables, you may use our published service API. Attempting to access the system's tables directly via the database is not supported.
Ohh, can I quote you in other places?
It is a very clear explanation of why people should not try direct database access in Bitbucket apps, with good guidance on the right approach (and, I'd like to stretch it if possible - it applies to most of the rest of the Atlassian applications if I've understood it correctly)
I think in general the same advice applies to all the other products, but I believe some of them have other supported methods to access the database in addition to Active Objects. Jira, for example, has a much looser set of restrictions for their database (see here) than Bitbucket Server does. Their documentation still discourages direct database access, though, so I think it's fair to say my answer applies there as a best practice.
Bitbucket Server in general enforces its API boundaries more strongly than the other products. For example, in Jira it's possible (but not recommended) to access "internal" types in plugins. In Bitbucket Server we enforce that more strictly; our internal API is not exported via OSGi and may not be used by plugins. Attempts to do so fail to resolve internal classes at runtime. Our more aggressive limitations are at least partially a result of the experience of supporting "looser" API restrictions in the other products.
Hi Joel, are you running a production instance of Bitbucket with the embedded database? That configuration is not supported and we won't be able to help you with that. The internal Bitbucket database is meant for testing single user instances, and it's proven to not work with much more than 10 users, or even less if you have a lot of CI tool activity or if the use is more than what 10 users would normally generate.
We recommend using external databases such as Postgres or MySql. You can read Connecting Bitbucket Server to an external database for instructions.
Can you try that with one of the supported databases and let us know how it goes?
This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.Read more
Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda ...
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs