Announcement Announcement Module
Collapse
No announcement yet.
Spring Data Repository causes Server Tomcat error on shut down - how to prevent? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring Data Repository causes Server Tomcat error on shut down - how to prevent?

    My tomcat app is issuing this error on shut down. The message refers to my use of Spring Data Repository "findBy". Why are these occurring and how can I get ride of them?


    Code:
    SEVERE: The web application [] created a ThreadLocal with key of type [org.springframework.core.NamedThreadLocal] (value [Transactional resources]) and a value of type [java.util.HashMap] (value [{public abstract java.util.List com.xxx.xxx.repository.xxx.findByxxx(com.xxx.xxx.domain.xxx)=java.lang.Object@722d5f24, public abstract java.util.List com.xxx.xxx.repository.xxx.findByxxx(java.lang.String)=java.lang.Object@722d5f24, public abstract java.lang.Object org.springframework.data.repository.CrudRepository.findOne(java.io.Serializable)=java.lang.Object@722d5f24}]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
    Environment includes:
    - Tomcat 7.0.22
    - STS 3.0.0
    - Roo 1.2

  • #2
    Although the message level might indicate otherwise it is nothing more than a warning issued by the memory-leak detection in Tomcat. So it is not really an error just an indication that something might be better off being cleaned up but.

    Comment


    • #3
      Ok, thanks.

      What would a better cleanup look like?

      Comment


      • #4
        Nothing that you can do (unless you would create your own ServletContextListener and implement the contextDestroyed method (maybe an ApplicationListener can also work) which cleans up after Spring Data. However this is probably something the Spring Data team has to do.

        I just wanted to indicate that it is not something you should worry or panic about (when deploying to another server you will not see this).

        Comment


        • #5
          Great, thanks for the advice

          Comment

          Working...
          X