Hi folks,
I am encounteruing a strange problem, which seems silly, but yet doesn't run in my Eclipse IDE (JRE 1.5); I have a source package, called "trial", inside which I have a factory class. the factory class reads a property file, which is under the same pacakge, "trial", and instantiates two classes;
the Factory class code is, as below,
---------------------
props = new Properties();
props.load(new FileInputStream("storage.txt"));
String rendererClass = props.getProperty("renderer.src");
String providerClass = props.getProperty("provider.src");
renderer = (MessageRenderer) Class.forName(rendererClass).newInstance();
provider = (MessageProvider) Class.forName(providerClass).newInstance();
---------------------
Properties file contains:
---------------------
renderer.src = StandardOutMessageRenderer
provider.src = HelloWorldMessageProvider
---------------------
Now if i use the factory class in a java class's main method, and execute, it first throws "FileNotFoundException" for file <storage.txt>; secondly if I give absolute path of the file, then it says "StandardOutMessageRenderer" class isn't found, though all the files are inside same pacakage. My output folder is also linked in the {.classpath} file.
Kindly suggest