cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robby Pelssers <Robby.Pelss...@nxp.com>
Subject RE: REST view and weird error
Date Tue, 26 Feb 2013 14:24:09 GMT
Nice tip... [common-collection's MapUtils]

I was about to write my own routine to do a verbose print. You saved me a lot of work :)

Cheers,
Robby

-----Original Message-----
From: Francesco Chicchiriccò [mailto:ilgrosso@apache.org] 
Sent: Tuesday, February 26, 2013 3:22 PM
To: dev@cocoon.apache.org
Subject: Re: REST view and weird error

On 26/02/2013 13:43, Thorsten Scherler wrote:
> On 02/25/2013 02:10 PM, Thorsten Scherler wrote:
>> ...
>> Passing pipeline parameter as attribute: key=cocoon, value=[FAILED 
>> toString()]
>>
>> in MessageFormatter.arrayFormat.
>>
>> still investigating
>>
>> salu2
>>
> Actually you can see it if you start the cocoon-sample block and 
> request
> http://localhost:8888/controller/abc/foo?reqparam=1
>
>
> SLF4J: Failed toString() invocation on an object of type 
> [java.util.HashMap] java.lang.StackOverflowError
>      at
> java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:631)
>      at java.lang.StringBuilder.append(StringBuilder.java:224)
>      at
> org.apache.cocoon.configuration.MutableSettings.toString(MutableSettings.java:312)
>      at java.lang.String.valueOf(String.java:2902)
>
> It actually happens in STRenderer
> [...]

Hi Thorsten,
as you have already found, the problem is the "cocoon" entry in the sitemap's ObjectModel,
always passed among parameters.

I have been able to actually print the content of the "cocoon" entry via common-collection's
MapUtils:

                 if (entry.getValue() instanceof Map) {
                     MapUtils.verbosePrint(System.out, null, parameters);
                 } else {
                     System.out.println(entry.getValue());
                 }

I am about to commit a fix for the issue in STRenderer you've reported above based on the
usage of MapUtils#verbosePrint()

Regards.

--
Francesco Chicchiriccò

ASF Member, Apache Syncope PMC chair, Apache Cocoon PMC Member http://people.apache.org/~ilgrosso/




Mime
View raw message