Errors when compiling the simple lab entry module

Hello everyone,

I am getting errors when compiling the simplelabentry module Here is the output from maven after compiling


T E S T S

Running org.openmrs.module.simplelabentry.util.SimpleLabEntryUtilTest Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.443 sec Running org.openmrs.module.simplelabentry.SimpleLabEntryServiceTest log4j:WARN No appenders could be found for logger (org.springframework.test.context.junit4.SpringJUnit4ClassRunner). log4j:WARN Please initialize the log4j system properly. Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 17.982 sec <<< FAILURE!

Results :

Tests in error: shouldReturnLabConcepts(org.openmrs.module.simplelabentry.SimpleLabEntryServiceTest) shouldGenerateLabOrderReport(org.openmrs.module.simplelabentry.SimpleLabEntryServiceTest)

Tests run: 5, Failures: 0, Errors: 2, Skipped: 0

[main] INFO org.apache.maven.cli.event.ExecutionEventLogger - ------------------------------------------------------------------------ [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - Reactor Summary: [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - simplelabentry … SUCCESS [11.587s] [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - simplelabentry API … FAILURE [22.124s] [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - simplelabentry OMOD … SKIPPED [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - ------------------------------------------------------------------------ [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - BUILD FAILURE [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - ------------------------------------------------------------------------ [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - Total time: 34.410s [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - Finished at: Sun Sep 23 13:54:28 NPT 2018 [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - Final Memory: 16M/181M [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - ------------------------------------------------------------------------ [main] ERROR org.apache.maven.cli.MavenCli - Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.5:test (default-test) on project simplelabentry-api: There are te st failures. [main] ERROR org.apache.maven.cli.MavenCli - [main] ERROR org.apache.maven.cli.MavenCli - Please refer to F:\intern\openmrs-module-simplelabentry-master\api\target\surefire-reports for the individual test results. [main] ERROR org.apache.maven.cli.MavenCli - -> [Help 1] [main] ERROR org.apache.maven.cli.MavenCli - [main] ERROR org.apache.maven.cli.MavenCli - To see the full stack trace of the errors, re-run Maven with the -e switch. [main] ERROR org.apache.maven.cli.MavenCli - Re-run Maven using the -X switch to enable full debug logging. [main] ERROR org.apache.maven.cli.MavenCli - [main] ERROR org.apache.maven.cli.MavenCli - For more information about the errors and possible solutions, please read the following articles: [main] ERROR org.apache.maven.cli.MavenCli - [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException [main] ERROR org.apache.maven.cli.MavenCli - [main] ERROR org.apache.maven.cli.MavenCli - After correcting the problems, you can resume the build with the command [main] ERROR org.apache.maven.cli.MavenCli - mvn -rf :simplelabentry-api

I apologize if the information provided in not enough or well formatted, please reply and I will provide further details

Thank you in advance :slight_smile:

Hello @myheadbands, what steps did you take from start to arrive at that error?

1 Like

@myheadbands next time drop it at hastebin.com

1 Like

Sorry for the late reply, I just cloned the code, changed the test dependency to https://hastebin.com/ehacocimud.xml

from https://hastebin.com/titatukuqa.xml

and tried to compile it using

mvn package

and got that error.

Thank you for your reply.

@tendomart Yes sir ! I will do that from next time. Thank you for pointing me to the right direction

Whats your primary usecase for changing the dependency type from jar to pom?

I did it because the compiler gave me error as follows:

https://hastebin.com/bipuyozudi.cs

It could not find the test jar for the version and other version that I tried, so I looked at examples in some other modules and found that they used the pom in that place.

Sorry if this is stupid, please point me in the right direction, I a new to this platform and am wanting to learn.

Thank you for your time.

You may want to run a mvn clean install command, ensuring you’ve made no changes to you cloned project. More of that here .

Your life will be made alot more easier by using the OpenMRS SDK though. :slightly_smiling_face: Follow this link (detailed) or a more brief one here.

1 Like

I tried to run mvn clean install command in the cloned project but I got this output https://hastebin.com/fefejiqede.cs

Could you look into that and let me know what is wrong,

I figured that it might be due to it not being able to find the test jar, but that is just a noob guess.

Thank you for the help sir, I have been using openmrs sdk for managing the servers, have not figured out on the modules yet, your links are helpful ! :slight_smile:

@myheadbands though this is not what you have asked, what do you intend to use this module for?

1 Like

@myheadbands, also make sure you have proper internet connection for maven to download the required dependencies in order to compile.

1 Like

Hey there :slight_smile:

I am looking for an example for a lab module to understand how others have tackled the problem and I saw this, wanted to just test it out and see how it works. My main goal is to make a lab module to manage the lab reports for a hospital which has assigned me the task.

I tried compiling the very module and notices some test failures as well. But doing a

mvn clean install -Dmaven.test.skip=true

gave a cleaner compilation. You may want to do that as well and/or wire a ticket on jira to resolve this test failure if you are interested.

1 Like

I think these may be related to lack of proper or poor database configuration and set up since the module has a service layer piece of code.

1 Like