At least one JAR was scanned for TLDs yet contained no TLDs.&Multiple bindings were found

At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.

出现这个错误之后,仔细看看web容器如tomcat启动时候的启动信息。其中有两条信息如下:

SLF4J: Found binding in [jar:file:/C:/Users/Administrator/AppData/Local/Genuitec/MyEclipse-8.6/configuration/org.eclipse.osgi/bundles/89/1/.cp/myeclipse-data/3.3/lib/required/slf4j-log4j12-1.5.8.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/D:/Workspace/Hibernate/WebRoot/WEB-INF/lib/slf4j-log4j12-1.5.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]


查看slf4j官方文档发现有一段讲述了解决办法:

Multiple bindings were found on the class path


SLF4J API is desinged to bind with one and only one underlying logging framework at a time. If more than one binding is present on the class path, SLF4J will emit a warning, listing the location of those bindings.
When multiple bindings are available on the class path, select one and only one binding you wish to use, and remove the other bindings. For example, if you have both slf4j-simple-1.7.5.jar and slf4j-nop-1.7.5.jar on the class path and you wish to use the nop (no-operation) binding, then remove slf4j-simple-1.7.5.jar from the class path.
The list of locations that SLF4J provides in this warning usually provides sufficient information to identify the dependency transitively pulling in an unwanted SLF4J binding into your project. In your project's pom.xml file, exclude this SLF4J binding when declaring the unscrupulous dependency. For example, cassandra-all version 0.8.1 declares both log4j and slf4j-log4j12 as compile-time dependencies. Thus, when you include cassandra-all as a dependency in your project, the cassandra-all declaration will cause both slf4j-log4j12.jar and log4j.jar to be pulled in as dependencies. In case you do not wish to use log4j as the the SLF4J backend, you can instruct Maven to exclude these two artifacts as shown next:

从上面看,应该是重复引用了slf4j的jar包,去lib下查看发现果然多了2个slf4j-xx-xx.jar,将其删除,问题就解决了。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值