java - Spring bean field (which is instantiated explicitly) is assigned to null sometimes -


one day faced incident application started crashing because of npe. found place crashing, cannot sure why happen.

roughly speaking lets assume have class a appears spring bean @ same time. class has field property instantiated explicitly (yes, know how sounds like) , method propertyuser uses field:

class {    private objectclass property = new objectclass();    public void propertyuser() {       property.action();    }       ....    getter\setter property } 

and after time of usual work, property field has become null has resulted in npe propertyuser method. changed legacy code , property assigned via spring container either, need sure reason of error appearance.

so pleased if give me hint.


Comments

Popular posts from this blog

Unable to remove the www from url on https using .htaccess -