I try using h2gis in an automatic test with spring and hibernate. With the new version of h2gis 2.0.0, I encoutered the following error at start of this junit-test with spring-data-jpa-test (extract):
Caused by: java.lang.IllegalArgumentException: LoggerFactory is not a Logback LoggerContext but Logback is on the classpath. Either remove Logback or the competing implementation (class org.slf4j.impl.SimpleLoggerFactory loaded from file:/C:/devsbb/eaio/m2/org/slf4j/slf4j-simple/1.7.32/slf4j-simple-1.7.32.jar). If you are using WebLogic you will need to add 'org.slf4j' to prefer-application-packages in WEB-INF/weblogic.xml: org.slf4j.impl.SimpleLoggerFactory
Clearly the maven dependency slf4j-simple in h2gis is annoying spring, which choose logback for logging. In my project, when referencing h2gis in maven, I had to exclude slf4j-simple, and then everything works fine. I suggest you only reference slf4j-api. You could reference slf4j-simple with scope test.
I try using h2gis in an automatic test with spring and hibernate. With the new version of h2gis 2.0.0, I encoutered the following error at start of this junit-test with spring-data-jpa-test (extract): Caused by: java.lang.IllegalArgumentException: LoggerFactory is not a Logback LoggerContext but Logback is on the classpath. Either remove Logback or the competing implementation (class org.slf4j.impl.SimpleLoggerFactory loaded from file:/C:/devsbb/eaio/m2/org/slf4j/slf4j-simple/1.7.32/slf4j-simple-1.7.32.jar). If you are using WebLogic you will need to add 'org.slf4j' to prefer-application-packages in WEB-INF/weblogic.xml: org.slf4j.impl.SimpleLoggerFactory
Clearly the maven dependency
slf4j-simple
in h2gis is annoying spring, which choose logback for logging. In my project, when referencingh2gis
in maven, I had to excludeslf4j-simple
, and then everything works fine. I suggest you only referenceslf4j-api
. You could referenceslf4j-simple
with scopetest
.