In my java class, I have a method staticcalled getProperties()that returns java.util.Properties.
In another method, staticI call this method as:
Properties p = getProperties();
And the method getProperties():
private static Properties getProperties(){
Properties properties = new Properties();
try{
InputStream fis = null;
fis = new FileInputStream("src/main/resources/fileName.properties");
properties.load(fis);
fis.close();
}catch(Exception e){
}
return properties;
}
ERROR:
Exception in thread "main" java.lang.StackOverflowError
at sun.misc.VM.isBooted(VM.java:165)
at java.util.Hashtable.initHashSeedAsNeeded(Hashtable.java:226)
at java.util.Hashtable.<init>(Hashtable.java:263)
at java.util.Hashtable.<init>(Hashtable.java:283)
at java.util.Properties.<init>(Properties.java:143)
at java.util.Properties.<init>(Properties.java:135)
In debug mode getProperties (); the method is called continuously without receiving a return statement.
source
share