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>
<entity>aaa.templatebindings.entities.StatusTemplate</entity>
<entity>aaa.templatebindings.entities.TemplateSection</entity>
<entity>aaa.templatebindings.newdummy</entity>
</ao>
<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-import>
<component key="tx-processor" name="Transactional Annotation Processor" class="com.atlassian.activeobjects.external.TransactionalAnnotationProcessor">
<decription>Processes @Transactional annotations.</decription>
</component>
And from the pom -
<dependency>
<groupId>com.atlassian.activeobjects</groupId>
<artifactId>activeobjects-plugin</artifactId>
<version>0.20</version>
<scope>provided</scope>
</dependency>
<!-- SAL, the Active Objects plugin uses SAL's API for transactions -->
<dependency>
<groupId>com.atlassian.sal</groupId>
<artifactId>sal-api</artifactId>
<version>2.4.1</version>
<scope>provided</scope>
</dependency>
In the code we used this -
private final ActiveObjects ao;
this.ao = ao;
newdummy nd = this.ao.create(newdummy.class);
nd.setTest(String.valueOf(System.currentTimeMillis()));
nd.save();
The logs show -
2013-06-07 14:28:58,187 DEBUG [http-8088-2] [net.java.ao.sql] onSql CREATE TABLE AO_8E131D_NEWDUMMY (
ID INTEGER IDENTITY(1,1) NOT NULL,
TEST VARCHAR(255),
CONSTRAINT pk_AO_8E131D_NEWDUMMY_ID PRIMARY KEY(ID)
)
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