Combining Two Java Applications Kills the SessionFactory?

udcsite used Ask the Experts™
We've been trying to combine two long-running applications of ours into a single application.  The applications use Hibernate 3, ehcache 1.2, and Spring Framework 1.2.5.

The combined application starts out just fine, but when a user moves from the "first" application to a page from the "second" application a few things happen in quick sequence.  The first and probably root issue is that the SessionFactory closes:

2010-01-27 11:28:46,602 INFO [org.hibernate.impl.SessionFactoryImpl] - <closing>

This in turn seems to kill ehcache since visiting any other page produces an error about the cache not being alive:

2010-01-26 17:55:43,211 ERROR [...] - <java.lang.IllegalStateException: The
STATIC_CACHE Cache is not alive.>
2010-01-26 17:55:51,572 ERROR [org.springframework.web.servlet.DispatcherServlet] - <Could not complete request>
java.lang.IllegalStateException: The DATASHEET_CACHE Cache is not alive.
        at net.sf.ehcache.Cache.checkStatus(
        at net.sf.ehcache.Cache.removeAll(
        at ....cleardatacache(
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(
        at java.lang.reflect.Method.invoke(
        at org.springframework.web.servlet.mvc.multiaction.MultiActionController.invokeNamedMethod(
        at org.springframework.web.servlet.mvc.multiaction.MultiActionController.handleRequestInternal(
        at org.springframework.web.servlet.mvc.AbstractController.handleRequest(
        at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(
        at org.springframework.web.servlet.DispatcherServlet.doDispatch(
        at org.springframework.web.servlet.DispatcherServlet.doService(
        at org.springframework.web.servlet.FrameworkServlet.processRequest(
        at org.springframework.web.servlet.FrameworkServlet.doGet(
        at javax.servlet.http.HttpServlet.service(
        at javax.servlet.http.HttpServlet.service(
        at com.evermind._ha.doFilter(Unknown Source)
        at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(
        at com.evermind._csb._pvd(Unknown Source)
        at com.evermind._csb._boc(Unknown Source)
        at com.evermind._ax._lsc(Unknown Source)
        at com.evermind._ax._uab(Unknown Source)
        at Source)

Any ideas on where to start looking?  I can't find any explicit references in the code to killing or closing the session, so I'm guessing that I'm triggering something in Hibernate?
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Fixed with an upgrade to Hibernate 3.3.2 and a recompile.
Nice... the same explained in the forum.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial