/*
 * This java source file is placed into the public domain.
 *
 * The orginal author is Ceki Gulcu, QOS.ch
 *
 * THIS SOFTWARE IS PROVIDED AS-IS WITHOUT WARRANTY OF ANY KIND, NOT EVEN
 * THE IMPLIED WARRANTY OF MERCHANTABILITY. THE AUTHOR OF THIS SOFTWARE,
 * ASSUMES _NO_ RESPONSIBILITY FOR ANY CONSEQUENCE RESULTING FROM THE
 * USE, MODIFICATION, OR REDISTRIBUTION OF THIS SOFTWARE.
 */
package ch.qos.test;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import java.net.URL;
import java.net.URLClassLoader;


/**
 * JCL will fail as soon as the thread context class loader is set to
 * the child class loader.
 *
 * @author <a href="http://www.qos.ch/log4j/">Ceki G&uuml;lc&uuml;</a>
 */
public class ParentFirstTestJCL2 {
  public static void main(String[] args) throws Exception {
    URLClassLoader childClassLoader =
      new URLClassLoader(
        new URL[] {
          new URL("file:box1.jar"), 
          new URL("file:lib/commons-logging.jar"),
          new URL("file:lib//log4j.jar")
        });

    Thread.currentThread().setContextClassLoader(childClassLoader);

    Log log = LogFactory.getLog("logger.name.not.important.here");
  }
}
