java.lang.NullPointerException

AppFuse JIRA | Matt Raible | 1 decade ago
  1. 0

    This problem occurs only on linux. When run on 1.5 and winXP, everything works fine. When application that utilized struts-menu 2.3 is under load that is simulated be openload, struts-menu crashes one thread after another untill the whole app dies. Here is the exception that is thrown: java.lang.NullPointerException at net.sf.navigator.taglib.DisplayMenuTag.setLocation(DisplayMenuTag.java:217) at net.sf.navigator.taglib.DisplayMenuTag.setPageLocation(DisplayMenuTag.java:173) at net.sf.navigator.taglib.DisplayMenuTag.setPageLocation(DisplayMenuTag.java:205) at net.sf.navigator.taglib.DisplayMenuTag.doStartTag(DisplayMenuTag.java:123) According to the stacktrace the exception is thrown DisplayMenuTag.java:217: protected void setLocation(MenuComponent menu) throws MalformedURLException { 211 HttpServletRequest request = 212 (HttpServletRequest) pageContext.getRequest(); 213 214 // if the location attribute is null, 215 // then set it with a context relative page 216 // attribute if it exists 217 if (menu.getLocation() == null) { ---> here is the exception. ...................... ..................... . Looking through the code revealed that menus are reinitialized on every request (should it be static and cached??) and it uses ArrayList to hold the submenu elements, see MenuComponent. Once I substituted ArrayList to Vector, the problem was gone. 29 //~ Instance fields ======================================================== 30 31 protected List menuComponents = new ArrayList(); ---> ArrayList for some reason created problems 32 protected MenuComponent parentMenu = null; 33

    AppFuse JIRA | 1 decade ago | Alexey Krasnoriadtsev
    java.lang.NullPointerException
  2. Speed up your debug routine!

    Automated exception search integrated into your IDE

  3. 0

    This problem occurs only on linux. When run on 1.5 and winXP, everything works fine. When application that utilized struts-menu 2.3 is under load that is simulated be openload, struts-menu crashes one thread after another untill the whole app dies. Here is the exception that is thrown: java.lang.NullPointerException at net.sf.navigator.taglib.DisplayMenuTag.setLocation(DisplayMenuTag.java:217) at net.sf.navigator.taglib.DisplayMenuTag.setPageLocation(DisplayMenuTag.java:173) at net.sf.navigator.taglib.DisplayMenuTag.setPageLocation(DisplayMenuTag.java:205) at net.sf.navigator.taglib.DisplayMenuTag.doStartTag(DisplayMenuTag.java:123) According to the stacktrace the exception is thrown DisplayMenuTag.java:217: protected void setLocation(MenuComponent menu) throws MalformedURLException { 211 HttpServletRequest request = 212 (HttpServletRequest) pageContext.getRequest(); 213 214 // if the location attribute is null, 215 // then set it with a context relative page 216 // attribute if it exists 217 if (menu.getLocation() == null) { ---> here is the exception. ...................... ..................... . Looking through the code revealed that menus are reinitialized on every request (should it be static and cached??) and it uses ArrayList to hold the submenu elements, see MenuComponent. Once I substituted ArrayList to Vector, the problem was gone. 29 //~ Instance fields ======================================================== 30 31 protected List menuComponents = new ArrayList(); ---> ArrayList for some reason created problems 32 protected MenuComponent parentMenu = null; 33

    AppFuse JIRA | 1 decade ago | Alexey Krasnoriadtsev
    java.lang.NullPointerException
  4. 0

    Android: Saving Map State in Google map

    Stack Overflow | 11 months ago | Junie Negentien
    java.lang.RuntimeException: Unable to resume activity {com.ourThesis.junieNegentien2015/com.ourThesis.junieNegentien2015.MainActivity}: java.lang.NullPointerException

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.NullPointerException

      No message provided

      at net.sf.navigator.taglib.DisplayMenuTag.setLocation()
    2. net.sf.navigator
      DisplayMenuTag.doStartTag
      1. net.sf.navigator.taglib.DisplayMenuTag.setLocation(DisplayMenuTag.java:176)
      2. net.sf.navigator.taglib.DisplayMenuTag.setPageLocation(DisplayMenuTag.java:140)
      3. net.sf.navigator.taglib.DisplayMenuTag.setPageLocation(DisplayMenuTag.java:168)
      4. net.sf.navigator.taglib.DisplayMenuTag.doStartTag(DisplayMenuTag.java:92)
      4 frames
    3. _jsp
      _index__jsp._jspService
      1. _jsp._index__jsp._jspService(index.jsp:26)
      1 frame
    4. com.caucho.jsp
      Page.pageservice
      1. com.caucho.jsp.JavaPage.service(JavaPage.java:60)
      2. com.caucho.jsp.Page.pageservice(Page.java:570)
      2 frames
    5. com.caucho.server
      TcpConnection.run
      1. com.caucho.server.dispatch.PageFilterChain.doFilter(PageFilterChain.java:159)
      2. com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:163)
      3. com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:208)
      4. com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:259)
      5. com.caucho.server.port.TcpConnection.run(TcpConnection.java:363)
      5 frames
    6. com.caucho.util
      ThreadPool.run
      1. com.caucho.util.ThreadPool.runTasks(ThreadPool.java:490)
      2. com.caucho.util.ThreadPool.run(ThreadPool.java:423)
      2 frames
    7. Java RT
      Thread.run
      1. java.lang.Thread.run(Thread.java:595)
      1 frame