When implementing the example code for "Managing a Session Manually" described at
I get the following exception:
caused by: java.lang.ClassNotFoundException: org.springframework.orm.hibernate.HibernateCallback at org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:772)
Community moderators have prevented the ability to post new answers.
Ok I found out that the org.springframework.orm.hibernate package is not available, so this is impossible.
There's an example implementation at the bottom of this page: https://developer.atlassian.com/display/CONFDEV/RPC+Module
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ah, that really sucks.
Actually... there is a section on doco that you linked that specifically discusses what to do in plugins. You should be able to use com.atlassian.sal.api.transaction.TransactionCallback; and
com.atlassian.sal.api.transaction.TransactionTemplate; to manage a hibernate session without interacting with any of the hibernate classes directly.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Awesome! Sorry I didn't point this out straight away and sent you on a goose chase with your plugin's bundle intructions. :-)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So, I found these instructions a bit incomplete. in my atlassian-plugin.xml file I needed to add the following before Spring could import the object:
<component-import key="transactionTemplate" name="Hibernate Transaction Template" interface="com.atlassian.sal.api.transaction.TransactionTemplate" />
After that, I could use the normal mechanism to pull the object in via the class constructor.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If your atlassian-plugin.xml has an <Import-Package> element, make sure that you are importing the org.springframework.orm.hibernate namespace.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I've added
<Import-Package>org.springframework.orm.hibernate,*;resolution:=optional</Import-Package>
to my plugin and now I'm getting this at installation:
Caused by: org.osgi.framework.BundleException: [...] Unable to resolve 89.0: missing requirement [89.0] package; (package=org.springframework.orm.hibernate)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.