Forums

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

Cannot autowire ProjectHelper in Web Action

Hy Nguyen March 10, 2019

Hi, I'm developing a Jira addon and need to use JIRA's ProjectHelper API in a web action (Spring scanner 2 enabled), so I used autowire annotation like this:

public class AddCustomPanelAction extends JiraWebActionSupport {

// Problematic lines
@Autowired
private ProjectHelper projectHelper;

public AddCustomPanelAction() {
super();
}

@Override
public String execute() throws Exception {
return super.execute();
}

The problem is: If I remove the injection (@Autowired private ProjectHelper projectHelper), the excute method can be reach, but if I keep the injection like above, it can reach only the constructor method but cause an error about dependency injection and cannot reach the execute method.
Did I do something wrong with my injection? Thank you.

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events