Deployment on Tomcat: Constraint violation when resolving method “org.slf4j.impl.StaticLoggerBinder.getLoggerFactory()Lorg/slf4j/ILoggerFactory;”

前端 未结 4 1436
醉梦人生
醉梦人生 2021-02-10 10:46

I\'m deploying Shibboleth IdP 3.1.1 on Tomcat 8.0.22, but I receive this error:

SEVERE [http-nio-8080-exec-13] org.apache.catalina.core.StandardContext.listenerS         


        
4条回答
  •  滥情空心
    2021-02-10 11:16

    This problem may be because there is a jar in the servlet container (Ex Tomcat).

    For example:

    • someone had kept some lib (In this case slf4j) in a tomcat's lib.
    • you deployed a new project to that tomcat.
    • In your new project, some of your dependencies have dependencies to that lib.
    • Then there is duplicated of the same jar in Tomcat and WAR of your new project

    Then you get such an error message.

    The way to solve this is just use "scope" to say that it is provided.

            
                org.slf4j
                slf4j-api
                1.7.6
                provided
            
    

    By doing this, the WAR file will not include that dependency.

提交回复
热议问题