Hi All,
I have a java web application in which I need to read a configuration file(WebAgent.conf) that has the reference of another configuration file(SmHost.conf). I am placing both these configuration files in the <root-dir> of the application.
I am specifying the path for WebAgent.conf as “/WebAgent.conf” in my AuthenticateUser java class and in WebAgent.conf, the reference to SmHost.conf is given as “/SmHost.conf”.
I am copying the content of the all the files for your reference below:
AuthenticateUser.java
String webagentConfigFile = "/WebAgent.conf";
InitDef initdef = new InitDef();
int retcode = agentapi.getConfig(initdef, agentName, webagentConfigFile); // retcode=-1 which implies that code is unable to read the configuration file.
AuthBean authbean = new AuthBean();
WebAgent.conf:
agentconfigobject="1365-pmtrade-trd-dvl4-443-aco"
hostconfigfile="/SmHost.conf"
But with this approach, I am unable to read this configuration files. Kindly let me know where I am going wrong.