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

Space Export PDF Content Tree - IllegalArgumentException

Felix Grund (Scandio)
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.
April 21, 2014

On two different Confluence installations (one 5.1.5 and one 5.3.4) we're experiencing a very strange problem with Custom Space PDF Export: when you select "Custom Export" and the page tree is fetched with Ajax, an IllegalArgumentException is thrown and the following screen is shown:

The stack trace of the exception is this: stacktrace.txt

Interesting is this: when we delete the cache directories from the [confluence-data] directory (plugins-cache, osgi-cache, ...) the problem is solved temporarily. But after some time it reoccurs.

I started the system in debug mode and I actually digged my way into the XWork source code. The final piece of code is in DefaultActionInvocation.invokeAction:

private String invokeAction(Action action, ActionConfig actionConfig) throws Exception {
	// ...
	try {
		Method method = actionConfig.getMethod();

		if (action instanceof Proxy) {
			// ...
		} else {
			return (String) method.invoke(action, new Object[0]);
		}
	} catch (NoSuchMethodException e) {
	// ...
}

The method.invoke statement throws the exception. In here, I inspected a bit and got the following:

// IllegalArgumentException:
method.invoke(action, new Object[0]);
// "success"
action.getClass().getMethod("doContentTree").invoke(action)
// false
action.getClass().getMethod("doContentTree") == method

I'm guessing that something is wrong with the cached doContentTree method in the actions ActionConfig. We're also wondering why an empty Object array is passed as second argument to method.invoke, and why the argument is not left empty.

The docs of Method.invoke say that an IllegalArgumentException is thrown in the following cases:

* @exception IllegalArgumentException  if the method is an
 *              instance method and the specified object argument
 *              is not an instance of the class or interface
 *              declaring the underlying method (or of a subclass
 *              or implementor thereof); if the number of actual
 *              and formal parameters differ; if an unwrapping
 *              conversion for primitive arguments fails; or if,
 *              after possible unwrapping, a parameter value
 *              cannot be converted to the corresponding formal
 *              parameter type by a method invocation conversion.

Any help appreciated!

3 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Panos
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.
September 20, 2017

3years later, i stumbled in this issue. Confluence 5.8.8, flying-pdf plugin version 3.3.4.

I fixed it but duplicating the functionality but through rest. Nothing fancy, just works.

Can find plugin here: https://github.com/chmod/pdffix

0 votes
Andreas van Rienen (Scandio) May 14, 2014

Please note that there exists a JIRA issue covering this bug: CONF-33659: Exporting space content via Custom Pdf Export results in IllegalArgumentException

0 votes
Felix Grund (Scandio)
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.
May 5, 2014

No ideas? I'm sure there must be some developers out there who faced a similar problem :(

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events