java.lang.NullPointerException

AppFuse JIRA | Matt Raible | 1 decade ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  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

    Getting a nullpointer exception when switching displayables in J2ME

    Stack Overflow | 6 years ago | Pallinder
    java.lang.NullPointerException: 0 at javax.microedition.lcdui.Display$ChameleonTunnel.callScreenListener(), bci=46 at com.sun.midp.chameleon.layers.SoftButtonLayer.processCommand(), bci=74 at com.sun.midp.chameleon.layers.SoftButtonLayer.soft1(), bci=37 at com.sun.midp.chameleon.layers.SoftButtonLayer.keyInput(), bci=36 at com.sun.midp.chameleon.CWindow.keyInput(), bci=38 at javax.microedition.lcdui.Display$DisplayEventConsumerImpl.handleKeyEvent(), bci=17 at com.sun.midp.lcdui.DisplayEventListener.process(), bci=277 at com.sun.midp.events.EventQueue.run(), bci=179

    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