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

classic Classic list List threaded Threaded
29 messages Options
12
Reply | Threaded
Open this post in threaded view
|

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

Bugzilla from bugzilla-daemon@pixie.qos.ch
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
Reply | Threaded
Open this post in threaded view
|

[Bug 138] Class path contains multiple SLF4J bindings

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 #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
Reply | Threaded
Open this post in threaded view
|

[Bug 138] Class path contains multiple SLF4J bindings

Bugzilla from bugzilla-daemon@pixie.qos.ch
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
Reply | Threaded
Open this post in threaded view
|

[Bug 138] Class path contains multiple SLF4J bindings

Bugzilla from bugzilla-daemon@pixie.qos.ch
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
Reply | Threaded
Open this post in threaded view
|

[Bug 138] Class path contains multiple SLF4J bindings

Bugzilla from bugzilla-daemon@pixie.qos.ch
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
Reply | Threaded
Open this post in threaded view
|

[Bug 138] Class path contains multiple SLF4J bindings

Bugzilla from bugzilla-daemon@pixie.qos.ch
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
Reply | Threaded
Open this post in threaded view
|

[Bug 138] Class path contains multiple SLF4J bindings

Bugzilla from bugzilla-daemon@pixie.qos.ch
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
Reply | Threaded
Open this post in threaded view
|

[Bug 138] Class path contains multiple SLF4J bindings

Bugzilla from bugzilla-daemon@pixie.qos.ch
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
Reply | Threaded
Open this post in threaded view
|

[Bug 138] Class path contains multiple SLF4J bindings

Bugzilla from bugzilla-daemon@pixie.qos.ch
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
Reply | Threaded
Open this post in threaded view
|

[Bug 138] Class path contains multiple SLF4J bindings

Bugzilla from bugzilla-daemon@pixie.qos.ch
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
Reply | Threaded
Open this post in threaded view
|

[Bug 138] Class path contains multiple SLF4J bindings

Bugzilla from bugzilla-daemon@pixie.qos.ch
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
Reply | Threaded
Open this post in threaded view
|

[Bug 138] Class path contains multiple SLF4J bindings

Bugzilla from bugzilla-daemon@pixie.qos.ch
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
Reply | Threaded
Open this post in threaded view
|

[Bug 138] Class path contains multiple SLF4J bindings

Bugzilla from bugzilla-daemon@pixie.qos.ch
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
Reply | Threaded
Open this post in threaded view
|

[Bug 138] Class path contains multiple SLF4J bindings

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


Dimo Velev <[hidden email]> changed:

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




--- Comment #13 from Dimo Velev <[hidden email]>  2010-02-23 16:26:49 ---
Hi,

I also find it better to use a Set in this case instead of a List. The reason
for this is that a Set better communicates the actual usage of the
implementations-collection in this piece of code (LoggerFactory). When you see
a List you automatically think of a collection which allows duplicates. Well,
in this case I think that the implementation actually means that this is a
collection which does not care for duplicates and this is expressed by a Set.

Just my own opinion as someone reading the source code.

Best regards,
Dimo


--
Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
slf4j-dev mailing list
[hidden email]
http://qos.ch/mailman/listinfo/slf4j-dev
Reply | Threaded
Open this post in threaded view
|

[Bug 138] Class path contains multiple SLF4J bindings

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





--- Comment #14 from Joern Huxhorn <[hidden email]>  2010-03-12 08:06:51 ---
Since this problem seems to pop up now and then
( http://marc.info/?l=slf4j-user&m=126833458925412&w=2 ):

How about:
- changing the List to a Set anyway
- check if a path is already contained in the Set while adding
- emit a different message (just an INFO?) in that case - with a different FAQ
entry - stating that this is a problem of the container (WebLogic in most
cases?)

That way it wouldn't be a workaround for a platform bug, it would merely be a
better diagnostic message and one less false warning.

The message, as it looks right now, is so strange (multiple but same binding??)
that people *will* ask for help on this over and over, otherwise.


--
Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
slf4j-dev mailing list
[hidden email]
http://qos.ch/mailman/listinfo/slf4j-dev
Reply | Threaded
Open this post in threaded view
|

[Bug 138] Class path contains multiple SLF4J bindings

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


Joe Littlejohn <[hidden email]> changed:

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




--
Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
slf4j-dev mailing list
[hidden email]
http://qos.ch/mailman/listinfo/slf4j-dev
Reply | Threaded
Open this post in threaded view
|

[Bug 138] Class path contains multiple SLF4J bindings

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





--- Comment #15 from Joe Littlejohn <[hidden email]>  2010-03-25 12:06:17 ---
Given this is a trivial fix (and the fact that a Set looks to be semantically
correct anyway) could I add another request that this gets fixed? The ability
to deploy multiple WAR files in a single EAR is a common requirement. More
generally, duplicate entries on the classpath don't produce an invalid
classpath.

Whether this is caused by a WebLogic bug or not, the result certainly looks
like slf4j being dumb. I can't see how


--
Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
slf4j-dev mailing list
[hidden email]
http://qos.ch/mailman/listinfo/slf4j-dev
Reply | Threaded
Open this post in threaded view
|

[Bug 138] Class path contains multiple SLF4J bindings

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





--- Comment #16 from Joe Littlejohn <[hidden email]>  2010-03-25 12:07:25 ---
... (ignore that last sentence - lost my train of thought :D)


--
Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
slf4j-dev mailing list
[hidden email]
http://qos.ch/mailman/listinfo/slf4j-dev
Reply | Threaded
Open this post in threaded view
|

[Bug 138] Class path contains multiple SLF4J bindings

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


Martin Serrano <[hidden email]> changed:

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




--- Comment #17 from Martin Serrano <[hidden email]>  2010-04-15 20:27:18 ---
FYI: I have run into this same issue using ANT and its associated classloader


--
Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
slf4j-dev mailing list
[hidden email]
http://qos.ch/mailman/listinfo/slf4j-dev
Reply | Threaded
Open this post in threaded view
|

[Bug 138] Class path contains multiple SLF4J bindings

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


Kostis Anagnostopoulos <[hidden email]> changed:

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




--- Comment #18 from Kostis Anagnostopoulos <[hidden email]>  2010-11-14 15:18:22 ---
In this particular case (same binding-paths) the error-message, is
dissorienting.

At least, it should change to something along the lines:
«Classpath contains multiple(i.e. 3) references to the *same* SLF4J binding:
\n  <path_to_binding>»

Additionally, it could state that this is a known behavior on Weblogic
platform.

(nevertheless, thank you all for this excellent lib!)


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