java.lang.IllegalStateException: ApplicationObjectSupport instance

Usually the above exception is thrown in Spring based web applications. One of the main reason is the usage of getServletContext() method. This method is available by default to any Servlet or Spring controller. If the class which is making a call to getServletContext() should be part of Spring's WebApplicationContext.

In other sense a bean for that class should be declared in Spring's application config file and a specific instance from Spring's Application Context should be used.
Another alternative is to use request.getSession().getServletContext(),if HttpServletRequest is available in that class's method.

Search