Good day.

I have a web application of the following composition: Maven, Spring Framework, Spring MVC, Spring Security, JSP, Hibernate, works on the Pivotal tc Server (included in the Spring Tool Suite, the same Tomcat).

As you know, if, while the application is running, you edit the sources and save them, the application will restart. JSP pages are compiled on the fly, and therefore editing the application does not reload.

So, when the application is running, I edit JSP and save it several times. Everything is fine, but after a while (an hour or two or five minutes), the application spontaneously restarts, and issues

org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'customUserDetailsService' is defined 

Of course, before this bin was in place. This bin is needed for Spring Security, as can be seen from the name. I suspect that it is Spring that loads it in the first place, and if it were not there, he would have stumbled on the following.

Rebooting the server, all is well. Sometimes it doesn't help, you have to do the Maven Update Project. Sometimes this does not help, you have to delete the application from the server and add it there again.

Moreover, a couple of times the application just did not want to run with the same error.

What is it? Configuration problem? Conflict contexts?

  • one
    In general, Tomcat has a large number of settings . Maybe your server is pre-configured otherwise. Look at the debug of Tomcat itself (not Spring), maybe there is something sensible there? - enzo
  • thanks, mb will help - naiad09

0