title: Caused By: java.lang.NoClassDefFoundError: org/apache/log4j/Logger
body: <p>I've got an interesting problem in which the org.apache.log4j.Logger class is not found during runtime. I'm trying to get authorized and that is where it's failing:</p>
  
  <p><code>OAuthAuthorizer oauthAuthorizer = new OAuthAuthorizer(OAUTH_CONSUMER_KEY, OAUTH_CONSUMER_SECRET, SAML_PROVIDER_ID, userId);</code></p>
  
  <p>I'm using JDeveloper 11.1.1.6. Here is what I know:</p>
  
  <ol>
  <li><p>I've looked in my UI.war/WEB-INF/lib directory and I see the log4j-1.2.17.jar there.</p></li>
  <li><p>The class complaining about it is org.opensaml.xml.XMLConfigurator</p>
  
  <pre><code>Caused by: java.lang.NoClassDefFoundError: org/apache/log4j/Logger
      at org.opensaml.xml.XMLConfigurator.&lt;clinit&gt;(XMLConfigurator.java:60)
      at org.opensaml.DefaultBootstrap.initializeXMLTooling(DefaultBootstrap.java:195)
      at org.opensaml.DefaultBootstrap.bootstrap(DefaultBootstrap.java:91)
      at com.intuit.ipp.aggcat.util.SAML2AssertionGenerator.getSAMLBuilder(SAML2AssertionGenerator.java:156)
      at com.intuit.ipp.aggcat.util.SAML2AssertionGenerator.createSubject(SAML2AssertionGenerator.java:187)
      at com.intuit.ipp.aggcat.util.SAML2AssertionGenerator.buildAssertion(SAML2AssertionGenerator.java:114)
      at com.intuit.ipp.aggcat.util.SAML2AssertionGenerator.generateSignedAssertion(SAML2AssertionGenerator.java:83)
      at com.intuit.ipp.aggcat.util.SamlUtil.createSignedSAMLPayload(SamlUtil.java:156)
      at com.intuit.ipp.aggcat.util.OAuthUtil.getOAuthTokens(OAuthUtil.java:60)
      at com.intuit.ipp.aggcat.core.OAuthAuthorizer.&lt;init&gt;(OAuthAuthorizer.java:85)
      at com.incomemax.view.intuit.WebUtil.getAggCatService(WebUtil.java:91)
  </code></pre>
  
  
  
  <pre><code>Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Logger
      at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:305)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:246)
      ... 64 more
  </code></pre></li>
  <li><p>I decomplied XMLConfigurator and oddly it doesn't import org.apache.log4j.Logger It uses org.slf4j.Logger which is also in my jars directory (slf4j-api-1.7.5.jar). Also interesting is that line 60 (see stack trace) is a blank line in my decompile.</p></li>
  <li><p>Of course if I add Logger.xxxxx during design time, it finds it just fine.</p></li>
  <li><p>I'm using the code/jars directly from the sample java code, but imported into my existing application.</p></li>
  </ol>
  
  <p>I've been scouring the web for answers and I believe I've checked all the areas I can think of. I also referenced this very good page: <a href="http://myarch.com/classnotfound/" rel="noreferrer">http://myarch.com/classnotfound/</a></p>
  
  <p>Given authorization is step 1 in using the Intuit Developer API, I'm kinda stuck.</p>
  
  <p>Adding output from @jhadesdev suggestion:</p>
  
  <p>All versions of log4j Logger: </p>
  
  <ul>
  <li>zip:C:/Users/Chris/AppData/Roaming/JDeveloper/system11.1.1.6.38.61.92/DefaultDomain/servers/DefaultServer/tmp/_WL_user/j2ee-app/lt5l71/war/WEB-INF/lib/log4j-1.2.17.jar!/org/apache/log4j/Logger.class</li>
  </ul>
  
  <p>All versions of log4j visible from the classloader of the OAuthAuthorizer class: </p>
  
  <ul>
  <li>zip:C:/Users/Chris/AppData/Roaming/JDeveloper/system11.1.1.6.38.61.92/DefaultDomain/servers/DefaultServer/tmp/_WL_user/j2ee-app/lt5l71/war/WEB-INF/lib/log4j-1.2.17.jar!/org/apache/log4j/Logger.class</li>
  </ul>
  
  <p>All versions of XMLConfigurator: </p>
  
  <ul>
  <li><p>jar:file:/C:/Oracle/Middleware11116/modules/com.bea.core.bea.opensaml2_1.0.0.0_6-1-0-0.jar!/org/opensaml/xml/XMLConfigurator.class</p></li>
  <li><p>zip:C:/Users/Chris/AppData/Roaming/JDeveloper/system11.1.1.6.38.61.92/DefaultDomain/servers/DefaultServer/tmp/_WL_user/j2ee-app/lt5l71/war/WEB-INF/lib/ipp-java-aggcat-v1-devkit-1.0.2.jar!/org/opensaml/xml/XMLConfigurator.class</p></li>
  <li><p>zip:C:/Users/Chris/AppData/Roaming/JDeveloper/system11.1.1.6.38.61.92/DefaultDomain/servers/DefaultServer/tmp/_WL_user/j2ee-app/lt5l71/war/WEB-INF/lib/xmltooling-1.3.1.jar!/org/opensaml/xml/XMLConfigurator.class</p></li>
  </ul>
  
  <p>All versions of XMLConfigurator visible from the class loader of the OAuthAuthorizer class:</p>
  
  <ul>
  <li><p>jar:file:/C:/Oracle/Middleware11116/modules/com.bea.core.bea.opensaml2_1.0.0.0_6-1-0-0.jar!/org/opensaml/xml/XMLConfigurator.class</p></li>
  <li><p>zip:C:/Users/Chris/AppData/Roaming/JDeveloper/system11.1.1.6.38.61.92/DefaultDomain/servers/DefaultServer/tmp/_WL_user/j2ee-app/lt5l71/war/WEB-INF/lib/ipp-java-aggcat-v1-devkit-1.0.2.jar!/org/opensaml/xml/XMLConfigurator.class</p></li>
  <li><p>zip:C:/Users/Chris/AppData/Roaming/JDeveloper/system11.1.1.6.38.61.92/DefaultDomain/servers/DefaultServer/tmp/_WL_user/j2ee-app/lt5l71/war/WEB-INF/lib/xmltooling-1.3.1.jar!/org/opensaml/xml/XMLConfigurator.class</p></li>
  </ul>
  
  <p>I'm still working on interpreting the results.</p>