Unable to use a newer ActiveObject version in my plugin
Asked by Stefan Kohler:

I'm trying to upgrade my plugin to work with Confluence 4.x. As a part of that upgrade I also changed the version of ActiveObjects. I was using 0.11 and I upgraded to 0.19.1.1.

I noticed that there where some changes in version 0.18. and I checked all the information online about this. When using my plugin in Confluence 4.1.1 I get the next exception

```
com.atlassian.plugin.PluginException: com.atlassian.activeobjects.osgi.NoServicesFoundException: Was expecting at least one service reference for interface &lt;com.atlassian.activeobjects.config.ActiveObjectsConfiguration&gt; and filter &lt;(com.atlassian.plugin.key=nl.stefankohler.confluence.confluence-twitter-plugin)&gt;. Got null !	at com.atlassian.activeobjects.osgi.ActiveObjectsServiceFactory.getConfiguration(ActiveObjectsServiceFactory.java:134)	at com.atlassian.activeobjects.osgi.ActiveObjectsServiceFactory.access$200(ActiveObjectsServiceFactory.java:40)	at com.atlassian.activeobjects.osgi.ActiveObjectsServiceFactory$LazyActiveObjectConfiguration.getDelegate(ActiveObjectsServiceFactory.java:238)	at com.atlassian.activeobjects.osgi.ActiveObjectsServiceFactory$LazyActiveObjectConfiguration.getDataSourceType(ActiveObjectsServiceFactory.java:189)	at com.atlassian.activeobjects.internal.AbstractActiveObjectsFactory.accept(AbstractActiveObjectsFactory.java:35)	at com.atlassian.activeobjects.internal.DelegatingActiveObjectsFactory.create(DelegatingActiveObjectsFactory.java:37)	at com.atlassian.activeobjects.osgi.ActiveObjectsServiceFactory.createActiveObjects(ActiveObjectsServiceFactory.java:108)	at com.atlassian.activeobjects.osgi.ActiveObjectsServiceFactory.access$000(ActiveObjectsServiceFactory.java:40)	at com.atlassian.activeobjects.osgi.ActiveObjectsServiceFactory$1$1.get(ActiveObjectsServiceFactory.java:54)	at com.atlassian.activeobjects.osgi.ActiveObjectsServiceFactory$1$1.get(ActiveObjectsServiceFactory.java:50)	at com.google.common.base.Suppliers$MemoizingSupplier.get(Suppliers.java:109)	at com.atlassian.activeobjects.osgi.DelegatingActiveObjects.executeInTransaction(DelegatingActiveObjects.java:119)	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)	at java.lang.reflect.Method.invoke(Method.java:597)
```

Did I missed anything during the upgrade or are there things I should be aware of?


Answers:
author: Stefan Kohler
body: After some more debugging I found out that I forgot to change one of the new reservered keywords, as suggested by David.

Plugin is now working with AO version 0.18.4 and higher!

comments: author: David at David Simpson Apps
body: Cool. Now that you're a world leader on upgrading AO in Confluence, perhaps you'd like to share your experiences in a blogpost :-)


author: David at David Simpson Apps
body: There were some important changes to the underlying AO library at version 0.18.x

Details here:  
<https://developer.atlassian.com/display/AO/AO+0.18.x+Upgrade+Guide>

Note:
> Active Objects 0.18.4 is the first AO version in this series that you should use. Previous versions had bugs that will cause problems.

There's no documentation on upgrading AO in Confluence though :(

comments: author: Stefan Kohler
body: Hi David,

I am aware of these changes and documentation as I mentioned in the question ;-)
> I noticed that there where some changes in version 0.18. and I checked all the information online about this.

Upgrade guide to JIRA seemds ok, but nothing for Confluence indeed. This will become an issue I guess, there are already some plugin out there making use of Active Object. Atlassian did encourage this even, with the codegeist..


author: Samuel Le Berrigaud
body: Hey Stefan,

this should work. A few questions:

1. Have you tried version 0.18.4?
2. If yes does it have the same issue?
3. Can you share your atlassian-plugin.xml?

comments: author: Stefan Kohler
body: It worked perfectly... I just missed one of the new reservered keywords, fixed that and it seems to be running OK now.

Are there any upgrade paths for those reserved keywords?


author: Julien Hoarau
body: You should use an UpgradeTask with the @IgnoreReserverdKeyword annotation. cf. <https://studio.atlassian.com/browse/AO-278>


Tags: active-objects