Combining Two Java Applications Kills the SessionFactory?

udcsite
udcsite used Ask the Experts™
on
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(Cache.java:1062)
        at net.sf.ehcache.Cache.removeAll(Cache.java:924)
        at ....cleardatacache(ClearCacheController.java:47)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.springframework.web.servlet.mvc.multiaction.MultiActionController.invokeNamedMethod(MultiActionController.java:403)
        at org.springframework.web.servlet.mvc.multiaction.MultiActionController.handleRequestInternal(MultiActionController.java:358)
        at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:139)
        at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:44)
        at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:684)
        at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:625)
        at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:392)
        at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:347)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:241)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:333)
        at com.evermind._ha.doFilter(Unknown Source)
        at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:738)
        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 com.evermind._bf.run(Unknown 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?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
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