Hi,

I am trying to configure log4j for an app. Currently, I have deployed 
it on Tomcat. My code snippet is -

..............
String configFileName = "com.common.logger.xml";
URL url = null;
Context ctx=null;
ctx = new InitialContext();
url = ctx.getClass().getResource(configFileName); 
.....................

I put the xml file under a directory structure under classes in my 
web-app. The issue is that the URL is null. 

I also tried other options like making the string 
\com\common\logger.xml and com\common\logger.xml

Another approach I tried was to get Thread.currentThread.getClassLoader
and read the URL from there, I get a vague null pointer exception and 
zip exception.

I am sorry if this is a very elementary question, but I could not find 
any solutions in the lists also. 

Krishna.



---------------------------------
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software

Reply via email to