Results 1 to 5 of 5

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

  1. #1

    Default 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. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,632

    Default

    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.
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  3. #3

    Default

    Ok, thanks.

    What would a better cleanup look like?

  4. #4
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,632

    Default

    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).
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  5. #5

    Default

    Great, thanks for the advice

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •