How to use same active object tables in two different plugins?

“I have created a table through active object in one plugin. And i want to access the same active object table in another plugin.
What should i have in my plugin descriptor and classes ?”

It is not a good idea to do that. What if your table changes?
Export a service that handles data updates than the table itself

It is not possible via plugin descriptor.

Does the AO table name changes when the plugin is deployed on a different JIRA instance? it looks like they are always the same as they depend on the plugin but not on JIRA, so you can look for the AO table name on JIRA and use it (riskily) from other plugins… I doubt the AO algorithm to build table names will be changed by Atlassian in the future as it would impact on all current plugins using AO.

Of course, it would be much better and risk free if you get the AO table name via AO API and share it with other plugins in some way. This will work even the AO algorithm to build table names is modified, but of course, it requires plugin A installed and enabled.

There are few use cases that you would have to access to a AO tables created by plugin A from plugin B and even less with plugin A not installed on JIRA but B enabled…

Okay. I’ve tried to get the AO on a service for another plugin and I always get the error:

Error rendering macro ‘lorem-macro’ : AOP configuration seems to be invalid: tried calling method [public abstract com.test.confluence.plugins.ao.table.TestAoTable[] com.test.confluence.plugins.ao.TestAo.getList(java.lang.String)] on target [com.test.confluence.plugins.ao.TestAoImpl@462abb3]; nested exception is java.lang.IllegalArgumentException: object is not an instance of declaring class

I marked it with @ExportAsService and as Export Package.

 <Export Package>
 com. test. confluence. plugins. ao. ao. ao.resolution ="optional"
 </Export Package>
@Component
@ExportService
public class TestAoImpl implementations TestAo

What am I doing wrong?

Which AMPS are you using? @Compoent annotation has been deprecated and project doesnt even compile using latest version
Why are there spaces in the export package? How did you come up with <export package>? Syntax is wrong, it is <export-package> but i suspect this is some formatting error here same with spaces in the package
Please post your pom.xml if you want us to take a look and I strongly advice to create a new plugin using atlas-create-confluence-plugin command which generates what you need.
I forgot, you need to “import” the exported plugin in the other plugin using the <dependency> mechanism