How to Import H2 Embedded Database in Confluence Macro Pom.xml?

I'm developing confluence macro plugin using java. I have created the h2 embedded database and I have added the dependency in pom.xml but i'm getting an Bundle Exception error

<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>1.3.174</version>
</dependency>

 

ERROR [QuickReload - Plugin Installer] [plugin.osgi.factory.OsgiPlugin] enableInternal Detected an error (BundleException) enabling the plugin [caused by: Unable to resolve 257.0: missing requirement [257.0] osgi.wiring.package; (osgi.wiring.package=com.ibm.uvm.tools)]. 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

 

Please anybody help me to include h2.jar and database file in the confluence macro plugin and build a mvn package

 

1 answer

This widget could not be displayed.

This is something I would want to question quite a lot.  Three reasons

If you are embedding a database driver into an add-on, that makes it useless for other databases, and makes your macro useless for other Confluences.

Reading an Atlassian database directly is almost always the worst possible way to work with a system.  Unless you're coding for a database that isn't the Confluence the macro will be running in, you are probably doing it the wrong way.

Finally, you're asking about an h2 database.  Again, if this is an Atlassian system, I'd question the reason, as an h2 based Atlassian system is going to be a dev/test system, not a real user system.

Could you tell us what this macro is actually for?  Not in tems of "I want to do something", but "the users of the macro will get this out of it".

I'm developing a macro for fetching the Active Directory data of the current user and storing it in local embedded database and showing it as OrgChart in the confluence.
I have already done fetching data from AD and rendering it as org chart in confluence. Now I need to bring local database for middleware to store AD  data and render it in confluence(Periodic & OnDemand Sync from AD)

Flow1.jpg

Please help me for achieve this. Thanks!

It would probably be a lot better to do this with Active Objects rather than write your own data store.  See https://developer.atlassian.com/docs/atlassian-platform-common-components/active-objects

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted 5 hours ago in Featured Groups

Hi! I'm Cameron Deatsch, Head of Server at Atlassian and I'm hosting an AMA next week.

Hey team! I'm Cameron Deatsch, Head of Server at Atlassian. I'll be hosting an AMA over in our Questions section of the Community next Monday, so shoot me your questions, upvote others' question...

23 views 0 2
View post

Atlassian User Groups

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!

Find my local user group

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

Groups near you