Menu

#118 Invalid id_file causes hard to debug exception

closed-fixed
nobody
None
5
2011-05-23
2011-05-23
Anonymous
No

Something happened to one of my servers which caused the id_file to be blanked out. This caused an exception when simply creating a new ACK message as a new ID couldn't be found.

java.lang.NumberFormatException: For input string: ""
java.lang.NumberFormatException.forInputString(Unknown Source)
java.lang.Long.parseLong(Unknown Source)
java.lang.Long.parseLong(Unknown Source)
ca.uhn.hl7v2.util.MessageIDGenerator.(MessageIDGenerator.java:55)
ca.uhn.hl7v2.util.MessageIDGenerator.getInstance(MessageIDGenerator.java:71)
ca.uhn.hl7v2.app.DefaultApplication.fillResponseHeader(DefaultApplication.java:188)
ca.uhn.hl7v2.app.DefaultApplication.makeACK(DefaultApplication.java:156)

To fix, i suggest such an error be handled the same as if no file existed... Change MessageIDGenerator, line 55 from
id = Long.parseLong(idStrTrim);
To
try { id = Long.parseLong(idStrTrim); } catch (NumberFormatException X) { id = 0; }

Discussion

  • James Agnew

    James Agnew - 2011-05-23
    • status: open --> closed-fixed
     
  • James Agnew

    James Agnew - 2011-05-23

    Thanks for the suggestion, it has been incorporated!

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.