{"id":35,"date":"2014-01-02T12:35:03","date_gmt":"2014-01-02T12:35:03","guid":{"rendered":"http:\/\/www.nedlowe.co.uk\/blog\/?p=35"},"modified":"2014-01-02T12:35:03","modified_gmt":"2014-01-02T12:35:03","slug":"log4j-and-tomcat-issue","status":"publish","type":"post","link":"https:\/\/www.nedlowe.co.uk\/blog\/?p=35","title":{"rendered":"Log4j and Tomcat issue"},"content":{"rendered":"<p>(Recovered from my old Blog).<\/p>\n<p>Quick one \u2013 I had this issue today so wanted to record it for posterity.<\/p>\n<p>Tomcat can get confused if WEB-INF\/lib contains the log4j jar, with initialisation errors such as:<br \/>\n<code><br \/>\njava.lang.ClassNotFoundException: org.apache.log4j.Category<br \/>\n<\/code><\/p>\n<p>You might not even have directly included it \u2013 it might be included via a Maven dependency.<\/p>\n<p>The solution is simple; remove log4j! It\u2019s (often) already included in Tomcat, which is the root cause of the issues. If it\u2019s a Maven dependency, add an exclusion.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>(Recovered from my old Blog). Quick one \u2013 I had this issue today so wanted to record it for posterity. Tomcat can get confused if WEB-INF\/lib contains the log4j jar, with initialisation errors such as: java.lang.ClassNotFoundException: org.apache.log4j.Category You might not even have directly included it \u2013 it might be included via a Maven dependency. The [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[1],"tags":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p7QqxF-z","jetpack-related-posts":[{"id":16,"url":"https:\/\/www.nedlowe.co.uk\/blog\/?p=16","url_meta":{"origin":35,"position":0},"title":"Sharing Resources between Maven modules","date":"January 2, 2014","format":false,"excerpt":"(Recovered from my old Blog). I needed to share resources between modules in a multi-module Maven project. The resources in question are configuration data files which are converted into objects via XStream (plus some Spring Bean configuration files). The reason they need to be shared is for instantiation within module-specific\u2026","rel":"","context":"Similar post","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":31,"url":"https:\/\/www.nedlowe.co.uk\/blog\/?p=31","url_meta":{"origin":35,"position":1},"title":"SiteMesh with Spring MVC","date":"January 2, 2014","format":false,"excerpt":"(Recovered from my old Blog). SiteMesh is an open source framework that implements the Decorator pattern. It essentially takes the output stream from a web application, and adds elements to (\u2019decorates\u2019) it. Why would we want that? Put simply, it is an incredibly clean way of adding headers\/footers\/anything, with the\u2026","rel":"","context":"Similar post","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":33,"url":"https:\/\/www.nedlowe.co.uk\/blog\/?p=33","url_meta":{"origin":35,"position":2},"title":"Spring Security 3 Setup","date":"January 2, 2014","format":false,"excerpt":"(Recovered from my old Blog). Getting Spring Security setup only involves a few steps, but it can be confusing to work out exactly what they are \u2013 especially since almost all documentation refers to Spring Security 2, and there are a couple of differences. The first thing to do is\u2026","rel":"","context":"Similar post","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":41,"url":"https:\/\/www.nedlowe.co.uk\/blog\/?p=41","url_meta":{"origin":35,"position":3},"title":"Dummy Files in Unit Tests","date":"January 2, 2014","format":false,"excerpt":"(Recovered from my old Blog). Let\u2019s say that you have an application which accepts a filepath as part of its interface. When unit testing, you may have some dummy files which you use to test the interface. However, getting the full path of these test files can be a pain.\u2026","rel":"","context":"Similar post","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":82,"url":"https:\/\/www.nedlowe.co.uk\/blog\/?p=82","url_meta":{"origin":35,"position":4},"title":"Cheese grater cost management.","date":"September 17, 2017","format":false,"excerpt":"Ned's new term of the day: Cheese grater cost management. I've been thinking a lot recently about how to build great culture at Argomi, and as part of that I was thinking about where I've seen team morale suffer in the past. I've decided that in difficult times, big companies\u2026","rel":"","context":"Similar post","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":71,"url":"https:\/\/www.nedlowe.co.uk\/blog\/?p=71","url_meta":{"origin":35,"position":5},"title":"Class Libraries With Microservices","date":"August 30, 2016","format":false,"excerpt":"Back in the olden days, everyone went nuts for Service Oriented Architecture. \u00a0Many consultant dollars were made. \u00a0Everyone temporarily forgot who Fred Brooks was\u00a0(No Silver Bullet). Time moved on, the hype died down. \u00a0But just like a\u00a0Jeffrey\u00a0- IT COMES BACK. \u00a0Yes, I'm talking about micro-services. Martin Fowler has a really\u2026","rel":"","context":"In \"architecture\"","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/www.nedlowe.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/posts\/35"}],"collection":[{"href":"https:\/\/www.nedlowe.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.nedlowe.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.nedlowe.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.nedlowe.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=35"}],"version-history":[{"count":1,"href":"https:\/\/www.nedlowe.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/posts\/35\/revisions"}],"predecessor-version":[{"id":36,"href":"https:\/\/www.nedlowe.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/posts\/35\/revisions\/36"}],"wp:attachment":[{"href":"https:\/\/www.nedlowe.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=35"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.nedlowe.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=35"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.nedlowe.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=35"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}