java.lang.NullPointerException

AppFuse JIRA | Alexey Krasnoriadtsev | 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. 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
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  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:217)
      2. net.sf.navigator.taglib.DisplayMenuTag.setPageLocation(DisplayMenuTag.java:173)
      3. net.sf.navigator.taglib.DisplayMenuTag.setPageLocation(DisplayMenuTag.java:205)
      4. net.sf.navigator.taglib.DisplayMenuTag.doStartTag(DisplayMenuTag.java:123)
      4 frames