Am getting the following when clicking on "configure" on a plugin:
java.lang.IllegalArgumentException: Method 'doDefault()' is not defined in action 'class csum.confluence.permissionmgmt.config.CustomPermissionConfigAction' at com.opensymphony.xwork.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:305) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:170) at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:35) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165) at com.atlassian.confluence.util.LoggingContextInterceptor.intercept(LoggingContextInterceptor.java:49)
The following is defined in the action class (and its superclass) and I've tried implementing Administrative and not implementing it (it is a problem with the plugin configuration action):
public String doDefault() throws Exception { ... }
Googling for this error, only 1-2 developers other than me have run into it, and the solutions previously mentioned don't seem to work (ensuring method is defined and Administrative interface, currently deprecated, is used).
Any ideas on what I could do to fix this?
Community moderators have prevented the ability to post new answers.
Thanks to Colin's note and a note from Don Brown of Atlassian, I figured this out. The issue in my case was that I thought that Atlassian Plugins v2 supported constructor injection for all classes, but it doesn't work for webwork actions, so the config action class was failing to be instantiated by webwork. After switching it back to setter injection for that action, it worked perfectly!
Note: Ulrich Kuhnhardt also noted this in CONF-15011.
Yeah that should be much better documented somewhere. Constructor injection should always be used where possible, but for xwork actions, no go :(
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That is interesting because I ran into a similar problem just the other way around. I always used setter injection for v2 plugins as learned from my colleagues. This worked fine until I implemented a Macro. For this only constructor injection works.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Grr, time lost remembering this again!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Also stung!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you Gary! I was ready to give up.
For me the constructor instantiation works if there is no method attribute. It stops to work whenever you add a method:
<action name="test" class="com.adaptavist.ces.action.ConfigAction" method="someMethod">
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Gary, check that the error is actually not caused by xwork not being able to instantiate the action.
I've run into this many times, specifically regarding Uli's comment on the issue below
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.