{"id":1436,"date":"2016-11-25T12:01:26","date_gmt":"2016-11-25T17:01:26","guid":{"rendered":"http:\/\/shirishranjit.com\/blog1\/?page_id=1436"},"modified":"2016-11-25T12:01:26","modified_gmt":"2016-11-25T17:01:26","slug":"log4j-and-slf4j-getting-stackoverflowerror-on-startup","status":"publish","type":"page","link":"https:\/\/shirishranjit.com\/blog1\/java-stuff\/log4j-and-slf4j-getting-stackoverflowerror-on-startup","title":{"rendered":"Log4j and SLF4J getting StackOverflowError on startup"},"content":{"rendered":"<p>This issue is only possible when you have two SLF4J jars together those are<br \/>\n &#8211; log4j-slf4j-impl-2.4.1.jar<br \/>\n &#8211; g4j-to-slf4j-2.4.1.jar<\/p>\n<p>Following is the few lines of the error<br \/>\n<code><br \/>\nStackOverflowError<br \/>\n\tat org.apache.logging.log4j.util.ReflectionUtil.getCallerClass<br \/>\n<\/code><\/p>\n<h2> Solution<\/h2>\n<p>Remove g4j-to-slf4j-2.4.1.jar from your library and it will work just fine<\/p>\n<div class=\"twttr_buttons\"><div class=\"twttr_twitter\">\n\t\t\t\t\t<a href=\"http:\/\/twitter.com\/share?text=Log4j+and+SLF4J+getting+StackOverflowError+on+startup\" class=\"twitter-share-button\" data-via=\"\" data-hashtags=\"\"  data-size=\"default\" data-url=\"https:\/\/shirishranjit.com\/blog1\/java-stuff\/log4j-and-slf4j-getting-stackoverflowerror-on-startup\"  data-related=\"\" target=\"_blank\">Tweet<\/a>\n\t\t\t\t<\/div><div class=\"twttr_followme\">\n\t\t\t\t\t\t<a href=\"https:\/\/twitter.com\/shiranjit\" class=\"twitter-follow-button\" data-size=\"default\"  data-show-screen-name=\"false\"  target=\"_blank\">Follow me<\/a>\n\t\t\t\t\t<\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>This issue is only possible when you have two SLF4J jars together those are &#8211; log4j-slf4j-impl-2.4.1.jar &#8211; g4j-to-slf4j-2.4.1.jar Following is the few lines of the error StackOverflowError at org.apache.logging.log4j.util.ReflectionUtil.getCallerClass Solution Remove g4j-to-slf4j-2.4.1.jar from your library and it will work just &hellip; <a href=\"https:\/\/shirishranjit.com\/blog1\/java-stuff\/log4j-and-slf4j-getting-stackoverflowerror-on-startup\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":4,"featured_media":0,"parent":524,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-1436","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/shirishranjit.com\/blog1\/wp-json\/wp\/v2\/pages\/1436"}],"collection":[{"href":"https:\/\/shirishranjit.com\/blog1\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/shirishranjit.com\/blog1\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/shirishranjit.com\/blog1\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/shirishranjit.com\/blog1\/wp-json\/wp\/v2\/comments?post=1436"}],"version-history":[{"count":1,"href":"https:\/\/shirishranjit.com\/blog1\/wp-json\/wp\/v2\/pages\/1436\/revisions"}],"predecessor-version":[{"id":1437,"href":"https:\/\/shirishranjit.com\/blog1\/wp-json\/wp\/v2\/pages\/1436\/revisions\/1437"}],"up":[{"embeddable":true,"href":"https:\/\/shirishranjit.com\/blog1\/wp-json\/wp\/v2\/pages\/524"}],"wp:attachment":[{"href":"https:\/\/shirishranjit.com\/blog1\/wp-json\/wp\/v2\/media?parent=1436"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}