Hi all,

I am trying to send HL7 message over HTTP using this example
<http://hl7api.sourceforge.net/hapi-hl7overhttp/doc_hapi.html>. I have
changed the below line to Parser parser =
PipeParser.getInstanceWithNoValidation(); to
Parser parser = new GenericParser(); as I am working with HAPI 2.0.

I have added the below dependency also.

<dependency>
   <groupId>ca.uhn.hapi</groupId>
   <artifactId>hapi-hl7overhttp</artifactId>
   <version>2.2</version>
</dependency>


However at below line I am getting an error.

HohClientSimple client = new HohClientSimple(host, port, uri, parser);

Error is:

SLF4J: The requested version 1.6 by your slf4j binding is not compatible
with [1.5.5, 1.5.6]
SLF4J: See http://www.slf4j.org/codes.html#version_mismatch for further
details.
ERROR - LoggingAdvice.invoke(126) |2014-07-19 16:14:18,189| An error
occurred while executing this method. Error message: loader constraint
violation: when resolving method
"org.slf4j.impl.StaticLoggerBinder.getLoggerFactory()Lorg/slf4j/ILoggerFactory;"
the class loader (instance of org/openmrs/module/ModuleClassLoader) of the
current class, org/slf4j/LoggerFactory, and the class loader (instance of
org/apache/catalina/loader/WebappClassLoader) for resolved class,
org/slf4j/impl/StaticLoggerBinder, have different Class objects for the
type taticLoggerBinder.getLoggerFactory()Lorg/slf4j/ILoggerFactory; used in
the signature
java.lang.LinkageError: loader constraint violation: when resolving method
"org.slf4j.impl.StaticLoggerBinder.getLoggerFactory()Lorg/slf4j/ILoggerFactory;"
the class loader (instance of org/openmrs/module/ModuleClassLoader) of the
current class, org/slf4j/LoggerFactory, and the class loader (instance of
org/apache/catalina/loader/WebappClassLoader) for resolved class,
org/slf4j/impl/StaticLoggerBinder, have different Class objects for the
type taticLoggerBinder.getLoggerFactory()Lorg/slf4j/ILoggerFactory; used in
the signature
at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:240)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:208)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:221)
at
ca.uhn.hl7v2.hoh.raw.client.AbstractRawClient.<clinit>(AbstractRawClient.java:54)
at
ca.uhn.hl7v2.hoh.hapi.client.HohClientSimple.<init>(HohClientSimple.java:40)
at
org.openmrs.module.IHEInteroperability.SendMessageUtility.hl7OverHttp(SendMessageUtility.java:104)
at
org.openmrs.module.IHEInteroperability.api.impl.IHEInteroperabilityServiceImpl.afterReturning(IHEInteroperabilityServiceImpl.java:79)
at
org.springframework.aop.framework.adapter.AfterReturningAdviceInterceptor.invoke(AfterReturningAdviceInterceptor.java:51)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.openmrs.aop.LoggingAdvice.invoke(LoggingAdvice.java:122)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at
org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:50)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at
org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:50)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at sun.proxy.$Proxy213.savePatient(Unknown Source)
at
org.openmrs.web.controller.patient.ShortPatientFormController.saveShortPatient(ShortPatientFormController.java:239)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176)
at
org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:426)
at
org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:414)
at
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:790)
at
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
at
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
at
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:560)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
I tried adding exclusions but that didnt help,
<dependency>
    <groupId>ca.uhn.hapi</groupId>
    <artifactId>hapi-hl7overhttp</artifactId>
    <version>2.2</version>
    <exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
<exclusion>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</exclusion>
</exclusions>
</dependency>

Could someone guide me where I could probably be going wrong in using this
example?

Thanks & Regards
Sara Fatima
------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
Hl7api-devel mailing list
Hl7api-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hl7api-devel

Reply via email to