• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

occasional NullPointerException in InputStream (java.net.URL)

 
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?)

 
reply
    Bookmark Topic Watch Topic
  • New Topic