Tomcat log shows that it has one more slf4j-1.7.7.jar in the classpath:
Using CLASSPATH: /usr/local/Cellar/tomcat/8.0.18/libexec/bin/jul-to-slf4j-1.7.7.jar: /usr/local/Cellar/tomcat/8.0.18/libexec/bin/slf4j -api-1.7.7.jar : /usr/local/Cellar/tomcat/8.0.18/libexec/bin/logback-classic-1.1.2.jar: /usr/local/Cellar/tomcat/8.0.18/libexec /bin/logback-core-1.1.2.jar:/usr/local/Cellar/tomcat/8.0.18/libexec/bin/logback-config/:/usr/local/ Basement/cat/8.0.18/libexec/ bin / bootstrap.jar: /usr/local/Cellar/tomcat/8.0.18/libexec/bin/tomcat-juli.jar
When Tomcat was initialized, it initializes jul-to-slf4j and slf4j-api. These banks are loaded by the Classloader loader, which loads the Tomcat banks (sun / misc / Launcher $ AppClassLoader).
When your application tries to access the slf4j-api classes, it uses the WebApplication class loader (org / apache / catalina / loader / WebappClassLoader), which by default looks for the class definition in the application class path to the system class path. Please note that this can be changed: https://tomcat.apache.org/tomcat-8.0-doc/class-loader-howto.html
In Java, a class signature consists of the fully qualified class name and class loader loading the class. If a class is loaded twice from two different class loaders (same hierarchy), there will be two different classes for the JVM. Trying to specify a reference to an object of one class on a variable of another, there will be a trhow exception ClassCastException. Check this blog post (item 5) for more information on this: https://techblug.wordpress.com/2012/03/17/classloader-tips/
So, as far as I know, you can fix this by removing slf4j - *. jar from the Tomcat path, or if you have more than one webapp using the same version of slf4j, you can remove the jars from webapp, so it will use the ones loaded by the Tomcat class loader.
source share