cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nathaniel, Alfred" <>
Subject RE: REST view and weird error
Date Fri, 22 Feb 2013 14:07:01 GMT
Wild guess:  somewhere you add the map to itself

   map.put("map", map);

creating an infinite recursion in map.toString().

HTH, Alfred.

-----Original Message-----
From: Robby Pelssers [] 
Sent: Freitag, 22. Februar 2013 11:54
Subject: RE: REST view and weird error

Hi Thorsten,

Just one question.

I'm a making a few assumptions here but is Settings not a HashMap already? Can't you just

    public RestResponse doGet() throws Exception {
        return new URLResponse(VIEW, getProps());

I don't see the point in putting a hashmap in another hashmap just for the sake of it ;-)


-----Original Message-----
From: Thorsten Scherler [] 
Sent: Friday, February 22, 2013 10:13 AM
Subject: REST view and weird error

Hi all,

in one view of a REST service of mine I get:

SLF4J: Failed toString() invocation on an object of type [java.util.HashMap] java.lang.StackOverflowError
    at java.lang.StringBuilder.append(
    at java.lang.String.valueOf(
    at java.lang.StringBuilder.append(
    at java.util.AbstractMap.toString(
    at java.lang.String.valueOf(

where the last 3 lines will repeat a lot till the end.

I am doing:

    public RestResponse doGet() throws Exception {
        HashMap<String, Object> data = new HashMap<String, Object>();
        data.put("properties", getProps());
        return new URLResponse(VIEW, data);

where getProps() basically is a helper for getting this.settings.getProperties.

As soon I do return new URLResponse(VIEW) the error is gone.

I have the standard logging activated (via rcl-config), using jetty:run and no override for in my logback.xml

        <level value="WARN"/>
        <appender-ref ref="CORE"/>

Any ideas?


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

The content of this e-mail is intended only for the confidential use of the person addressed.

If you are not the intended recipient, please notify the sender and delete this email immediately.
Thank you.

View raw message