-
1. Re: JBoss-5.1.0.GA Multiple SLF4J bindings
nikitad Oct 18, 2010 3:01 PM (in response to ihrytsyuk)Were you able to find a solution for this?
Thank you,
Nikita
-
2. Re: JBoss-5.1.0.GA Multiple SLF4J bindings
ihrytsyuk Oct 19, 2010 4:14 AM (in response to nikitad)Not yet.
-
3. Re: JBoss-5.1.0.GA Multiple SLF4J bindings
nikitad Oct 19, 2010 9:41 AM (in response to ihrytsyuk)It look like this issue has come up a few times already, but without any resolution other than to remove the slf4j jars from the app. See https://jira.jboss.org/browse/JBPAPP-3951.
-
4. Re: JBoss-5.1.0.GA Multiple SLF4J bindings
nikitad Oct 19, 2010 11:18 AM (in response to nikitad)This looks relevant: http://community.jboss.org/thread/156441
-
5. Re: JBoss-5.1.0.GA Multiple SLF4J bindings
dmlloyd Oct 20, 2010 9:21 PM (in response to nikitad)The only fix is to add a jboss-classloading.xml to exclude the slf4j bindings from the visible classpath of the application. I don't recall the correct formula off the top of my head, but I think the wiki contains this information.
-
6. Re: JBoss-5.1.0.GA Multiple SLF4J bindings
dmlloyd Oct 20, 2010 9:24 PM (in response to dmlloyd)Alternatively, you should be able to update the slf4j in the AS to a newer version without ill effect.
-
7. Re: JBoss-5.1.0.GA Multiple SLF4J bindings
nikitad Oct 20, 2010 9:42 PM (in response to dmlloyd)Hi David,
Thanks for the reply! The response from another JBoss developer on this thread suggests that it's not possible to exclude particular libraries using configuration. I've also read through the classloading docs on the wiki, but as far as I can tell, those configurations change the overall classloading strategy of the application, and I don't have that option.
If I update the slf4j jars in the AS, can I safely just replace the jboss impl with a different impl (to match the version of the slf4j api)?
Thank you,
Nikita
-
8. Re: JBoss-5.1.0.GA Multiple SLF4J bindings
jaikiran Oct 21, 2010 1:54 AM (in response to nikitad)Nikita D wrote:
Hi David,
Thanks for the reply! The response from another JBoss developer on this thread suggests that it's not possible to exclude particular libraries using configuration.
If it's a .war file, then try adding the package name (whatever it is for the slf4j library) to the filteredPackages attribute (which is a comma separated list) of WarClassLoaderDeployer in JBOSS_HOME/server/< servername>/deployers/jbossweb.deployer/META-INF/war-deployers-jboss-beans.xml file:
<!-- 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</property> </bean>
See if that works. -
9. Re: JBoss-5.1.0.GA Multiple SLF4J bindings
nikitad Oct 21, 2010 8:49 AM (in response to jaikiran)Thank you for the suggestion. I actually have an ear application, but I tried this anyway to see if it would work for the war inside my ear. Unfortunately, it didn't make any difference -- I still get the same "multiple SLF4J bindings" error.
This is the config I used:
<!-- 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><!-- 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>
Is there something similar that can be added in "ear-deployer-jboss-beans.xml"? Or something else I could try?
Thank you,
Nikita
-
10. Re: JBoss-5.1.0.GA Multiple SLF4J bindings
jaikiran Oct 21, 2010 9:01 AM (in response to nikitad)Nikita D wrote:
This is the config I used:
<!-- 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><!-- 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>
Try
<property name="filteredPackages">javax.servlet,org.apache.commons.logging,org.slf4j.impl</property>
I remember there was a bug in 5.1.0 where child package names were not taken into account by the filteredPackages attribute.
-
11. Re: JBoss-5.1.0.GA Multiple SLF4J bindings
nikitad Oct 21, 2010 9:19 AM (in response to jaikiran)I tried these 3 settings:
<property name="filteredPackages">javax.servlet,org.apache.commons.logging,org.slf4j.impl</property>
<property name="filteredPackages">javax.servlet,org.apache.commons.logging,org.slf4j.impl,org.slf4j.spi</property>
<property name="filteredPackages">javax.servlet,org.apache.commons.logging,org.slf4j,org.slf4j.impl,org.slf4j.spi</property>
<property name="filteredPackages">javax.servlet,org.apache.commons.logging,org.slf4j.impl,org.slf4j.spi</property>Unfortunately none of them seem to have any effect.
Thank you,
Nikita
-
12. Re: JBoss-5.1.0.GA Multiple SLF4J bindings
nikitad Oct 21, 2010 10:55 AM (in response to nikitad)Ivan, could you try these configurations for your app, in case there is something I'm screwing up?
However, one problem with this solution even if it works, is when there are multiple apps deployed to the same server and one of them wants to use the JBoss slf4j jars, while another one has its own.
Thank you,
Nikita
-
13. Re: JBoss-5.1.0.GA Multiple SLF4J bindings
ihrytsyuk Oct 22, 2010 10:21 AM (in response to nikitad)Nikita,
I've tried all 3 settings but without results - errors were present in logs
-
14. Re: JBoss-5.1.0.GA Multiple SLF4J bindings
jroyals Oct 25, 2010 10:57 PM (in response to ihrytsyuk)Hi guys,
Yep, its the same cause as the problem I'm having with Hibernate (http://community.jboss.org/thread/156441) on EAP 5.0.1, but also on 5.1.0.GA. I'm having the same problem now with SLF4J as well as Hibernate, all because the libs deployed to common/lib are getting in the way. I can't delete them (shared server) and I can't delete mine (because I want to use Logback, not JBoss's SLF4J implementation which goes to shared server logs). So, I'm stuck. Looking forward to a nice solution for this, I'm yet to look at the custom deployer solution but sounds pretty awkward.