java.lang.IllegalStateException: No WebApplicationContext found: initializer not registered?

  Written by The Jahia Team
   Estimated reading time:
7.0.0.6

The exception java.lang.IllegalStateException: No WebApplicationContext found: initializer not registered? is recurrent in the Jahia.log file (every 20 minutes). The stack trace is the following one:
 

2016-05-17 10:02:38,185: ERROR [RMI TCP Connection(7782)-172.21.192.1] org.springframework.web.servlet.DispatcherServlet: Context initialization failed
java.lang.IllegalStateException: No WebApplicationContext found: initializer not registered?
at org.springframework.web.servlet.FrameworkServlet.findWebApplicationContext(FrameworkServlet.java:562)
at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:517)
at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:462)
at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136)
at javax.servlet.GenericServlet.init(Unknown Source)
at org.apache.catalina.core.StandardWrapper.initServlet(Unknown Source)
at org.apache.catalina.core.StandardWrapper.loadServlet(Unknown Source)
at org.apache.catalina.core.StandardWrapper.allocate(Unknown Source)
at org.apache.catalina.core.StandardWrapper.isSingleThreadModel(Unknown Source)
at sun.reflect.GeneratedMethodAccessor103.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.tomcat.util.modeler.BaseModelMBean.getAttribute(Unknown Source)
at org.apache.tomcat.util.modeler.BaseModelMBean.getAttributes(Unknown Source)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getAttributes(DefaultMBeanServerInterceptor.java:709)
at com.sun.jmx.mbeanserver.JmxMBeanServer.getAttributes(JmxMBeanServer.java:705)
at com.sun.jmx.remote.security.MBeanServerAccessController.getAttributes(MBeanServerAccessController.java:330)
at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1468)
at javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:97)
at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1328)
at java.security.AccessController.doPrivileged(Native Method)
at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1427)
at javax.management.remote.rmi.RMIConnectionImpl.getAttributes(RMIConnectionImpl.java:693)
at sun.reflect.GeneratedMethodAccessor77.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:322)
at sun.rmi.transport.Transport$1.run(Transport.java:177)
at sun.rmi.transport.Transport$1.run(Transport.java:174)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:173)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:556)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:811)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:670)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)

 

Cause

The cause of this exception was found after adding some error traces in "spring-webmvc-3.2.8.RELEASE.jar.

The error revealed that the "ShindigDispatcherServlet" servlet was not initialized:

2016-06-08 12:15:51,690 [RMI TCP Connection(29)-172.21.128.1] ERROR org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/]- StandardWrapper.Throwable
java.lang.IllegalStateException: No WebApplicationContext found: initializer not registered for servlet ShindigDispatcherServlet?

 

Solution

The ShindigDispatcherServlet servlet is no longer available since Jahia 7.1.x.x

This servlet allowed to use the Apache Shinding container services (https://shindig.apache.org/). But this container has been retired on October 23, 2015. 

The references to this servlet should be commented in the web.xml file.