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
Post a Comment