本文介绍了Android的 - 的Java解析HL7消息与高致病性禽流感V 2.2与DefaultHapiContext的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图解析HL7消息时出现此错误。我不知道为什么,以及如何解决它。我使用的是高致病性禽流感V2.2。所以,请帮助我。提前致谢!。下面是目录下载!
I get this error when trying to parsing a HL7 message. I dont know why and how to fix it. I'm using hapi v2.2 . SO please help me. Thanks in advance!. Here is catlog!!!
08-28 15:03:28.552: E/dalvikvm(642): Could not find class 'ca.uhn.hl7v2.DefaultHapiContext', referenced from method com.example.hl7demo.MainActivity.onCreate
08-28 15:03:28.673: E/AndroidRuntime(642): java.lang.NoClassDefFoundError: ca.uhn.hl7v2.DefaultHapiContext
08-28 15:03:28.673: E/AndroidRuntime(642): at com.example.hl7demo.MainActivity.onCreate(MainActivity.java:38)
在本教程基地的
推荐答案
看来你忘了哈皮库添加到您的构建。如果你使用maven你只需要添加相应的Maven依赖如下 http://hl7api.sourceforge.net/描述using_maven.html
It seems you forgot to add Hapi library to your build. If you using maven you just need to add appropriate maven dependencies as described here http://hl7api.sourceforge.net/using_maven.html
<!-- This is the core HAPI library -->
<dependency>
<groupId>ca.uhn.hapi</groupId>
<artifactId>hapi-base</artifactId>
<version>${hapi.version.stable}</version>
</dependency>
<!-- This is the structure JAR for HL7 v2.1 -->
<dependency>
<groupId>ca.uhn.hapi</groupId>
<artifactId>hapi-structures-v21</artifactId>
<version>${hapi.version.stable}</version>
</dependency>
<!--
If you want to use log4j for logging (recommended), you should include
it, as well as the slf4j adaptor
-->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>${log4j.version}</version>
</dependency>
<!--
Also add hapi-structures-v22, v23, etc. depending on which versions
of HL7 you need to create or parse
-->
<dependency>
<groupId>ca.uhn.hapi</groupId>
<artifactId>hapi-structures-v22</artifactId>
<version>${hapi.version.stable}</version>
</dependency>
<dependency>
<groupId>ca.uhn.hapi</groupId>
<artifactId>hapi-structures-v23</artifactId>
<version>${hapi.version.stable}</version>
</dependency>
<dependency>
<groupId>ca.uhn.hapi</groupId>
<artifactId>hapi-structures-v231</artifactId>
<version>${hapi.version.stable}</version>
</dependency>
<dependency>
<groupId>ca.uhn.hapi</groupId>
<artifactId>hapi-structures-v24</artifactId>
<version>${hapi.version.stable}</version>
</dependency>
<dependency>
<groupId>ca.uhn.hapi</groupId>
<artifactId>hapi-structures-v25</artifactId>
<version>${hapi.version.stable}</version>
</dependency>
<dependency>
<groupId>ca.uhn.hapi</groupId>
<artifactId>hapi-structures-v251</artifactId>
<version>${hapi.version.stable}</version>
</dependency>
<dependency>
<groupId>ca.uhn.hapi</groupId>
<artifactId>hapi-structures-v26</artifactId>
<version>${hapi.version.stable}</version>
</dependency>
这篇关于Android的 - 的Java解析HL7消息与高致病性禽流感V 2.2与DefaultHapiContext的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!