Results 1 to 4 of 4

Thread: Spring Doesn't Stop C3P0 Threads when Undeployed

  1. #1
    Join Date
    May 2006
    Posts
    28

    Default Spring Doesn't Stop C3P0 Threads when Undeployed

    I have a problem with a webapp that uses Spring 2.0.7 and C3P0. The webapp works fine, until I undeploy it. After the webapp is undeployed I start to see this error message in the tomcat log file.

    Code:
    Exception in thread "Timer-1" java.lang.NullPointerException
            at com.mchange.v2.log.log4j.Log4jMLog$Log4jMLogger.isLoggable(Log4jMLog.java:252)
            at com.mchange.v2.resourcepool.BasicResourcePool$CheckIdleResourcesTask.run(BasicResourcePool.java:1342)
            at java.util.TimerThread.mainLoop(Timer.java:512)
            at java.util.TimerThread.run(Timer.java:462)
    I have reported this problem to the C3P0 project, but they indicate that C3P0 is working correctly, Spring just isn't shutting down C3P0 correctly when the webapp is undeployed. http://sourceforge.net/tracker/index...&a tid=383690

    Is anyone else dealing with this issue?

    Has anyone fixed this issue?
    Last edited by stevewickii; May 30th, 2008 at 03:27 PM.

  2. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,695

    Default

    Never seen this issue. Can you post your configuration. You have to specify a destroy method on the c3p0 configuration, so that that will be called during shutdown. If you don't you can run in all sorts of issues.
    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
    Join Date
    Sep 2009
    Location
    Sydney, Australia
    Posts
    1

    Default

    Stevewickii, I am experiencing the same problem. Have you found the solution?

  4. #4
    Join Date
    May 2006
    Posts
    28

    Default

    I think i needed to add destroy-method="close" to my <bean> definition.

    Hope that helps.

    God bless you.

    Stephen

Posting Permissions

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