I would like to get an attribute in WebApplicationContext in DWRFacade class. I extented HttpServlet to DWRFacade class. But i'm getting
WARNING: Method execution failed: java.lang.NullPointerException at javax.servlet.GenericServlet.getServletContext(GenericServlet.java:159) at com.scs.rb.web.utils.DWRFacade.getCounties(DWRFacade.java:23) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
There aren't many rules that you need to worry about here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.
In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.
I think Peter may be right, it looks like your servlet has not been initialised. You could try setting it to initialise on startup in your web.xml, that may help things.
Thanks for your reply. I'm developing this appication in Spring and I'm loading all the necessary xmls using ContextLoaderListener. And the DWRFacade class's bean is defined in one of the xml too.
By the time i tried extending the RBDispatcherServlet to the DWRFacade class, but that too doesn't work.
Can you please tell me what is wrong in my deeds?
Don't get me started about those stupid light bulbs.