Hi,

I use the equanda/Tabs in my web application. It actually works pretty well 
except it throws NPE in unit testing:

ERROR] TapestryModule.RequestExceptionHandler Processing of request failed with 
uncaught exception: java.lang.NullPointerException
java.lang.NullPointerException
    at 
org.equanda.tapestry5.services.EquandaModule$1.service(EquandaModule.java:83)

Here is the code from EquandaModule.java that fails:

public static RequestFilter buildUtf8Filter(
        @InjectService( "RequestGlobals" ) final RequestGlobals requestGlobals )
    {
        return new RequestFilter()
        {
            public boolean service( Request request, Response response, 
RequestHandler handler )
                throws IOException
            {
                requestGlobals.getHTTPServletRequest().setCharacterEncoding( 
"UTF-8" );  // <---------------------- NPE on this line due to null 
HttpServletRequest
                return handler.service( request, response );
            }
        };
    }

Anyone has any idea how to get around this in unit testing?

Thanks in advance!

-D

Reply via email to