Hello, I'm trying to override and extend some Jira actions and I am getting an error with CreateWorklog action. The error when I try to log work in jira is:
Could not execute action [CreateWorklog!default]:Error creating bean with name 'package.ExtendedCreateWorklog':
Unsatisfied dependency expressed through constructor argument with index 3 of type [com.atlassian.jira.util.JiraDurationUtils]:
: No unique bean of type [com.atlassian.jira.util.JiraDurationUtils] is defined: Unsatisfied dependency of type [class
com.atlassian.jira.util.JiraDurationUtils]: expected at least 1 matching bean; nested exception is
org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type
[com.atlassian.jira.util.JiraDurationUtils] is defined: Unsatisfied dependency of type [class
com.atlassian.jira.util.JiraDurationUtils]: expected at least 1 matching bean.......
The code in my atlassian-plugin.xml is:
<webwork1 key="Create-worklog-extended" name="my create worklog extension">
<actions>
<action name="package.ExtendedCreateWorklog" alias="CreateWorklog">
<view name="error">/secure/views/issue/logwork.jsp</view>
<view name="input">/secure/views/issue/logwork.jsp</view>
<view name="securitybreach">/secure/views/securitybreach.jsp</view>
</action>
</actions>
</webwork1>
My class ExtendedCreateWorklog is:
public class ExtendedCreateWorklog extends CreateWorklog
{
public ExtendedCreateWorklog(WorklogService worklogService, CommentService commentService,
ProjectRoleManager projectRoleManager, JiraDurationUtils jiraDurationUtils,
OutlookDateManager outlookDateManager) {
super(worklogService, commentService, projectRoleManager, jiraDurationUtils, outlookDateManager);
}
@Override
protected void doValidation(){
....CODE....
}
@Override
protected String doExecute() throws Exception {
....CODE....
}
}
I've found this post in the forum (http://forums.atlassian.com/message.jspa?messageID=257349347) but I don't know if this error has solution and How can I to solve it.
I've tried to put in atlassian-plugin.xml the next: "<component-import key="JiraDurationUtils" class="com.atlassian.jira.util.JiraDurationUtils"/>" , or replace in the constructor method of ExtendedCreateWorklog "jiraDurationUtils" argument by "ComponentManager.getInstance().getJiraDurationUtils()" but no result for me.
I have done something with a listener but it isn't quit right...
If anyone has some ideas for override CreateWorklog action, please help me with this. Thanks a lot!
Community moderators have prevented the ability to post new answers.
Bit late but this should fix it.
http://www.j-tricks.com/1/post/2013/07/component-import-gotchas-nosuchbeandefinitionexception.html
It may be a "version 1 vs version 2" issue.
I hope this works.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
ComponentManager.getInstance().getJiraDurationUtils() should work, if you are using the Atlassian SDK.
Please describe, if you are getting an error (and what) at compile or run time.
At this stage your problem description is not sufficient.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.