• Community
  • Questions
  • No more love from active objects on confluence and MS SQL server ...

No more love from active objects on confluence and MS SQL server ...

Hi there,

We have a few plugins that run active objects and working with no issues on confluence:

Confluence Version4.3.6, Build Number3397, on-premise

One day we've tried adding a new active objects (AO) entity to a plugin that had no AO entities before and we've been struggling with it since then.

Strangely enough, another plugin that had previous AO entities, does work, and newly added AO entities seem to work as well.

Another interesting bit is that the logs inside confluence-data do print create table and insert statements, but the tables are not present in the databasefor some reason.

We've compared the AO declarations in both pom and atlassian xml files and found no differences that should make you wonder about it, apart of the different entity names or signature, it's was all good.

Here's a config snapshot -

<ao key="ao-module">

<description>The module configuring the Active Objects service used by this plugin</description>





<component-import key="ao" name="Active Objects service" interface="com.atlassian.activeobjects.external.ActiveObjects">

<description>Component to access Active Objects functionality from the plugin</description>


<component key="tx-processor" name="Transactional Annotation Processor" class="com.atlassian.activeobjects.external.TransactionalAnnotationProcessor">

<decription>Processes @Transactional annotations.</decription>


And from the pom -







<!-- SAL, the Active Objects plugin uses SAL's API for transactions -->







In the code we used this -

private final ActiveObjects ao;

this.ao = ao;

newdummy nd = this.ao.create(newdummy.class);



The logs show -

2013-06-07 14:28:58,187 DEBUG [http-8088-2] [net.java.ao.sql] onSql CREATE TABLE AO_8E131D_NEWDUMMY (





2013-06-07 14:28:58,193 DEBUG [http-8088-2] [net.java.ao.sql] onSql INSERT INTO AO_8E131D_NEWDUMMY DEFAULT VALUES

2013-06-07 14:28:58,204 DEBUG [http-8088-2] [net.java.ao.sql] onSql UPDATE AO_8E131D_NEWDUMMY SET TEST = ? WHERE ID = ?

2013-06-07 14:28:58,218 DEBUG [http-8088-2] [net.java.ao.sql] onSql SELECT * FROM AO_8E131D_MY_STATUS_TEMPLATE

Here's one of the exceptions in the current confluence log folder -

Caused by: java.sql.SQLException: Invalid object name 'AO_CFF14D_MY_STATUS_TEMPLATE'.

at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:368)

at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2816)

at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2254)

at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:631)

at net.sourceforge.jtds.jdbc.MSCursorResultSet.processOutput(MSCursorResultSet.java:943)

at net.sourceforge.jtds.jdbc.MSCursorResultSet.cursorCreate(MSCursorResultSet.java:541)

at net.sourceforge.jtds.jdbc.MSCursorResultSet.<init>(MSCursorResultSet.java:154)

at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQLQuery(JtdsStatement.java:424)

at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeQuery(JtdsPreparedStatement.java:777)

at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:76)

at net.java.ao.EntityManager.find(EntityManager.java:695)

at net.java.ao.EntityManager.find(EntityManager.java:623)

at net.java.ao.EntityManager.find(EntityManager.java:537)

at com.atlassian.activeobjects.internal.EntityManagedActiveObjects.find(EntityManagedActiveObjects.java:125)

Any help would be appreciated, thanks, mo

1 answer

1 accepted

I'm not sure what the problem is but here are a few things to try:

1. Are both plugins (the one that works and the one that doesn't) deployed in the same Confluence instance? Is there any chance that they could be using different JDBC drivers and/or database URLs? If so, then you could explore the possibility that the driver/url is to blame.

2. Make sure that all of your interaction with AO occurs within a transaction. My preferred approach for that is to inject a com.atlassian.sal.api.transaction.TransactionTemplate into my service class, and do all AO work inside a call to TransactionTemplate#execute.

3. Write a test class to exercise your AO code. That will just help you eliminate potential problems more quickly, rather than having to re-install the plugin over and over. Here's an excerpt from one such class of my own:

public class AoTicketDaoTest {

    private ActiveObjects ao;

    private AoTicketDao dao;

    private EntityManager entityManager;

    public void setUp() {
        ao = new TestActiveObjects(entityManager);
        dao = new AoTicketDao(ao);

    public void testCreatedTicketHasTicketNumber() {

4. Post the definitions of the Java entity interfaces that seem relevant to the problem so that we can check for any problems in there.

This is perfect David, it's working. The funny thing is that all other AO code is working without being wrapped in the transaction block.

Sorry for the late reponse, just came back from overseas...

Thanks again, mo

Suggest an answer

Log in or Join to answer
Community showcase
Louis De Jaeger
Posted Thursday in Off-topic

Friday fun: your best joke

Hi all Lets make this Friday fun really fun and post one (or more) of your best jokes! The joke can be about an Atlassian product, or just a really fun joke you want to share! I’m not the best j...

189 views 12 3
Join discussion

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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot