395394 allow logging from boot classloader

This commit is contained in:
Greg Wilkins 2012-11-30 07:56:38 +11:00
parent a22f2a25eb
commit cfa1c1e2e4
3 changed files with 3 additions and 13 deletions

View File

@ -47,7 +47,6 @@ public class Loader
{
/* ------------------------------------------------------------ */
public static URL getResource(Class<?> loadClass,String name, boolean checkParents)
throws ClassNotFoundException
{
URL url =null;
ClassLoader loader=Thread.currentThread().getContextClassLoader();

View File

@ -91,7 +91,7 @@ public class Log
* configuration of the Log class in situations where access to the System.properties are
* either too late or just impossible.
*/
URL testProps = Log.class.getClassLoader().getResource("jetty-logging.properties");
URL testProps = Loader.getResource(Log.class,"jetty-logging.properties",true);
if (testProps != null)
{
InputStream in = null;
@ -234,7 +234,7 @@ public class Log
public static void setLogToParent(String name)
{
ClassLoader loader = Log.class.getClassLoader();
if (loader.getParent()!=null)
if (loader!=null && loader.getParent()!=null)
{
try
{

View File

@ -298,16 +298,7 @@ public abstract class Resource implements ResourceFactory
URL url=Resource.class.getResource(name);
if (url==null)
{
try
{
url=Loader.getResource(Resource.class,name,checkParents);
}
catch(ClassNotFoundException e)
{
url=ClassLoader.getSystemResource(name);
}
}
url=Loader.getResource(Resource.class,name,checkParents);
if (url==null)
return null;
return newResource(url,useCaches);