Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Up-To-Date Tutorial of how to use Active Objects

manuelm May 20, 2019

Dear Community,

I am new in developing Add-Ons and at the moment, I am trying to use Active Objects but unfortunately, it doesn't work. Can you please help me?

First of all: I am using Jira SDK with the following settings:

  • Jira version 7.12.0
  • amps version 6.3.21
  • Spring scanner: 1.2.13

What have I done so far?

I have my Add-On Skeleton which works fine so far. I have a webwork which I want to use to enter data. That works fine. A HTML formular appears and I am able to hit "save". "Save" goes to my Java class which accept all the HTML formular fields. Furthermore I have an active objects class with the definition my of "table":

package de.idsimaging.com.jira.activeobjects;

import net.java.ao.Entity;

public interface MyOwnTable extends Entity
{
String getName();
String setName(String name);

String getDescription();
String setDescription(String description);
}

No compiler errors so far and the "table" also appears in database and in "Plugin data storage" section in JIRA.

Now, it's time to use it but that's the point where i struggled with and where I ask for your help. I've read several tutorials but either i don't understand or the tutorials are out of date. I've read the following points, unknown if they true or false:

I need to import the right package

import com.atlassian.activeobjects.external.ActiveObjects;

Result: Works. No errors.

 

I need to extend my constructor of my related Java class by adding: 

public MyOwnTableAction(@ComponentImport final ActiveObjects ao)
{
obj_ProjectManager = getProjectManager();
//this.ao = ao;

}

Result: It doesn't work. Error file says "org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name..." In that case, I've read, that I have to import an "component-import" to my plugin.xml ->

I need to add a component-import to my plugin.xml

<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>

Result: It doesn't work. Error appears: "atlassian-plugin.xml contains a definition of component-import. This is not allowed when Atlassian-Plugin-Key is set." No idea of what to do.

I need to add an dependency to my pom.xml

<dependency>
<groupId>com.atlassian.activeobjects</groupId>
<artifactId>activeobjects-plugin</artifactId>
<version>2.0.0</version>
<scope>provided</scope>
</dependency>

Result: Done. No errors. But I also have read that I don't have to do it when I use Atlassian Spring Scanner? Not sure what that means but I have some active spring scanner settings in my pom.xml.

 

Can you please help me to find the absolut minimalist of how to use a very simple Active Objects in an Add-On? Thank you very much in advance.

Kind regards!

2 answers

0 votes
manuelm May 20, 2019

Hi Pedro,

yes. I always get the error "org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name..." with or without the component-import setting.

Kind regards,

Manuel

0 votes
Pedro Felgueiras
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 20, 2019

Hi there, 

 

Have you tried to remove the component-import from the plugin.xml ? 

 

Best regards, 

Pedro 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events