jboss下slf4j报错解决方案

常茂
2023-12-01

jboss5下报如下错误

ERROR [STDERR] SLF4J: Class path contains multiple SLF4J bindings.
ERROR [STDERR] SLF4J: Found binding in [vfszip:/home/ihrytsyuk/work/ml/jboss/common/lib/slf4j-jboss-logging.jar/org/slf4j/impl/StaticLoggerBinder.class]
ERROR [STDERR] SLF4J: Found binding in [vfszip:/home/ihrytsyuk/work/ml-dev/out/exploded/eee.ear/lib/slf4j-log4j12-1.6.1.jar/org/slf4j/impl/StaticLoggerBinder.class] 
ERROR [STDERR] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.



解决:jboss\server\default\deployers\jbossweb.deployer\META-INF\war-deployers-jboss-beans.xml  添加org.slf4j,以过滤该包(根据自己的jboss安装路径)

 <!-- Allow for war local class loaders: in testing -->
   <bean name="WarClassLoaderDeployer" class="org.jboss.web.tomcat.service.deployers.WarClassLoaderDeployer">
      <property name="relativeOrder">-1</property>
	  <property name="filteredPackages">javax.servlet,org.apache.commons.logging,org.slf4j</property>       
   </bean>


 类似资料: