[Esapi-user] Get Exception in ESAPI.httpUtilities().sendRedirect()

Kevin W. Wall kevin.w.wall at gmail.com
Wed Aug 10 09:14:01 EDT 2011


On Wed, Aug 10, 2011 at 2:28 AM, ashish kumar gautam
<gautamashishkumar at gmail.com> wrote:
>
> Hi.
> i am using ESAPI.httpUtilities().sendRedirect() method for redirect. but i
> receive an exception like this
>
> log4j:WARN No appenders could be found for logger
> (DefaultName:IntrusionDetector).
> log4j:WARN Please initialize the log4j system properly.
> log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for
> more info.
> Second Level Exception:- java.io.IOException: Redirect failed
>
> my code is:-
> ESAPI.httpUtilities().sendRedirect("ExceptionHandler.jsp");
> what should i do.

Set a log4j.xml or log4x.properties file and specify a log4j "root"
appender in it.

For a quick test, you can start you JVM using

    -Dlog4j.configuration="file:path/to/log4j.xml"
or
    -Dlog4j.configuration="file:path/to/log4j.properties"

The XML format is preferred.

You can find an example of a minimalist log4j.xml file in
'src/test/resources/log4j.xml' or here if you don't have the
ESAPI source handy:
<http://code.google.com/p/owasp-esapi-java/source/browse/trunk/src/test/resources/log4j.xml>

The FAQ that referrenced in the URL given in the exception message will
provide you more details.

HTH,
-kevin


-- 
Blog: http://off-the-wall-security.blogspot.com/
"The most likely way for the world to be destroyed, most experts agree,
is by accident. That's where we come in; we're computer professionals.
We *cause* accidents."        -- Nathaniel Borenstein


More information about the Esapi-user mailing list