JIRA Plugin: User 'admin' exists but has no unique key mapping
来源:互联网 发布:软件配置管理工具 编辑:程序博客网 时间:2024/05/01 21:09
插件启动时报:
[INFO] [talledLocalContainer] Exception in thread "ThreadPoolAsyncTaskExecutor::Thread 11" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'myPluginComponent' defined in URL [bundle://156.0:0/META-INF/spring/atlassian-plugins-components.xml]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: User 'admin' exists but has no unique key mapping.
我的 atlassian-plugin.xml 代码:
<!-- publish our component --> <component key="myPluginComponent" class="com.cpinec.integration.client.SuperClient" public="true"> <interface>com.cpinec.integration.client.ISuper</interface> </component>SuperClient.java:
public class SuperClient implements ISuper, InitializingBean{ IssueService issueService = ComponentAccessor.getIssueService(); IssueWorkflowManager issueWFMngr = ComponentAccessor.getComponentOfType(IssueWorkflowManager.class); static List<JiraProject> projects = null; Map<String, Project> projectMap = new HashMap<String, Project>(); static ApplicationUser admin = null; @Override public void afterPropertiesSet() throws Exception{ projects = Parser.parseXML();JiraAuthenticationContext jAC = ComponentAccessor.getJiraAuthenticationContext();jAC.setLoggedInUser(ComponentAccessor.getUserManager().getUserByName("admin"));admin = jAC.getUser(); }
网上的 Editing Issues Fails With the Message - User xxxx exists but has no unique key mapping 说 getUserByName 出了问题,但是我不知道怎么改,又搜了下,EAP Feedback - JIRA 6.0 里最下面的 Chris Fuller 说 “It is a safety check that has identified that your system is broken, but it has no idea why.” 我就在想会不会是因为我的 getUserByName 是在 init method 里面调用的,这个时候插件的状态还不稳定,所以没办法获取 admin 这个账号的信息,然后报错。
试着修改了下:
public class SuperClient implements ISuper, InitializingBean{ IssueService issueService = ComponentAccessor.getIssueService(); IssueWorkflowManager issueWFMngr = ComponentAccessor.getComponentOfType(IssueWorkflowManager.class); static List<JiraProject> projects = null; Map<String, Project> projectMap = new HashMap<String, Project>(); private static ApplicationUser admin = null; @Override public void afterPropertiesSet() throws Exception{ projects = Parser.parseXML(); } public static ApplicationUser getAdminUser() { if (admin == null) { // Authenticate actions JiraAuthenticationContext jAC = ComponentAccessor.getJiraAuthenticationContext(); jAC.setLoggedInUser(ComponentAccessor.getUserManager().getUserByName("admin")); admin = jAC.getUser(); } return admin; }然后只有在需要 admin 账号的地方才调用 getAdminUser 方法,重新跑 atlas-run,通过!!!
0 0
- JIRA Plugin: User 'admin' exists but has no unique key mapping
- 登陆admin后台 报错 'WSGIRequest' object has no attribute 'user'
- 'WSGIRequest' object has no attribute 'user'
- library dfftpack has Fortran sources but no Fortran compiler found
- No row with the given identifier exists: [model.User#49]
- Fragment no longer exists for key f0: index 0
- Fragment no longer exists for key f0: index 0
- ERROR OGG-01168 which has no unique ke y defined
- ERROR OGG-01168 which has no unique ke y defined
- clssnmvDHBValidateNCopy: node 1, rac01, has a disk HB, but no network HB, DHB has rcfg
- JIRA has been locked
- User has no SELECT privilege on V$SESSION
- 邮箱不可用 550 User has no permission
- javax.mail.AuthenticationFailedException: 550 User has no permission出错
- 邮箱不可用 550 User has no permission
- exists和no exists
- EXISTS ,NO EXISTS 语句
- Laravel 出现 No application encryption key has been specified.
- Android屏幕密度dpi
- (错误记录)java.lang.UnsatisfiedLinkError
- Open Source china Client
- iOS 两个app之间的跳转
- Markdown 实现页面内部跳转
- JIRA Plugin: User 'admin' exists but has no unique key mapping
- 执行docker daemon命令时出错的解决方案
- Shell数组:shell数组的定义、数组长度
- 瀑布流的实现
- [LeetCode]039-Combination Sum
- nhnjp.ism
- spring+hessian
- iOS图片拉伸技巧
- 非table 布局 重叠边框合并方法