0

I am getting this stack trace while clicking on import button on web-page, It is working fine on live server but not on localhost in Java, Is it any configuration issue in localhost?

 Dec 21, 2015 12:46:32 PM org.apache.catalina.core.StandardWrapperValve
 invoke SEVERE: Servlet.service() for servlet [action] in context with
 path [/tools/wse/wmi] threw exception java.lang.NullPointerException
    at
 org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:441)
    at
 org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:320)
    at
 org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
    at
 org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
    at
 org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)     at
 javax.servlet.http.HttpServlet.service(HttpServlet.java:728)   at
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
    at
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at
 org.apache.tapestry5.TapestryFilter.doFilter(TapestryFilter.java:151)
    at
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    at
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at
 tools.wse.model.conf.AuthenticationFilter.doFilter(AuthenticationFilter.java:192)

Here is code:

public void doFilter(
    ServletRequest req,
    ServletResponse resp,
    FilterChain chain)
    throws ServletException, IOException {

    HttpServletRequest request = (HttpServletRequest) req;
    HttpServletResponse response = (HttpServletResponse) resp;
    request.setAttribute(TapestryFilter.REGISTRY_CONTEXT_NAME, servletContext.getAttribute(TapestryFilter.REGISTRY_CONTEXT_NAME));
    //for multi-charset support
    request.setCharacterEncoding("utf-8");

    UserToken userToken = (UserToken) request.getSession().getAttribute(WebKeys.USER_TOKEN);
    //check user authorization
    if (userToken == null || request.getParameter(LOGIN_TEST_BUTTON)!=null) {
     //not coming inside if block
     //code of if block
    }
    else {
        chain.doFilter(req, resp);//Error in this line 192
    ConnectionTracker.logUnclosedConnectionErrors(request.getPathInfo());
    }
}
Cœur
  • 37,241
  • 25
  • 195
  • 267

1 Answers1

0

Sometimes I also get this kind of strange errors while in development. Please try to avoid as much as possible to use "localhost" but rather "127.0.0.1". Hope it solves your problem.

Tiberiu
  • 508
  • 7
  • 17