<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:"Malgun Gothic";
panose-1:2 11 5 3 2 0 0 2 0 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:"\@Malgun Gothic";
panose-1:2 11 5 3 2 0 0 2 0 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-CA" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">Hi<o:p></o:p></p>
<p class="MsoNormal">I’m having a problem with using both slf4j and log4j. I have use sbt to pull 2 repositories: one package uses slf4j-log4j12.jar and the other package uses use log4j-over-slf4j.jar which creates the circular loop. (Basically in one package
slf4j forwards to log4j and the other package log4j forwards to slf4j which creates a circular loop)<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I’ve checked the URL in the exception and I have no idea how to fix this. Any help greatly appreciated!!
<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><u>Below is the stacktrace:<o:p></o:p></u></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">SLF4J: Detected both log4j-over-slf4j.jar AND slf4j-log4j12.jar on the class path, preempting StackOverflowError.
<o:p></o:p></p>
<p class="MsoNormal">SLF4J: See also http://www.slf4j.org/codes.html#log4jDelegationLoop for more details.<o:p></o:p></p>
<p class="MsoNormal">Exception in thread "main" java.lang.ExceptionInInitializerError<o:p></o:p></p>
<p class="MsoNormal"> at org.apache.log4j.Logger.getLogger(Logger.java:40)<o:p></o:p></p>
<p class="MsoNormal"> at org.apache.spark.util.AkkaUtils$.createActorSystem(AkkaUtils.scala:58)<o:p></o:p></p>
<p class="MsoNormal"> at org.apache.spark.SparkEnv$.create(SparkEnv.scala:126)<o:p></o:p></p>
<p class="MsoNormal"> at org.apache.spark.SparkContext.<init>(SparkContext.scala:139)<o:p></o:p></p>
<p class="MsoNormal"> at org.apache.spark.streaming.StreamingContext$.createNewSparkContext(StreamingContext.scala:500)<o:p></o:p></p>
<p class="MsoNormal"> at org.apache.spark.streaming.StreamingContext.<init>(StreamingContext.scala:76)<o:p></o:p></p>
<p class="MsoNormal"> at com.verticalscope.spark.TestDriver$.test2(TestDriver.scala:34)<o:p></o:p></p>
<p class="MsoNormal"> at com.verticalscope.spark.TestDriver$.main(TestDriver.scala:25)<o:p></o:p></p>
<p class="MsoNormal"> at com.verticalscope.spark.TestDriver.main(TestDriver.scala)<o:p></o:p></p>
<p class="MsoNormal"> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<o:p></o:p></p>
<p class="MsoNormal"> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)<o:p></o:p></p>
<p class="MsoNormal"> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)<o:p></o:p></p>
<p class="MsoNormal"> at java.lang.reflect.Method.invoke(Method.java:601)<o:p></o:p></p>
<p class="MsoNormal"> at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)<o:p></o:p></p>
<p class="MsoNormal">Caused by: java.lang.IllegalStateException: Detected both log4j-over-slf4j.jar AND slf4j-log4j12.jar on the class path, preempting StackOverflowError. See also http://www.slf4j.org/codes.html#log4jDelegationLoop for more details.<o:p></o:p></p>
<p class="MsoNormal"> at org.apache.log4j.Log4jLoggerFactory.<clinit>(Log4jLoggerFactory.java:51)<o:p></o:p></p>
<p class="MsoNormal"> ... 14 more<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Process finished with exit code 1<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">-Adrian<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>