Menu

#216 Poor logging when unable to bind server port

2.3
closed-fixed
None
8
2014-12-15
2014-07-03
DiGiT
No

I am writing a HAPI application that opens up many (about 100) server ports and I have had some port clashes between my applications and others on the system. In this case, I get a log statement like this:

10:16:53.233 [hapi-worker-281] WARN  ca.uhn.hl7v2.concurrent.Service - Thread exiting main loop due to exception:
java.lang.RuntimeException: java.net.BindException: Address already in use: JVM_Bind
    at ca.uhn.hl7v2.app.AcceptorThread.afterStartup(AcceptorThread.java:106) ~[hapi-base-2.2.jar:na]
    at ca.uhn.hl7v2.concurrent.Service.run(Service.java:202) ~[hapi-base-2.2.jar:na]

It would be much better to include the failed port in log statement so I can easily track down which port of the 100 failed.

Patch attached, based on trunk r393. Hope it helps.

P.S.: I didn't notice a tag for HAPI v2.2, might be an oversight.

1 Attachments

Discussion

  • Christian Ohr

    Christian Ohr - 2014-12-15
    • Group: 2.2 --> 2.3
     
  • Christian Ohr

    Christian Ohr - 2014-12-15
    • status: open --> closed-fixed
    • assigned_to: Christian Ohr
     

Log in to post a comment.

MongoDB Logo MongoDB