I am using Jira Data Center 9.4.15. I want to create a service that uses Active Objects but I get the following error when trying to add the service:
Using dependency injection with other beans works just fine. I get this error only with Active Objects.
My service class looks like this:
@Component
public class ReminderNotificationService extends AbstractService {
private final ActiveObjects activeObjects;
@Autowired
public ReminderNotificationService(ActiveObjects activeObjects) {
this.activeObjects = activeObjects;
}
@Override
public void run() { }
@Override
public ObjectConfiguration getObjectConfiguration() {
Map<String, ObjectConfigurationProperty> configProperties = new HashMap<>();
StringObjectDescription objectDescription = new StringObjectDescription("");
return new ObjectConfigurationImpl(configProperties, objectDescription);
}
}
atlassian-plugin.xml:
...
<component-import key="activeObjects" interface="com.atlassian.activeobjects.external.ActiveObjects"/>
<ao key="ActiveObjectModule">
<description>The module configuring the Active Objects service used by this plugin</description>
[Entity declarations]
</ao>
...
pom.xml:
<dependencies>
<dependency>
<groupId>com.atlassian.jira</groupId>
<artifactId>jira-api</artifactId>
<version>${jira.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.atlassian.jira</groupId>
<artifactId>jira-core</artifactId>
<version>${jira.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.atlassian.activeobjects</groupId>
<artifactId>activeobjects-plugin</artifactId>
<version>3.0.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.atlassian.sal</groupId>
<artifactId>sal-api</artifactId>
<version>4.0.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
<scope>provided</scope>
</dependency>
<!-- WIRED TEST RUNNER DEPENDENCIES -->
<dependency>
<groupId>com.atlassian.plugin</groupId>
<artifactId>atlassian-spring-scanner-annotation</artifactId>
<version>${atlassian.spring.scanner.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.atlassian.plugins</groupId>
<artifactId>atlassian-plugins-osgi-testrunner</artifactId>
<version>${plugin.testrunner.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>jsr311-api</artifactId>
<version>1.1.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.2.2-atlassian-1</version>
</dependency>
</dependencies>
...
<properties>
<jira.version>9.4.15</jira.version>
<amps.version>8.2.2</amps.version>
<plugin.testrunner.version>2.0.2</plugin.testrunner.version>
<atlassian.spring.scanner.version>2.1.7</atlassian.spring.scanner.version>
<atlassian.plugin.key>${project.groupId}.${project.artifactId}</atlassian.plugin.key>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
</properties>
ComponentAccessor.getOSGiComponentInstanceOfType(ActiveObjects.class) also doesn't work, it returns null.
I had the same problem as you, wondering if you solved it? If it is resolved, can you tell me the solution?
Hi folks!
@Pawel Owsnicki, @Kiên Nguyễn Trung or anyone reading this thread, do you have any updates on this?
I'm also after this answer for a customer who's trying to use Active Objects in Jira Scheduled Services.
Thanks in advance!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm not using Active Objects in Jira Scheduled Services. If you want create class to use Jira Scheduled Services, try implement logic function in your class extends AbstractService. I'm tried this way and it's success.
Hope you try success
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.