Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
Level
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

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

How to properly use @JiraImport annotation Edited

Wash4 I'm New Here Apr 01, 2021

Hello,

I tried to follow this tutorial here: 

https://developer.atlassian.com/server/jira/platform/creating-a-jira-issue-crud-servlet-and-issue-search/

 

I have following service class:

@Scanned
@Service
public class JiraService {
private static final Logger log = LoggerFactory.getLogger(JiraService.class);

@JiraImport
private IssueService issueService;

@JiraImport
private ProjectService projectService;

@JiraImport
private UserManager userManager;

@JiraImport
private ConstantsManager constantsManager;

@JiraImport
private JiraAuthenticationContext authenticationContext;

public JiraService(IssueService issueService, ProjectService projectService, UserManager userManager, ConstantsManager constantsManager, JiraAuthenticationContext authenticationContext) {
this.issueService = issueService;
this.projectService = projectService;
this.userManager = userManager;
this.constantsManager = constantsManager;
this.authenticationContext = authenticationContext;
}


 

Wiring it in another service:

@Autowired
@Inject
private JiraService jiraService; 

 

But jira locally does not start at all as it enters some magical cycle while trying to run locally by atlas-run cmd:

[INFO] [talledLocalContainer] "Reference Handler" Id=2 RUNNABLE
[INFO] [talledLocalContainer] at java.base@14.0.2/java.lang.ref.Reference.waitForReferencePendingList(Native Method)
[INFO] [talledLocalContainer] at java.base@14.0.2/java.lang.ref.Reference.processPendingReferences(Reference.java:241)
[INFO] [talledLocalContainer] at java.base@14.0.2/java.lang.ref.Reference$ReferenceHandler.run(Reference.java:213)
[INFO] [talledLocalContainer]
[INFO] [talledLocalContainer] "Finalizer" Id=3 WAITING on java.lang.ref.ReferenceQueue$Lock@8b885ce
[INFO] [talledLocalContainer] at java.base@14.0.2/java.lang.Object.wait(Native Method)
[INFO] [talledLocalContainer] - waiting on java.lang.ref.ReferenceQueue$Lock@8b885ce
[INFO] [talledLocalContainer] at java.base@14.0.2/java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:155)
[INFO] [talledLocalContainer] at java.base@14.0.2/java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:176)
[INFO] [talledLocalContainer] at java.base@14.0.2/java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:170)
[INFO] [talledLocalContainer]
[INFO] [talledLocalContainer] "Signal Dispatcher" Id=4 RUNNABLE

 

In my humble opinion there is an issue combining constructor and JiraImport annotations..

 

1 answer

0 votes
Daniel Eads Atlassian Team Apr 02, 2021

Hey @Wash4 , welcome!

I see this question has already gone a day without an answer, which generally decreases the likelihood that it will get answered here. Most of the folks answering questions are end-users and admins, rather than developers working directly with atlas-run.

We have a dedicated Developer Community that might be good to check out for plugin development related questions. Since the topics are more focused, it's easier for other developers to watch the questions coming in and provide guidance. I would recommend posting there as it's likelier that the question will be seen by other Java developers working in the Jira SDK.

Cheers,
Daniel

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira Service Management

ThinkTilt is joining the Atlassian Family!

This morning, Atlassian announced the acquisition of ThinkTilt , the maker of ProForma, a no-code/low code form builder with 700+ customers worldwide. ThinkTilt helps IT empower any team in their or...

455 views 19 23
Read article

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