Hibernate, Spring and SLF4J Binding

前端 未结 5 1812
囚心锁ツ
囚心锁ツ 2020-12-30 08:28

I\'m trying to setup a webapp with maven2 managed dependcies. Here my pom.xml



        
5条回答
  •  执笔经年
    2020-12-30 09:22

    This should indeed work, the slf4j-log4j12 binding contains org/slf4j/impl/StaticLoggerBinder.

    1. Try to clean and redeploy your application, maybe something went wrong during deployment.
    2. Double check that the downloaded slf4j-log4j12-1.5.8.jar is not corrupted (try to open it).
    3. Maybe even delete it and let maven re-download it.

    Some unrelated remarks:

    • Instead of repeating frameworks version in dependencies, you should use a property. For example:

      ...
      
        3.0.2.RELEASE
        ...
      
      
        
          org.springframework
          spring-core
          ${spring.version}
        
        ...
      
      
    • hibernate-core is a transitive dependency of hibernate-annotations, you don't need to declare it (if you want to use JPA, you should actually depend on hibernate-entitymanager).

提交回复
热议问题