title: Grails 2.X with Websphere 8.5-java.lang.IllegalStateException No Factories configured for this Application
body: <blockquote>
    <p>I am using Grails 2.3.6.For local development ,I am using the embedded tomcat server but for our integration environment ,we use Websphere 8.5.5.I have no JSF in my application .So this log is confusing to me :</p>
  </blockquote>
  
  <p>ERROR webcontainer.webapp - SRVE0285E: Exception caught while destroying context: {0}
  java.lang.IllegalStateException: No Factories configured for this Application. This happens if the faces-initialization does not work at all - make sure that you properly include all configuration settings necessary for a basic faces application and that all the necessary libs are included. Also check the logging output of your web application and your container for any exceptions!
  If you did that and find nothing, the mistake might be due to the fact that you use some special web-containers which do not support registering context-listeners via TLD files and a context listener is not setup in your web.xml.
  A typical config looks like this;
  
    org.apache.myfaces.webapp.StartupServletContextListener
  </p>
  
  <pre><code>at javax.faces.FactoryFinder._getFactory(FactoryFinder.java:308)
  at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:228)
  at org.apache.myfaces.context.servlet.FacesContextImplBase.getApplication(FacesContextImplBase.java:169)
  at org.apache.myfaces.webapp.AbstractFacesInitializer._dispatchApplicationEvent(AbstractFacesInitializer.java:329)
  at org.apache.myfaces.webapp.AbstractFacesInitializer.destroyFaces(AbstractFacesInitializer.java:364)
  at org.apache.myfaces.webapp.StartupServletContextListener.contextDestroyed(StartupServletContextListener.java:161)
  at com.ibm.ws.webcontainer.managedobject.ManagedObjectListenerWrapper.contextDestroyed(ManagedObjectListenerWrapper.java:138)
  at com.ibm.ws.webcontainer.webapp.WebApp.notifyServletContextDestroyed(WebApp.java:1899)
  at com.ibm.ws.webcontainer.webapp.WebApp.destroy(WebApp.java:3320)
  at com.ibm.ws.webcontainer.webapp.WebAppImpl.destroy(WebAppImpl.java:1574)
  at com.ibm.ws.container.AbstractContainer.destroy(AbstractContainer.java:75)
  at com.ibm.ws.webcontainer.webapp.WebGroup.destroy(WebGroup.java:228)
  at com.ibm.ws.webcontainer.webapp.WebGroup.removeWebApplication(WebGroup.java:269)
  at com.ibm.ws.webcontainer.VirtualHost.removeWebApplication(VirtualHost.java:305)
  at com.ibm.ws.webcontainer.VirtualHostImpl.removeWebApplication(VirtualHostImpl.java:234)
  at com.ibm.ws.webcontainer.WSWebContainer.removeWebApplication(WSWebContainer.java:975)
  at com.ibm.ws.webcontainer.component.WebContainerImpl.uninstall(WebContainerImpl.java:459)
  at com.ibm.ws.webcontainer.component.WebContainerImpl.stop(WebContainerImpl.java:730)
  at com.ibm.ws.runtime.component.ApplicationMgrImpl.stop(ApplicationMgrImpl.java:1288)
  at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStop(DeployedApplicationImpl.java:1519)
  at com.ibm.ws.runtime.component.DeployedModuleImpl.stop(DeployedModuleImpl.java:736)
  at com.ibm.ws.runtime.component.DeployedApplicationImpl.stop(DeployedApplicationImpl.java:1293)
  at com.ibm.ws.runtime.component.ApplicationMgrImpl.stopApplication(ApplicationMgrImpl.java:975)
  at com.ibm.ws.runtime.component.ApplicationMgrImpl.stop(ApplicationMgrImpl.java:935)
  at com.ibm.ws.runtime.component.ContainerHelper.stopComponent(ContainerHelper.java:477)
  at com.ibm.ws.runtime.component.ContainerHelper.stopComponents(ContainerHelper.java:461)
  at com.ibm.ws.runtime.component.ContainerImpl.stopComponents(ContainerImpl.java:650)
  at com.ibm.ws.runtime.component.ContainerImpl.stop(ContainerImpl.java:638)
  at com.ibm.ws.runtime.component.ApplicationServerImpl.stop(ApplicationServerImpl.java:286)
  at com.ibm.ws.runtime.component.ContainerHelper.stopComponent(ContainerHelper.java:477)
  at com.ibm.ws.runtime.component.ContainerHelper.stopComponents(ContainerHelper.java:461)
  at com.ibm.ws.runtime.component.ContainerImpl.stopComponents(ContainerImpl.java:650)
  at com.ibm.ws.runtime.component.ContainerImpl.stop(ContainerImpl.java:638)
  at com.ibm.ws.runtime.component.ServerImpl.stop(ServerImpl.java:672)
  at com.ibm.ws.runtime.component.ServerCollaborator$ShutdownHook$1.run(ServerCollaborator.java:917)
  at com.ibm.ws.security.auth.ContextManagerImpl.runAs(ContextManagerImpl.java:5398)
  at com.ibm.ws.security.auth.ContextManagerImpl.runAsSystem(ContextManagerImpl.java:5614)
  at com.ibm.ws.runtime.component.ServerCollaborator$ShutdownHook.run(ServerCollaborator.java:907)
  at com.ibm.ws.runtime.component.ServerCollaborator$StopAction.alarm(ServerCollaborator.java:859)
  at com.ibm.ejs.util.am._Alarm.runImpl(_Alarm.java:151)
  at com.ibm.ejs.util.am._Alarm.run(_Alarm.java:136)
  at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1909)
  </code></pre>