Skip to Content
Former Member
Jun 15, 2009 at 04:11 AM

Unable to read configuration file



I'm implementing Log4j in my EJB. Now i'm having problem to read/locate my file. I not sure the path i put my I did try in few places but seem not working also. My EJB is packaged with a WAR in an EAR file.

Currently i'm placing my file in the root folder of my EJB. (CustomEJB>

This is my code in my EJB

public class GatewayBean implements SessionBean {
static Logger logger =  Logger.getLogger("GatewayBean.class");
public String[] testLog() {
	PropertyConfigurator.configure(""); Date() + " testLog"); Date() + " Testing for logging");
}catch (Exception e){

When it try to load the properties file, it unable to find. This is the error that i got.

log4j:ERROR Could not read configuration file [].# (The system cannot find the file specified)#
log4j:ERROR Ignoring configuration file [].#

No problem for WEB application. But only for EJB. I try to put in the EJB>META-INF, also not working. So i not sure where to put the properties file and it can load. I try to include in my Java Build Path but cannot as is only can include .jar n .zip file.

Thanks in advance for the help.


Just now i google for this and i try to get my the path when running this program. I realized the path is \usr\X01\DVEBMGS01\j2ee\cluster\server0

So i put the file in that path and now it able to read it. But i don't think this is the correct way as it should be in the deployment file. What i think is weird that isn't the path should be at \usr\X01\DVEBMGS01\j2ee\cluster\server0\apps\\GatewayEAR......?

Edited by: Adrian Chan on Jun 15, 2009 8:53 AM