ActiveObjectsSqlException when I try to create an entity

Hi there,

I am developing a plugin for JIRA 5 and was using ActiveObjects to store custom data. Everything was working fine, I was able to store my own entities in the database and so on. But when I recently created another new entity interface and tried to create/store one of these entities in the exact same way i did before, it threw this error:

com.atlassian.activeobjects.internal.ActiveObjectsSqlException: There was a SQL exception thrown by the Active Objects library:
Database:
	- name:HSQL Database Engine
	- version:1.8.0
	- minor version:8
	- major version:1
Driver:
	- name:HSQL Database Engine Driver
	- version:1.8.0

java.sql.SQLException: Table not found in statement [INSERT INTO AO_9B23C2_INVOICE (ID) VALUES (NULL)]
	at com.atlassian.activeobjects.internal.EntityManagedActiveObjects.create(EntityManagedActiveObjects.java:93)
	at com.atlassian.activeobjects.osgi.DelegatingActiveObjects.create(DelegatingActiveObjects.java:56)
	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)
	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
	at org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:58)
	at org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:62)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
	at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
	at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
	at org.springframework.osgi.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceTCCLInterceptor.java:56)
	at org.springframework.osgi.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:39)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
	at org.springframework.osgi.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:59)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
	at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
	at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
	at $Proxy1407.create(Unknown Source)


My interface looks like this:

public interface Invoice extends Entity{

	String getName();
	
	void setName(String name);


}

But when I try to create and store an entity of the type Invoice the error above is thrown:

ao.executeInTransaction(new TransactionCallback<Invoice>() {
				
				@Override
				public Invoice doInTransaction() {
					
					final Invoice entry = ao.create(Invoice.class);
					entry.setName(name);
					entry.save();
					return entry;
				}
				
			});


The result is the same if I just do this:

final Invoice invoice = ao.create(Invoice.class);
invoice.setName("Example");
invoice.save();

As I mentioned above, I am using ActiveObjects for quite a while now and I just dont see what I am doing wrong. I am developing on the usual development-environment that is started with atlas-run/atlas-debug and so on. Is there a limit of own entities that I can create in the HSQL Database?

Thank You!

1 answer

1 accepted

7 votes
Colin Goudie Community Champion Feb 01, 2012

Maybe you didn't add it to your ao object in atlassian-plugin.xml?

<ao key="aoEntities" name="Active Object Entities">

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

<entity>com.xyz</entity>

</ao>

You're my savior! :-)

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published 10 hours ago in Off-topic

Get to know our Atlassian User Group Leaders from Bengaluru, India

Meet @Dinesh Dhinakaran, @Vishnu Vasudeva, @Rajeev Verma, and Jamshid Nalakath: Our extraordinary AUG leaders from Bengaluru, India. These four work together to strengthen the bonds of their local co...

85 views 0 4
Read article

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