[Bug 138] New: Class path contains multiple SLF4J bindings

13 messages Options
Embed this post
Permalink
Bugzilla from bugzilla-daemon@pixie.qos.ch

[Bug 138] New: Class path contains multiple SLF4J bindings

Reply Threaded More More options
Print post
Permalink
http://bugzilla.slf4j.org/show_bug.cgi?id=138

           Summary: Class path contains multiple SLF4J bindings
           Product: SLF4J
           Version: 1.5.x
          Platform: All
        OS/Version: Linux
            Status: NEW
          Severity: minor
          Priority: P3
         Component: Core API
        AssignedTo: [hidden email]
        ReportedBy: [hidden email]


Hi,

Problem description:
"Class path contains multiple SLF4J bindings" message appears in WebLogic 10.3
log during startup of an application with SLF4J 1.5.8.
The problem is that exactly the same binding is printed twice and therefore the
warning is irrelevant:
SLF4J: Found binding in
[zip:/servers/WLServer/tmp/_WL_user/MyApplication/he3hgg/epc.jar!/org/slf4j/impl/StaticLoggerBinder.class]

Suggested solution:
In org.slf4j.LoggerFactory.singleImplementationSanityCheck() method in line 192
getResources somehow returns 2 exactly the same bindings:
Enumeration paths = LoggerFactory.class.getClassLoader().getResources(
          STATIC_LOGGER_BINDER_PATH);

So using Set implementationSet = new HashList();
in line 194 instead of List implementationList = new ArrayList();
will solve such irrelevant warning.


--
Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
dev mailing list
[hidden email]
http://www.slf4j.org/mailman/listinfo/dev
Bugzilla from bugzilla-daemon@pixie.qos.ch

[Bug 138] Class path contains multiple SLF4J bindings

Reply Threaded More More options
Print post
Permalink
http://bugzilla.slf4j.org/show_bug.cgi?id=138


Ceki Gulcu <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]




--- Comment #1 from Ceki Gulcu <[hidden email]>  2009-07-01 15:22:57 ---
Could you please include the warning as is, without any editing?


--
Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
dev mailing list
[hidden email]
http://www.slf4j.org/mailman/listinfo/dev
Bugzilla from bugzilla-daemon@pixie.qos.ch

[Bug 138] Class path contains multiple SLF4J bindings

Reply Threaded More More options
Print post
Permalink
In reply to this post by Bugzilla from bugzilla-daemon@pixie.qos.ch
http://bugzilla.slf4j.org/show_bug.cgi?id=138


Alex <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]




--- Comment #2 from Alex <[hidden email]>  2009-07-02 10:42:18 ---
(In reply to comment #1)
> Could you please include the warning as is, without any editing?
>

The whole warning is:

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in
[zip:/servers/WLServer/tmp/_WL_user/MyApplication/he3hgg/epc.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in
[zip:/servers/WLServer/tmp/_WL_user/MyApplication/he3hgg/epc.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an
explanation.


--
Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
dev mailing list
[hidden email]
http://www.slf4j.org/mailman/listinfo/dev
Bugzilla from bugzilla-daemon@pixie.qos.ch

[Bug 138] Class path contains multiple SLF4J bindings

Reply Threaded More More options
Print post
Permalink
In reply to this post by Bugzilla from bugzilla-daemon@pixie.qos.ch
http://bugzilla.slf4j.org/show_bug.cgi?id=138





--- Comment #3 from Ceki Gulcu <[hidden email]>  2009-07-02 11:08:08 ---
Thank you for adding the warning.

Using a HashSet instead of ArrayList would alleviate this issue. However, it
seems rather clear that the problem is in the getResources method of the class
loader instance supplied by Weblogic and not in SLF4J's code. As a general rule
of thumb, I avoid working around platform bugs.

I am curious to see whether other environments exhibit the same curious
behavior or if the issue is Weblogic specific. As such, let us leave this issue
open, awaiting input from other users.

In any case, I highly encourage you to raise the issue with Weblogic.


--
Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
dev mailing list
[hidden email]
http://www.slf4j.org/mailman/listinfo/dev
Bugzilla from bugzilla-daemon@pixie.qos.ch

[Bug 138] Class path contains multiple SLF4J bindings

Reply Threaded More More options
Print post
Permalink
In reply to this post by Bugzilla from bugzilla-daemon@pixie.qos.ch
http://bugzilla.slf4j.org/show_bug.cgi?id=138





--- Comment #4 from Alex <[hidden email]>  2009-07-02 12:39:56 ---
(In reply to comment #3)

You are right. I just have deployed the application on WebSphere and I didn't
find this warning.
Thanks.


--
Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
dev mailing list
[hidden email]
http://www.slf4j.org/mailman/listinfo/dev
Bugzilla from bugzilla-daemon@pixie.qos.ch

[Bug 138] Class path contains multiple SLF4J bindings

Reply Threaded More More options
Print post
Permalink
In reply to this post by Bugzilla from bugzilla-daemon@pixie.qos.ch
http://bugzilla.slf4j.org/show_bug.cgi?id=138


Ceki Gulcu <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]




--- Comment #5 from Ceki Gulcu <[hidden email]>  2009-07-23 09:44:45 ---
Ari Meyer ran into the same problem:

  http://www.slf4j.org/pipermail/user/2009-July/000793.html

It still seems to be Weblogic related.


--
Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
dev mailing list
[hidden email]
http://www.slf4j.org/mailman/listinfo/dev
Bugzilla from bugzilla-daemon@pixie.qos.ch

[Bug 138] Class path contains multiple SLF4J bindings

Reply Threaded More More options
Print post
Permalink
In reply to this post by Bugzilla from bugzilla-daemon@pixie.qos.ch
http://bugzilla.slf4j.org/show_bug.cgi?id=138





--- Comment #6 from Łukasz Rżanek <[hidden email]>  2009-09-15 23:54:54 ---
Created an attachment (id=61)
 --> (http://bugzilla.slf4j.org/attachment.cgi?id=61)
Proposed solution?

The solution proposed in the discussion linked above actually works great. I've
attached a corrected version of LoggerFactory.java to consider, though my
Eclipse broke all of the formatting :-)

The problem was, actually, in multiple classpaths in manifests - if there was
more than EJB jar with binding listed WLS was providing a full list of those.
Even if the class was the same. This goes with the ClassLoader behavior in WLS.

Can you please change that List to Set in the next release? I considered all
odds - it will not affect the core functionality itself.


--
Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
dev mailing list
[hidden email]
http://www.slf4j.org/mailman/listinfo/dev
Bugzilla from bugzilla-daemon@pixie.qos.ch

[Bug 138] Class path contains multiple SLF4J bindings

Reply Threaded More More options
Print post
Permalink
In reply to this post by Bugzilla from bugzilla-daemon@pixie.qos.ch
http://bugzilla.slf4j.org/show_bug.cgi?id=138


Robert Elliot <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]




--- Comment #7 from Robert Elliot <[hidden email]>  2009-09-16 00:04:24 ---
I'm a +1 for changing it to a Set.  I don't see it as working around someone
else's bug, a Set is the semantically correct type anyway.  Order is
irrelevant, so it shouldn't be a List, and there ought to be no duplicate
entries, which makes it a Set.  I should have done it that way in the first
place.


--
Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
dev mailing list
[hidden email]
http://www.slf4j.org/mailman/listinfo/dev
Bugzilla from bugzilla-daemon@pixie.qos.ch

[Bug 138] Class path contains multiple SLF4J bindings

Reply Threaded More More options
Print post
Permalink
In reply to this post by Bugzilla from bugzilla-daemon@pixie.qos.ch
http://bugzilla.slf4j.org/show_bug.cgi?id=138





--- Comment #8 from Matthew Teeter <[hidden email]>  2009-09-30 20:31:40 ---
I've encountered this same issue on Weblogic 9.1, 9.2, and 10.0, which does not
happen on Tomcat.  I've filed a bug with Oracle on 9/2/2009 and they are
looking into it.  Nevertheless, it sounds like switching the code to a map is
probably the best solution.


--
Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
dev mailing list
[hidden email]
http://www.slf4j.org/mailman/listinfo/dev
Bugzilla from bugzilla-daemon@pixie.qos.ch

[Bug 138] Class path contains multiple SLF4J bindings

Reply Threaded More More options
Print post
Permalink
In reply to this post by Bugzilla from bugzilla-daemon@pixie.qos.ch
http://bugzilla.slf4j.org/show_bug.cgi?id=138


syvalta <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]




--- Comment #9 from syvalta <[hidden email]>  2009-10-14 14:49:13 ---
Yes, seeing this in WL 10MP1 too. However, it doesn't cause any problems, so I
think using List in this case is more appropriate. If the WL bug is
workarounded in slf4j, there's less demand and pressure for Oracle to fix WL.


--
Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
dev mailing list
[hidden email]
http://www.slf4j.org/mailman/listinfo/dev
Bugzilla from bugzilla-daemon@pixie.qos.ch

[Bug 138] Class path contains multiple SLF4J bindings

Reply Threaded More More options
Print post
Permalink
In reply to this post by Bugzilla from bugzilla-daemon@pixie.qos.ch
http://bugzilla.slf4j.org/show_bug.cgi?id=138


Łukasz Rżanek <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]




--- Comment #10 from Łukasz Rżanek <[hidden email]>  2009-10-27 20:55:15 ---
This is not a WLS bug, as far the WLS behaves the way it's described.
Anyway, a Set makes sense in this case and I really do agree with Robert here.

Besides, as I wrote, made a local version and used it successfully in few
deployments already without any glitches. So it might be considered as tested
:-)


--
Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
dev mailing list
[hidden email]
http://www.slf4j.org/mailman/listinfo/dev
Bugzilla from bugzilla-daemon@pixie.qos.ch

[Bug 138] Class path contains multiple SLF4J bindings

Reply Threaded More More options
Print post
Permalink
In reply to this post by Bugzilla from bugzilla-daemon@pixie.qos.ch
http://bugzilla.slf4j.org/show_bug.cgi?id=138


Joern Huxhorn <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]




--- Comment #11 from Joern Huxhorn <[hidden email]>  2009-10-27 23:43:07 ---
Łukasz,

just out of curiosity, where is that behavior described? What's the rationale
behind if, if it is expected behavior of WLS?

Since this is just a warning that isn't preventing SLF4J from working as
expected I tend to agree with Ceki about not working around platform bugs.

Sure, the fix is really simple and I highly doubt that it would introduce any
problem but, as syvalta mentioned, fixing this here in SLF4J would actually
decrease pressure to fix the real bug (and I guess it is one) in WLS.

On the other hand: If the "multiple WARs in an EAR config" that Ari Meyer
describes is a common pattern (that I'm not aware of, but I have no experience
with EAR) then the code emitting the warning might be based on wrong
assumptions and is probably superfluous.

I honestly don't know, that's why I'm asking for the documentation of this
behavior.

Matthew, are you having a link to the filed bug or is it confidential. It would
probably be worthwhile to follow the discussion in that bug report.


--
Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
dev mailing list
[hidden email]
http://www.slf4j.org/mailman/listinfo/dev
Bugzilla from bugzilla-daemon@pixie.qos.ch

[Bug 138] Class path contains multiple SLF4J bindings

Reply Threaded More More options
Print post
Permalink
In reply to this post by Bugzilla from bugzilla-daemon@pixie.qos.ch
http://bugzilla.slf4j.org/show_bug.cgi?id=138





--- Comment #12 from Ceki Gulcu <[hidden email]>  2009-10-28 18:32:33 ---
I am also curious. What is that behavior described?


--
Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
dev mailing list
[hidden email]
http://www.slf4j.org/mailman/listinfo/dev