Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to fix "Method 'doDefault()' is not defined in action" in Confluence 3.5.5?

Gary Weaver
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 14, 2011

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?

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

6 votes
Answer accepted
Gary Weaver
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 29, 2011

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.

Colin Goudie
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 29, 2011

Yeah that should be much better documented somewhere. Constructor injection should always be used where possible, but for xwork actions, no go :(

Karola Schaeuble
Contributor
June 29, 2011

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.

Andy Brook [Plugin People]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 8, 2013

Grr, time lost remembering this again!

Brendan Patterson
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 13, 2014

Also stung!

Volodymyr Krupach
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 16, 2016

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">
2 votes
Colin Goudie
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 14, 2011

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

See - https://jira.atlassian.com/browse/CONF-15011

TAGS
AUG Leaders

Atlassian Community Events