• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

No WebApplicationContext found: no ContextLoaderListener registered?

 
samir ware
Ranch Hand
Posts: 192
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Ranchers,
I am novice to spring and I am getting the error at server start up whenever I try to start tomcat .
No WebApplicationContext found: no ContextLoaderListener registered?
Can anybody please tell me the reason for the same . The code which I am trying to invoke is as follows

When I google for the same , I got the information to put an entry in web.xml as follows

Even after making this entry its failing. What is the purpose of this entry in web.xml. why one should make this entry ? Is there anything else required apart from this entry in weblxml ? I suspect it also requirs the contextConfigLocation as context parameter ? What should be its value if at all its required ?

 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That entry in the web.xml is used to start up the Spring applicationContext when the web app is started.

What application server/version are you using? ContextLoaderListener works with app servers that follow the Servlet 2.4 spec, and some that follow the Servlet 2.3 spec - otherwise you have to use a servlet that is configured to load on startup before any others - in this case you would use Spring's ContextLoaderServlet class. The JavaDoc for ContextLoaderServlet lists specific application servers and versions.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic