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; = ao;

newdummy nd =;


The logs show -

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





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

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

2013-06-07 14:28:58,218 DEBUG [http-8088-2] [] 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(

at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(

at net.sourceforge.jtds.jdbc.TdsCore.nextToken(

at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(

at net.sourceforge.jtds.jdbc.MSCursorResultSet.processOutput(

at net.sourceforge.jtds.jdbc.MSCursorResultSet.cursorCreate(

at net.sourceforge.jtds.jdbc.MSCursorResultSet.<init>(

at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQLQuery(

at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeQuery(

at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(




at com.atlassian.activeobjects.internal.EntityManagedActiveObjects.find(

Any help would be appreciated, thanks, mo

1 answer

1 accepted

2 votes
Answer 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 Sign up to answer
Community showcase
Posted yesterday in United States

Confluence Security Advisory

Good morning Members, Not sure if you are aware. Please read the following: More details: https://co...

36 views 1 0
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