In my test application I’m getting the below exception
java.lang.NullPointerException
at org.apache.log4j.CategoryKey.<init>(CategoryKey.java:20)
at org.apache.log4j.Hierarchy.getLogger(Hierarchy.java:252)
at org.apache.log4j.Hierarchy.getLogger(Hierarchy.java:233)
at org.apache.log4j.LogManager.getLogger(LogManager.java:179)
at org.apache.log4j.Category.getInstance(Category.java:514)
Even though I am using the line
static final Logger logger1 = Logger.getLogger(Test.class);
Can someone help me in resolving this….
Thanks
Odd, I did some searching around and that NPE is caused by a null Category name, but when you specify a
Logger.getLogger(Test.class)you should not have that problem. I recommend getting the log4j source and debugging it.