java ee - contextInitialized method of action listener not able to call a method on an object . It gives MethodNotFoundError -


below mentioned part of code of applicationlistner class .

here created imagecache instance , inside contextinitialized method invoking method on object.

at run time gives methodnotfounderror exception. once object created ,compiler not give error . why exception occur @ run time when context initialized?

private static final string classname = "applicationlistener";  imagescache<string, byte[]> imagecache = new imagescache<string, byte[]>  (iwsconstants.images_cache_size);   public void contextinitialized(servletcontextevent event) {         imagecache.setimagemap(map map);     final string methodname = "contextinitialized";     ifactsconfigprop ifactsconfigprop =  (ifactsconfigprop)appcontext.getwebcontext().getbean("factsconfigpropservice");     try {         ifactsconfigprop.getconfigproperties();     } catch (exception e) {         factslogger.error(classname, methodname,                 "error occured while retrieving admintool values" + e.getmessage(), null);     } 


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -