Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
Nightly Builds
-
None
-
Operating System: All
Platform: PC
-
16457
Description
Trying to run this software on an EAServer, a NullPointerException is thrown in
two different places within LogFactory.java. I was able to trace the problem
in the source:
1) private static LogFactory getCachedFactory(ClassLoader contextClassLoader)
the factories.get(LogFactory.class.getClassLoader()) will cause a problem
because LogFactory.class.GetClassLoader() is null (using jre 1.4) changing
that part to a call to getContextClassLoader() would resolve this bug.
2) in getFactory():
// Fourth, try the fallback implementation class
if (factory == null)
same deal here, replacing LogFactory.class.getClassLoader() with contextClass
will fix.
I don't know if there was a reason these were left as
LogFactory.class.getClassLoader(), but getContextClassLoader(), will determine
if this is the correct call to make (and it states that this is only
appropriate in pre-jdk1.1), instead of just assuming it is the right call,
causing NullPointerExceptions.
Perhaps this wasn't noticed since it usually doesn't get to this fallback
position, but on the application server, it does every time.