Hi Sara,
This is probably a similar issue to the other one you had, where OpenMRS is
importing an older version of a libaray (in this case, slf4j). The easiest
fix here might be to remove the SLF4j and log4j dependencies from your pom
entirely (since they are being pulled already by OpenMRS) and add an
exclusion to the HAPI dependencies (each of them) along the line of
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
Another paste of "mvn dependency:tree" for the module you are currently
having issues with might be helpful..
Cheers,
James
On Thu, May 29, 2014 at 12:46 AM, Sara Fatima <sara.mirz...@gmail.com>
wrote:
> Hi all,
>
> I am trying to make this sample work (
> http://hl7api.sourceforge.net/xref/ca/uhn/hl7v2/examples/CreateAMessage.html
> )
>
> When I run this as an individual java file I get the correct results.
> However I need to use HAPI in my module and hence I am trying to write the
> createMessage method in my service layer.
>
> But I am getting the below error.
>
> Results :
>> Tests in error:
>>
>> shouldSetupContext(org.openmrs.module.hapiexample.api.HapiExampleServiceTest):
>> org.slf4j.spi.LocationAwareLogger.log(Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String;Ljava/lang/Throwable;)V
>> org.openmrs.module.hapiexample.api.HapiExampleServiceTest:
>> org.slf4j.spi.LocationAwareLogger.log(Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String;Ljava/lang/Throwable;)V
>
>
>
> *Contents of HapiExampleServiceTest.java file*
>
> package org.openmrs.module.hapiexample.api;
>> import static org.junit.Assert.*;
>> import org.junit.Test;
>> import org.openmrs.api.context.Context;
>> import org.openmrs.test.BaseModuleContextSensitiveTest;
>> /**
>> * Tests {@link ${HapiExampleService}}.
>> */
>> public class HapiExampleServiceTest extends
>> BaseModuleContextSensitiveTest {
>>
>> @Test
>> public void shouldSetupContext() {
>> assertNotNull(Context.getService(HapiExampleService.class));
>> }
>> }
>
>
>
> I have attached a copy of my pom.xml file as well.
>
> Could someone tell me what is that I am doing wrong.
>
> Thanks & Regards
> Sara
>
>
> ------------------------------------------------------------------------------
> Time is money. Stop wasting it! Get your web API in 5 minutes.
> www.restlet.com/download
> http://p.sf.net/sfu/restlet
> _______________________________________________
> Hl7api-devel mailing list
> Hl7api-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/hl7api-devel
>
>
------------------------------------------------------------------------------
Time is money. Stop wasting it! Get your web API in 5 minutes.
www.restlet.com/download
http://p.sf.net/sfu/restlet
_______________________________________________
Hl7api-devel mailing list
Hl7api-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hl7api-devel