I'm attempting to build an HL7 Client using the Hapi Library.

Fortunately there are examples that show clearly what to do. See the
SendLotsOfMessages Example here:
https://hapifhir.github.io/hapi-hl7v2/xref/ca/uhn/hl7v2/examples/SendLotsOfMessages.html

Unfortunately when I run the code, a null pointer exception occurs:
java.lang.NullPointerException
at ca.uhn.hl7v2.app.Responder.processMessage(Responder.java:91)
at ca.uhn.hl7v2.app.Receiver$Grunt.run(Receiver.java:127)
at
java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)

Curiously this does not occur when the code provided in
SendAndReceiveAMessage example is used, where a server is set up and a
client sends.

Debugging through the code the problem line is where an ApplicationRouter
is addressed. When just a client is used, this is not instantiated with
setApplicationRouter but this setter is used when the client is created in
the SendAndReceiveAMessage example.

How can a client be made to function without a server?

Thanks
Ian
_______________________________________________
Hl7api-devel mailing list
Hl7api-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hl7api-devel

Reply via email to