Mantis Bugtracker
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0001076 [Resin] major always 04-26-06 19:06 05-04-06 14:42
Reporter jdane View Status public  
Assigned To ferg
Priority normal Resolution fixed  
Status closed   Product Version 3.0.17
Summary 0001076: stack overflow when using spring NestedServletException
Description This is not really a resin bug so much as an unfortunate interaction between resin's servlet API implementation and the multipart/file upload handling provided by the spring framework. In fact, the problem is probably not restricted to just multipart form handling, but that was the context in which I ran into it.

Spring contains a NestedServletException, the purpose of which is summarized in the header of that class as:

/**
 * Subclass of ServletException that properly handles a root cause,
 * exposing the root cause just like NestedChecked/RuntimeException does.
 * Note that the plain ServletException doesn't expose its root cause at all,
 * neither in the exception message nor in printed stack traces!
 */

and it contains the following method:

    /**
     * Return the nested cause, or <code>null</code> if none.
     */
    public Throwable getCause() {
        // Even if you cannot set the cause of this exception other than through
        // the constructor, we check for the cause being "this" here, as the cause
        // could still be set to "this" via reflection: for example, by a remoting
        // deserializer like Hessian's.
        return (getRootCause() == this ? null : getRootCause());
    }

resin's ServletException (unlike tomcat's) calls getCause from its getRootCause, causing instant stack overflow if you try calling either on a NestedServletException.

I've reported this as a bug in the Spring Framework bug tracker, and I think the responsibility lies there. But I figured I'd also report the problem here. Perhaps someone might suggest a workaround, because at the moment I'm stumped.
Additional Information
Attached Files

- Relationships

- Notes
(0001099)
jdane
05-01-06 14:37

spring's JIRA has been updated with a claim (or so I read it) that this will be fixed in spring in the next versions.

http://opensource.atlassian.com/projects/spring/browse/SPR-1961 [^]
 

- Issue History
Date Modified Username Field Change
04-26-06 19:06 jdane New Issue
05-01-06 14:37 jdane Note Added: 0001099
05-04-06 14:42 ferg Assigned To  => ferg
05-04-06 14:42 ferg Status new => closed
05-04-06 14:42 ferg Resolution open => fixed
05-04-06 14:42 ferg Fixed in Version  => 3.0.19


Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
29 total queries executed.
26 unique queries executed.
Powered by Mantis Bugtracker