Exception:No WebApplicationContext found: no ContextLoaderListener registered?


      Click here to attend Spring Framework 4.x and certification course with a discount

If you get the following exception while configuring Spring Framework;

javax.servlet.ServletException: java.lang.IllegalStateException: No WebApplicationContext found: no ContextLoaderListener registered? com.vaadin.terminal.gwt.server.AbstractApplicationServlet.handleServiceException(AbstractApplicationServlet.java:1004) com.vaadin.terminal.gwt.server.AbstractApplicationServlet.service(AbstractApplicationServlet.java:548) javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

Before using WebApplicationContext, you should register the following listeners so that

Just add the following two lines for listeners in web.xml file under /WEB-INF/ folder of the project.

<listener>
   <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
</listener>

<listener> 
  <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s