我正在使用 android 客户端(API 17)中的 HL7 消息并使用 Hapi 库生成和解析 HL7 消息。当我传输小字符串值时,该消息工作正常。但是我必须通过 Http 将图像发送到 HL7 服务器,为此我使用的是 HL7 版本 2.5 的 MDM_T02 消息。当我发送 HL7 消息并将图像转换为 Base64 字符串并插入到 OBX-5 字段中时,我在服务器端收到以下错误。
Jul 23, 2013 3:05:32 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [com.tcs.hl7server.MyServer] in context with path [/MyHL7Server] threw exception
java.lang.ArrayIndexOutOfBoundsException
at java.lang.System.arraycopy(Native Method)
at org.apache.tomcat.util.buf.ByteChunk.substract(ByteChunk.java:441)
at org.apache.catalina.connector.InputBuffer.read(InputBuffer.java:315)
at org.apache.catalina.connector.CoyoteInputStream.read(CoyoteInputStream.java:200)
at ca.uhn.hl7v2.hoh.encoder.AbstractHl7OverHttpDecoder.readBytesNonChunked(AbstractHl7OverHttpDecoder.java:370)
at ca.uhn.hl7v2.hoh.encoder.AbstractHl7OverHttpDecoder.doReadContentsFromInputStreamAndDecode(AbstractHl7OverHttpDecoder.java:191)
at ca.uhn.hl7v2.hoh.encoder.AbstractHl7OverHttpDecoder.readContentsFromInputStreamAndDecode(AbstractHl7OverHttpDecoder.java:421)
at ca.uhn.hl7v2.hoh.raw.server.HohRawServlet.doPost(HohRawServlet.java:68)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
我不明白为什么 thr ByteChunk.java 给出错误。
如果有人能对此有所了解,我们将不胜感激。谢谢。