From: Jason Pyeron
Sent: Wednesday, November 23, 2016 2:59 PM
To: dev@maven.apache.org
Subject: Logging for 3.0.x and >=3.1.0
Working on a plugin right now and it needs to work in 3.0 as well as 3.3.
Scratching my head on can we use slf4j in 3.0 or is there a backwards
compatibility logic to put in.
MG>AFAIK SLF4J 1.5.6 changed StaticLoggerBinder.SINGLETON from public static to
private
IllegalAccessError exceptions when using SLF4J. Why is that?
Here are the exception details.
Exception in thread "main" java.lang.IllegalAccessError: tried to access field
org.slf4j.impl.StaticLoggerBinder.SINGLETON from class org.slf4j.LoggerFactory
at org.slf4j.LoggerFactory.(LoggerFactory.java:60)
This error is caused by the static initializer of the LoggerFactory class
attempting to directly access the SINGLETON field of
org.slf4j.impl.StaticLoggerBinder. While this was allowed in SLF4J 1.5.5 and
earlier, in 1.5.6 and later the SINGLETON field has been marked as private
access.
If you get the exception shown above, then you are using an older version of
slf4j-api, e.g. 1.4.3, with a new version of a slf4j binding, e.g. 1.5.6.
Typically, this occurs when your Maven pom.ml file incorporates hibernate 3.3.0
which declares a dependency on slf4j-api version 1.4.2. If your pom.xml
declares a dependency on an slf4j binding, say slf4j-log4j12 version 1.5.6,
then you will get illegal access errors.
To see which version of slf4j-api is pulled in by Maven, use the maven
dependency plugin as follows.
mvn dependency:tree
http://slf4j.org/faq.html
SLF4J FAQ<http://slf4j.org/faq.html>
slf4j.org
Binding Requirements; slf4j-nop: JDK 1.5: slf4j-simple: JDK 1.5: slf4j-log4j12:
JDK 1.5, plus any other library dependencies required by the log4j appenders in
use
MG>does this help?
-Jason
MG>enjoy your holiday
--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- -
- Jason Pyeron PD Inc. http://www.pdinc.us -
PD Inc.<http://www.pdinc.us/>
www.pdinc.us
PD Inc is a business solutions provider with expert solutions tailored to
consulting projects on an enterprise-wide scale. We have been able to leverage
our vast ...
- Principal Consultant 10 West 24th Street #100-
- +1 (443) 269-1555 x333Baltimore, Maryland 21218 -
- -
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
-
To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
For additional commands, e-mail: dev-h...@maven.apache.org