orbisgis / h2gis

A spatial extension of the H2 database.
http://www.h2gis.org
GNU Lesser General Public License v3.0
208 stars 63 forks source link

spring does not start with h2gis 2.0.0 because of slf4j-simple #1261

Closed florianhof closed 2 years ago

florianhof commented 2 years ago

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.

ebocher commented 2 years ago

Thanks for the feedback. You are right. We will fix it.

ebocher commented 2 years ago

Fixed by @SPalominos #1265 We will publish a new release 2.0.1 asap