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