jboss5本身有引用slf4j包,如果项目也有引用此包,就会报:
15:28:09,222 ERROR [STDERR] SLF4J: Class path contains multiple SLF4J bindings.
15:28:09,222 ERROR [STDERR] SLF4J: Found binding in [vfszip:/home/ihrytsyuk/work/ml/jboss/common/lib/slf4j-jboss-logging.jar/org/slf4j/impl/StaticLoggerBinder.class]
15:28:09,222 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]
15:28:09,222 ERROR [STDERR] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
解决办法:
修改JBOSS_HOME/server/< servername>/deployers/jbossweb.deployer/META-INF/war-deployers-jboss-beans.xml,添加org.slf4j,以过滤该包:
<!-- 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>