Harmonize SLFJ library version

Hi,

the tests inside the project openmrs-distro-referenceapplication do not run locally at least in my working environment (Pick one of them, right click on it -> Runs as Junit). I receive
java.lang.NoSuchMethodError: org.slf4j.spi.LocationAwareLogger.log exception. By looking at the error in the Internet, it may be due to different versions of SLFJ library. I don’t know if it makes sense for us as well, but we have the version 1.6 in distro-referenceapplication and 1.5.6 in contrib-uitestframework. Eclipse consolle shows the following message 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.

Details on the error (it is the same regardless of the test, here it’s for AddDeleteLocationTest): classname=“org.openmrs.reference.AddDeleteLocationTest” time=“9.83”> java.lang.NoSuchMethodError: org.slf4j.spi.LocationAwareLogger.log(Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String; [Ljava/lang/Object;Ljava/lang/Throwable;)V tring;ILjava/lang/String;[Ljava/lang/Object;Ljava/lang/Throwable;)V

at org.apache.commons.logging.impl.SLF4JLocationAwareLog.debug(SLF4JLocationAwareLog.java:133) at org.apache.http.client.protocol.RequestAddCookies.process(RequestAddCookies.java:122) at org.apache.http.protocol.ImmutableHttpProcessor.process(ImmutableHttpProcessor.java:132) at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:182) at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88) at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110) at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184) at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:71) at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:55) at org.openqa.selenium.remote.internal.ApacheHttpClient.fallBackExecute(ApacheHttpClient.java:144) at org.openqa.selenium.remote.internal.ApacheHttpClient.execute(ApacheHttpClient.java:90) at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:142) at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.execute(NewProfileExtensionConnection.java:160) at org.openqa.selenium.firefox.FirefoxDriver$LazyCommandExecutor.execute(FirefoxDriver.java:380) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:644) at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:249) at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:131) at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:216) at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:211) at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:128) at org.openmrs.uitestframework.test.TestBase.setupFirefoxDriver(TestBase.java:282) at org.openmrs.uitestframework.test.TestBase.startWebDriver(TestBase.java:193) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27) at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55) at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55) at org.junit.rules.RunRules.evaluate(RunRules.java:20) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) at org.junit.runners.ParentRunner.run(ParentRunner.java:309) at org.junit.runners.Suite.runChild(Suite.java:127) at org.junit.runners.Suite.runChild(Suite.java:26) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) at org.junit.runners.ParentRunner.run(ParentRunner.java:309) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)

Hi @domenico,

1.6.0 version is what we currently have in openmrs-core. I think other openmrs dependencies should not introduce their own and just stick with the provided one.

Hi @teleivo, sorry for my really late delay. I agree with that, but I don’t know if I’m authorize to remove this dependency, maybe it is better to agree how to manage it with the development team, they can eventually save me some pains. Should I contact them? In the meanwhile, I have a workaround, I just exclud slf4j dependency from the pom of project uitestframework. Of course I have to not push this pom file into the master branch of the repository.