Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#30 NPE In RealTimeStockMonitor

open
yccheok
engine (25)
9
2009-06-09
2009-06-09
yccheok
No

[yancheng@yancheng jstock]$ ./jstock.sh
Warning: /bin/java does not exist
Exception in thread "Thread-5" java.lang.NullPointerException
at org.yccheok.jstock.engine.YahooStockServer.getStocksByCodes(YahooStockServer.java:336)
at org.yccheok.jstock.engine.RealTimeStockMonitor$StockMonitor.run(RealTimeStockMonitor.java:289)

NPE in RealTimeStockMonitor.

As a consequence, one of the thread within the thread pool will dead. No one will go n update a portion of stocks. Shall we consider to restart thread, which dead because of unexpected Exception? However, the real solution to this problem is, find out the root cause of NPE. Restarting dead thread is secondary solution, or just complement.

Discussion

  • yccheok
    yccheok
    2009-06-09

    Happen in 1.0.4d

     
  • yccheok
    yccheok
    2009-06-23

    partial fixed at 1.0.4e

     
  • yccheok
    yccheok
    2009-08-18

    Additional note : partial fixed at 1.0.4e means, even the exception might happen, but we will still able to handle the exception gracefully. JStock will just resume its execution without any interruption.