Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Template rendere is not working after adding new dependencies

I am developing a plugin for Jira. I have included template renderer using,

<dependency>
<groupId>com.atlassian.templaterenderer</groupId>
<artifactId>atlassian-template-renderer-api</artifactId>
<version>1.3.1</version>
<scope>provided</scope>
</dependency>

and it has been working for long time. But ever since I have introduced some new dependency jars ( that has nothing to do with template renderer! ), it is not working for me. I have posted the logs below. I have tried rebuilding after atlas-clean command, but nothing worked for me. Please help me in this regard. Thanks.

[INFO] [talledLocalContainer] 2018-03-19 18:20:50,889 FelixDispatchQueue ERROR [c.a.p.o.container.felix.FelixOsgiContainerManager] Framework error in bundle com.atlassian.templaterenderer.atlassian-template-renderer-velocity16-plugin
[INFO] [talledLocalContainer] org.osgi.framework.ServiceException: Service factory exception: Cannot instantiate class for introspector.cache.classes
[INFO] [talledLocalContainer] at org.apache.felix.framework.ServiceRegistrationImpl.getFactoryUnchecked(ServiceRegistrationImpl.java:312)
[INFO] [talledLocalContainer] at org.apache.felix.framework.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:219)
[INFO] [talledLocalContainer] at org.apache.felix.framework.ServiceRegistry.getService(ServiceRegistry.java:320)
[INFO] [talledLocalContainer] at org.apache.felix.framework.Felix.getService(Felix.java:3568)
[INFO] [talledLocalContainer] at org.apache.felix.framework.BundleContextImpl.getService(BundleContextImpl.java:468)
[INFO] [talledLocalContainer] at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ReferenceHolder.getService(ReferenceHolder.java:47)
[INFO] [talledLocalContainer] at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceDynamicInterceptor$ServiceLookUpCallback.doWithRetry(ServiceDynamicInterceptor.java:104)
[INFO] [talledLocalContainer] at org.eclipse.gemini.blueprint.service.importer.support.internal.support.RetryTemplate.execute(RetryTemplate.java:81)
[INFO] [talledLocalContainer] at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceDynamicInterceptor.lookupService(ServiceDynamicInterceptor.java:427)
[INFO] [talledLocalContainer] at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceDynamicInterceptor.getTarget(ServiceDynamicInterceptor.java:400)
[INFO] [talledLocalContainer] at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:60)

 

3 answers

I had the same issue and manage to solve it by fixing the sal-api dependency version.

<dependency>
<groupId>com.atlassian.sal</groupId>
<artifactId>sal-api</artifactId>
<version>3.1.0</version>
<scope>provided</scope>
</dependency>

According to the SAL version matrix 3.1.0 is the last one supporting JIRA 7.x.

Additionally I had to add some lines to the Import-Package node in my pom.xml.  It is looking like that now for my plugin:

<Import-Package>
com.atlassian.jira.bc.filter,
com.atlassian.jira.bc.issue.search,
com.atlassian.jira.issue,
com.atlassian.jira.issue.fields,
com.atlassian.jira.issue.fields.layout.field,
com.atlassian.jira.issue.fields.rest.json.beans,
com.atlassian.jira.jql.parser,
com.atlassian.jira.security,
com.atlassian.sal.api,
com.atlassian.sal.api.pluginsettings,
com.atlassian.sal.api.transaction,
com.atlassian.templaterenderer,
org.springframework.beans,
org.springframework.beans.factory,
org.springframework.cglib.core,
org.springframework.cglib.proxy,
org.springframework.cglib.reflect,
*
</Import-Package>

The highlighted ones were added after changing the sal-api version.

Btw I'm using Atlassian Spring Scanner 2. I don't know, maybe the use of previous versions implies further changes.

Here are some version number related to my solution:

<properties>
<jira.version>7.9.0</jira.version>
<amps.version>6.3.15</amps.version>
<spring.version>5.0.4.RELEASE</spring.version>
<atlassian.spring.scanner.version>2.1.3</atlassian.spring.scanner.version>
<!-- This key is used to keep the consistency between the key in atlassian-plugin.xml and the key to generate bundle. -->
<atlassian.plugin.key>${project.groupId}.${project.artifactId}</atlassian.plugin.key>
<!-- TestKit version 6.x for JIRA 6.x -->
<testkit.version>6.3.11</testkit.version>
<plugin.testrunner.version>1.2.3</plugin.testrunner.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>

Good luck!

Deleted. I accidently posted twice, since I thought the first answer was not published.

The problem appeared again. This time after adding

<DynamicImport-Package>*</DynamicImport-Package>

to the instructions of maven-jira-plugin. This seems to load imcompatible dependencies, too.

After removing the line I didn't get rid of the error. Restarting JIRA was not enough, I had to clean the maven target folder to get things running again.

Turns out, tackling dependencies problems in OSGi can be pretty time consuming.

Hey, did you resolved this problem?

Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you