JIRA Plugin: User 'admin' exists but has no unique key mapping
2015-12-29 14:26
417 查看
插件启动时报:
我的 atlassian-plugin.xml 代码:
网上的 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 这个账号的信息,然后报错。
试着修改了下:
[INFO] [talledLocalContainer] Exception in thread "ThreadPoolAsyncTaskExecutor::Thread 11" org.springframework.beans.factory.BeanCreationException: Er ror 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,通过!!!
相关文章推荐
- jira安装在 debian上
- 使用JIRA搭建企业问题跟踪系统-1
- 使用JIRA搭建企业问题跟踪系统2
- 使用JIRA搭建企业问题跟踪系统3
- JIRA升级后原有Issue时间显示错乱的问题
- 怎么利用jira的Issue style 的可定制性来进行需求和测试用例方面的管理与testLink集成
- JIRA的破解安装
- 严澜:创业公司如何实施敏捷开发
- Windows下安装Atlassian-Jira-6.0.4并破解汉化(只需2步,另附图解)
- jira安装破解等相关信息
- confluence+jira+mysql 破解记录
- jira工作流状态修改展示Screen弹出框
- JIRA安装破解汉化
- JIRA REST API FOR Excel VBA
- jira
- jira安装
- Confluence 插入一个文字链接
- Confluence 使用链接
- JIRA、Jira client和jqGrid实践
- JIRA rest api 403 forbidden