-
Bug
-
Resolution: Unresolved
-
Medium
-
None
-
3.1.1, 3.1.2
-
None
-
Severity 3 - Minor
-
1
-
I've got an own crowd plugin in the marketplace which uses freemarker templates in combination with xwork actions. Using multiple actions in one namespace is common and did work without any problems until 3.1. Now an exception like this is thrown:
2018-03-21 19:57:20,510 localhost-startStop-1 ERROR [atlassian.event.internal.AsynchronousAbleEventDispatcher] There was an exception thrown trying to disp atch event [com.atlassian.crowd.event.XWorkStateChangeEvent@7b20aba3] from the invoker [SingleParameterMethodListenerInvoker{method=public void com.atlassi an.crowd.event.listener.XWorkChangeListener.handleEvent(com.atlassian.crowd.event.XWorkStateChangeEvent), listener=com.atlassian.crowd.event.listener.XWork ChangeListener@18417937}] java.lang.RuntimeException: Multiple entries with same key: ActionKey{namespace=/console/secure/plugins/myplugin, name=null}=com.zenofx.crowd.myplugin and ActionKey{ namespace=/console/secure/plugins/myplugin, name=null}=com.zenofx.crowd.myplugin. Listener: com.atlassian.crowd.event.listener.XWorkChangeListener event: com.atlassi an.crowd.event.XWorkStateChangeEvent at com.atlassian.event.internal.SingleParameterMethodListenerInvoker.invoke(SingleParameterMethodListenerInvoker.java:55) at com.atlassian.event.internal.AsynchronousAbleEventDispatcher$1$1.run(AsynchronousAbleEventDispatcher.java:38) at com.google.common.util.concurrent.MoreExecutors$DirectExecutorService.execute(MoreExecutors.java:299) at com.atlassian.event.internal.AsynchronousAbleEventDispatcher.dispatch(AsynchronousAbleEventDispatcher.java:88)
My atlassian-plugin.xml basically looks like this:
<xwork name="My Action" key="my.action"> <package name="mypackage" extends="default" namespace="/console/secure/plugins/mynamespace"> <default-interceptor-ref name="defaultStack"/> <action name="default" class="com.zenofx.crowd.MyAction"> <result name="success" type="freemarker">/templates/my.ftl</result> </action> <action name="upload" method="upload" class="com.zenofx.crowd.MyAction"> <result name="success" type="freemarker">/templates/my.ftl</result> </action> ... </package> </xwork>
The explanation from https://community.developer.atlassian.com/t/java-lang-illegalargumentexception-multiple-entries-with-same-key-actionkey-namespace-console-secure-plugins-crowd-sso-name-null/14877/3 seems very likely, the "name" parameter is ignored and always set to "null".
A possible workaround of course is to use different namespaces for each action, but this very much against xwork style and difficult to maintain.