1. 程式人生 > >Exception in thread "main" java.lang.NoSuchMethodError: org.slf4j.spi.LocationAwareLogger.log

Exception in thread "main" java.lang.NoSuchMethodError: org.slf4j.spi.LocationAwareLogger.log

報錯資訊:Exception in thread "main" java.lang.NoSuchMethodError: org.slf4j.spi.LocationAwareLogger.log(Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String;[Ljava/lang/Object;Ljava/lang/Throwable;)V
    at org.apache.commons.logging.impl.SLF4JLocationAwareLog.debug(SLF4JLocationAwareLog.java:131)
    at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:110)
    at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:77)
    at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:394)
    at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:478)
    at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:488)
    at org.springframework.jdbc.core.JdbcTemplate.queryForList(JdbcTemplate.java:514)
    at com.zbz.common.utils.OperateJdbcTemplateUtils.queryForList(OperateJdbcTemplateUtils.java:47)
    at com.zbz.test.TestJdbcTemplate.main(TestJdbcTemplate.java:15)

解決: 刪除jcl-over-slf4j-1.7.25.jar包即可

以上,TKS.