To be more precise it happens when processing the map entry "cocoon".  So in 
this case there must be some circular reference.. finding that needle is a bit 
more difficult :(

Robby

-----Original Message-----
From: Thorsten Scherler [mailto:scher...@gmail.com] 
Sent: Tuesday, February 26, 2013 1:43 PM
To: dev@cocoon.apache.org
Subject: Re: REST view and weird error

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

public String render(final String template,
            final Map<String, Object> parameters)
            throws IOException {

        final ST stringTemplate = new ST(template, '$', '$');

        if (parameters == null || parameters.isEmpty()) {
            LOG.warn("There are not any parameters passed to the template.");
        } else {
            for (Map.Entry<String, Object> entry : parameters.entrySet()) {
                stringTemplate.add(entry.getKey().replace(".", "_"),
                        (entry.getValue() instanceof String)
                        ? StringEscapeUtils.escapeXml(
                        entry.getValue().toString())
                        : entry.getValue());

                LOG.debug("Passing pipeline parameter as attribute: key={}"
                        + ", value={}", entry.getKey(), entry.getValue());
            }
        }

        return stringTemplate.render();
    }

salu2

--
Thorsten Scherler <scherler.at.gmail.com> codeBusters S.L. - web based systems 
<consulting, training and solutions>

http://www.codebusters.es/



Reply via email to