users@grizzly.java.net

FilterConfigImpl context is NULL.. why ?

From: Survivant 00 <survivant00_at_gmail.com>
Date: Sun, 8 Feb 2009 08:41:45 -0500

I'm stuck with a NullPointerException when I try to start Hudson with
GrizzlyWebServer. The npe is simple..

HudsonFilter.java

 public void init(FilterConfig filterConfig) throws ServletException {
        this.filterConfig = filterConfig;
        // this is how we make us available to the rest of Hudson.

filterConfig.getServletContext().setAttribute(HudsonFilter.class.getName(),this);
// CRASH HERE..
    }

I trace the code and
FilterConfigImpl.getServletContext()

return NULL.. why ?

here some screenshot in debug.


The FilterConfig method is that

 /**
     * Initialize the {_at_link Filter}
     * @throws javax.servlet.ServletException
     */
    protected void init() throws ServletException{
        for (FilterConfigImpl f: filters){
            f.getFilter().init(f); // LAST SCREENSHOT
        }
    }


the filter are declared like that

sa.addFilter(filter, filterType.getFilterName().getValue(), initParamsMap);


THe ServletAdapter like that

 Servlet servlet = (Servlet)
ClassLoaderUtil.load(servletType.getServletClass().getValue());
        sa.setServletInstance(servlet);

        List<ParamValueType> initParams = servletType.getInitParam();

        if (initParams != null) {
            for (Object element : initParams) {
                ParamValueType paramValueType = (ParamValueType) element;

sa.addInitParameter(paramValueType.getParamName().getValue(),
paramValueType.getParamValue().getValue());
            }
        }


sa.setContextPath("/");

ws.addGrizzlyAdapter(sa, new String[]{"/"});

need help for this one

thanks




Capture2008-11-06-14.29.232009-02-08-08.32.04.png
(image/png attachment: Capture2008-11-06-14.29.232009-02-08-08.32.04.png)

Capture2008-11-06-14.29.232009-02-08-08.32.13.png
(image/png attachment: Capture2008-11-06-14.29.232009-02-08-08.32.13.png)

Capture2008-11-06-14.29.232009-02-08-08.32.23.png
(image/png attachment: Capture2008-11-06-14.29.232009-02-08-08.32.23.png)

Capture2008-11-06-14.29.232009-02-08-08.32.30.png
(image/png attachment: Capture2008-11-06-14.29.232009-02-08-08.32.30.png)

Capture2008-11-06-14.29.232009-02-08-08.33.13.png
(image/png attachment: Capture2008-11-06-14.29.232009-02-08-08.33.13.png)