Announcement Announcement Module
Collapse
No announcement yet.
ehcache.jar held up after application undeployed Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • ehcache.jar held up after application undeployed

    I know this is more likely a hibernate question but didn't want to post on the hibernate forum and get scorned at...

    I'm migrating this application from Spring MVC to Spring Portlet and deploying it to jetspeed2/tomcat. It uses hibernate which uses ehcache.jar.

    The problem happens everytime when the application is undeployed while the server is running. Tomcat would delete the exploded war directory, except WEB-INF/lib/ehcache.jar. If I try to delete it manually while tomcat is still running, I get the "used by another process" Windows error.

    I didn't have this problem until the application was ported to portlets, so this may have to do with jetspeed. Has anybody seen anything like this before?
    Thanks.

  • #2
    can you move ehcache in a different place in the server main lib directory? This types of error usually occur when classes are still hanging somewhere and there is a lock on the jar file.
    As EhCache is a singleton there is a chance that the cache manager is not shutdown so the jar is still needed. You can also try to play with the lockjar settings from Tomcat or/and call GC() manually .

    Comment


    • #3
      Originally posted by costin
      can you move ehcache in a different place in the server main lib directory? This types of error usually occur when classes are still hanging somewhere and there is a lock on the jar file.
      I knew I could move the jar to shared/lib, but it was going to be my last resort for the obvious reason.

      Originally posted by costin
      As EhCache is a singleton there is a chance that the cache manager is not shutdown so the jar is still needed. You can also try to play with the lockjar settings from Tomcat or/and call GC() manually .
      antiJarLocking is already set to true in context.xml. But you reminded me that the jetspeed jars are in shared/lib, so if they hang on to something from a webapp classloader, with tomcat's reversed classloading delegation...

      Thanks!

      Comment


      • #4
        I would keep ehcache.jar in your application's WEB-INF/lib directory.

        Try adding antiResourceLocking to your context.xml file:

        Code:
        <Context antiJARLocking="true" antiResourceLocking="true" />

        Comment


        • #5
          Open the ehcache.jar and copy the ehcache.xml from there into the root of your classpath (it's a config file for the cache - modify it if you like, but it's ok to keep the defaults).

          Comment

          Working...
          X