• Post Reply Bookmark Topic Watch Topic
  • New Topic

occasional NullPointerException in InputStream (java.net.URL)

 
Mike Sever
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The below code works well, but occasionally, there is a NullPointerException after "logger.debug("after read:"+numRead);"(here can always print the number, for example, if normal response is "abc", it will return 3, but if exception, I can also get 3 in that line).
Any master helps to point out whether there is any potential exception in some line with relevant possible reason, thanks in advance!
(Is it possible to avoid it after using httpclient?)

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!