Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
1.5.0
-
None
-
None
Description
Hi everybody,
The sqoop's default bin script (created via install_sqoop.sh afaics) leads to the following error on Debian 10 if libslf4j-java is installed:
SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/usr/lib/hadoop/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/usr/share/java/maven3-slf4j-provider.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/usr/share/java/slf4j-jcl.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/usr/share/java/slf4j-jdk14.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/usr/share/java/slf4j-log4j12.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/usr/share/java/slf4j-nop.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/usr/share/java/slf4j-simple.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/usr/lib/hive/lib/log4j-slf4j-impl-2.6.2.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: See [http://www.slf4j.org/codes.html#multiple_bindings] for an explanation. SLF4J: Detected both log4j-over-slf4j.jar AND bound slf4j-log4j12.jar on the class path, preempting StackOverflowError. SLF4J: See also [http://www.slf4j.org/codes.html#log4jDelegationLoop] for more details. Exception in thread "main" java.lang.ExceptionInInitializerError at org.slf4j.impl.StaticLoggerBinder.<init>(StaticLoggerBinder.java:72) at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:45) at org.slf4j.LoggerFactory.bind(LoggerFactory.java:150) at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:124) at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:412) at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:357) at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:155) at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:671) at org.apache.sqoop.Sqoop.<clinit>(Sqoop.java:42) Caused by: java.lang.IllegalStateException: Detected both log4j-over-slf4j.jar AND bound slf4j-log4j12.jar on the class path, preempting StackOverflowError. See also [http://www.slf4j.org/codes.html#log4jDelegationLoop] for more details. at org.slf4j.impl.Log4jLoggerFactory.<clinit>(Log4jLoggerFactory.java:54) ... 9 more
The issue seems to be this bit of code:
SQOOP_JARS=\`ls /var/lib/sqoop/*.jar /usr/share/java/*.jar 2>/dev/null\`
Since it blindly loads jars from /usr/share/java, and on Debian 10 I have:
elukey@stat1004:~$ ls /var/lib/sqoop/*.jar /usr/share/java/*.jar 2>/dev/null | tr " " "\n" | grep log4j /usr/share/java/log4j-over-slf4j-1.7.25.jar /usr/share/java/log4j-over-slf4j.jar /usr/share/java/slf4j-log4j12-1.7.25.jar /usr/share/java/slf4j-log4j12.jar
If I remove `/usr/share/java/log4j-over-slf4j.jar` the issue is gone, since the /usr/share/java/log4j-over-slf4j-1.7.25.jar is a symlink to it. The jars are brought by the libslf4j-java package.
I added a more detailed description in https://phabricator.wikimedia.org/T274866#6843187.
Should we filter the SQOOP_JARS jar list for this use case, or do you have a better idea?
Thanks in advance
Attachments
Issue Links
- links to