fixed null pointer exceptions (spring context and properties)

fixed null pointer exceptions (spring context and properties)