Home » Eclipse Projects » e(fx)clipse » Trouble when trying to use log4j(Error "SLF4J: Class path contains multiple SLF4J bindings")
| | | |
Re: Trouble when trying to use log4j [message #1439539 is a reply to message #1436252] |
Tue, 07 October 2014 04:58   |
Eclipse User |
|
|
|
Hi Tom,
if you look at the included bundles with ss, do you see more than one implementation of the slf4j API on the list? Maybe two of logback, slf4j.log4j, slf4j.simple, slf4j.nop, etc ...
I have seen this issue before, when I used "Add required bundles". Because slf4j.log4j is a fragment it gets added as soon as slf4j.api is around.
Greetings
Christoph
Thomas Schindl wrote on Thu, 02 October 2014 18:18I think slf4j is causing this troubles - I've seen this problem myself
just yesterday myself when I dropped slf4j into my runtime config. So
there's something heavily crazy going on with slf4j. Need to debug
please file a bug report!
Tom
On 02.10.14 07:38, Thomas Elskens wrote:
> Hello,
>
> I tried the recipe
> http://wiki.eclipse.org/Efxclipse/Runtime/Recipes#Logging to inject an
> instance of the default java.util.Logger. This worked fine.
> However, when adding the plugin org.eclipse.fx.core.log4j in order to
> use the log4j implementation, I get the following error when the
> logger.info(...) is called :
> Quote:
>> SLF4J: Class path contains multiple SLF4J bindings.
>> SLF4J: Found binding in
>> [bundleresource://176.fwk1616974404:1/org/slf4j/impl/StaticLoggerBinder.class]
>>
>> SLF4J: Found binding in
>> [bundleresource://176.fwk1616974404:2/org/slf4j/impl/StaticLoggerBinder.class]
>>
>> SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an
>> explanation.
>> SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
>> Exception in thread "JavaFX Application Thread"
>> java.lang.StackOverflowError
>> at java.util.Hashtable.containsKey(Unknown Source)
>> at
>> org.apache.log4j.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:57)
>> at org.apache.log4j.LogManager.getLogger(LogManager.java:44)
>> at
>> org.slf4j.impl.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:64)
>> at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:270)
>> at org.apache.log4j.Category.<init>(Category.java:56)
>> at org.apache.log4j.Logger.<init>(Logger.java:36)
>
>
> I've found only few references of this error on the net (e.g.
> http://www.slf4j.org/codes.html#multiple_bindings,
> http://stackoverflow.com/questions/14024756/slf4j-class-path-contains-multiple-slf4j-bindings
> and
> http://stackoverflow.com/questions/18721142/multiple-slf4j-bindings-in-eclipse-rcp-plugin,
> but none of the proposed solutions seem applicable : there's no
> dependency defined in the POM, there is no conflict on the classpath (as
> the bindings stem apparently twice from the same plugin) .
> Any idea of how to solve this ... ? Perhaps it's more of a question
> regarding log4j ... ?
>
> Thomas
>
|
|
|
Re: Trouble when trying to use log4j [message #1439557 is a reply to message #1439539] |
Tue, 07 October 2014 05:25   |
Eclipse User |
|
|
|
Hi,
I did something nasty because I copied stuff (jars, ...) together to
assemble a bundle with its prereqs so the error is most likely really bogus.
Tom
On 07.10.14 10:58, Christoph Keimel wrote:
> Hi Tom,
>
> if you look at the included bundles with ss, do you see more than one
> implementation of the slf4j API on the list? Maybe two of logback,
> slf4j.log4j, slf4j.simple, slf4j.nop, etc ...
>
> I have seen this issue before, when I used "Add required bundles".
> Because slf4j.log4j is a fragment it gets added as soon as slf4j.api is
> around.
>
> Greetings
> Christoph
>
> Thomas Schindl wrote on Thu, 02 October 2014 18:18
>> I think slf4j is causing this troubles - I've seen this problem myself
>> just yesterday myself when I dropped slf4j into my runtime config. So
>> there's something heavily crazy going on with slf4j. Need to debug
>> please file a bug report!
>>
>> Tom
>>
>> On 02.10.14 07:38, Thomas Elskens wrote:
>> > Hello,
>> > > I tried the recipe
>> > http://wiki.eclipse.org/Efxclipse/Runtime/Recipes#Logging to inject an
>> > instance of the default java.util.Logger. This worked fine.
>> > However, when adding the plugin org.eclipse.fx.core.log4j in order to
>> > use the log4j implementation, I get the following error when the
>> > logger.info(...) is called :
>> > Quote:
>> >> SLF4J: Class path contains multiple SLF4J bindings.
>> >> SLF4J: Found binding in
>> >>
>> [bundleresource://176.fwk1616974404:1/org/slf4j/impl/StaticLoggerBinder.class]
>>
>> >>
>> >> SLF4J: Found binding in
>> >>
>> [bundleresource://176.fwk1616974404:2/org/slf4j/impl/StaticLoggerBinder.class]
>>
>> >>
>> >> SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an
>> >> explanation.
>> >> SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
>> >> Exception in thread "JavaFX Application Thread"
>> >> java.lang.StackOverflowError
>> >> at java.util.Hashtable.containsKey(Unknown Source)
>> >> at
>> >>
>> org.apache.log4j.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:57)
>> >> at org.apache.log4j.LogManager.getLogger(LogManager.java:44)
>> >> at
>> >>
>> org.slf4j.impl.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:64)
>> >> at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:270)
>> >> at org.apache.log4j.Category.<init>(Category.java:56)
>> >> at org.apache.log4j.Logger.<init>(Logger.java:36)
>> > > > I've found only few references of this error on the net (e.g.
>> > http://www.slf4j.org/codes.html#multiple_bindings,
>> >
>> http://stackoverflow.com/questions/14024756/slf4j-class-path-contains-multiple-slf4j-bindings
>>
>> > and
>> >
>> http://stackoverflow.com/questions/18721142/multiple-slf4j-bindings-in-eclipse-rcp-plugin,
>>
>> > but none of the proposed solutions seem applicable : there's no
>> > dependency defined in the POM, there is no conflict on the classpath
>> (as
>> > the bindings stem apparently twice from the same plugin) .
>> > Any idea of how to solve this ... ? Perhaps it's more of a question
>> > regarding log4j ... ?
>> > > Thomas
>> >
>
>
|
|
| | | | | | |
Re: Trouble when trying to use log4j [message #1439673 is a reply to message #1439659] |
Tue, 07 October 2014 07:41  |
Eclipse User |
|
|
|
.... on my never ending list of ideas ;-) there's a feature which
integrates our logger stuff into the world of ConfigAdmin.
Tom
On 07.10.14 13:26, Thomas Elskens wrote:
> Christophe,
>
> Indeed I don't need slf4j, only log4j - so I removed the three
> dependencies and provided some basic configuration by means of a
> log4j.properties file. I guess I misinterpreted the efxclipse wiki by
> supposing configuration of log4j was already done (which now I think of
> it, would not be very meaningful).
> Perhaps interesting for others, too :
> http://stackoverflow.com/questions/5150415/log4j-under-osgi-eclipse-rcp.
> Everything seems to work very well now.
> Thanks a lot !
>
> Thomas
>
|
|
|
Goto Forum:
Current Time: Sat Jun 14 16:09:27 EDT 2025
Powered by FUDForum. Page generated in 0.67695 seconds
|