We have used Hibernate jars in spring application. Data persistence is done by Java Persistence API using EntityManagerFactory being injected via context xml.
When we switched to Hibernate 4, the application is not getting stopped when it is deployed in tomcat 7. Following is the error.
SEVERE: A child container failed during stop
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to stop component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/applicationName]
at java.util.concurrent.FutureTask$Sync.innerGet(Unknown Source)
at java.util.concurrent.FutureTask.get(Unknown Source)
at org.apache.catalina.core.ContainerBase.stopInternal(ContainerBase.java:1179)
at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
at org.apache.catalina.core.ContainerBase$StopChild.call(ContainerBase.java:1575)
at org.apache.catalina.core.ContainerBase$StopChild.call(ContainerBase.java:1564)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: org.apache.catalina.LifecycleException: Failed to stop component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/applicationName]
at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:236)
... 7 more
Caused by: org.hibernate.HibernateException: registry does not contain entity manager factory: persistence-unit-name
at org.hibernate.ejb.internal.EntityManagerFactoryRegistry.removeEntityManagerFactory(EntityManagerFactoryRegistry.java:117)
at org.hibernate.ejb.EntityManagerFactoryImpl.close(EntityManagerFactoryImpl.java:195)
Could anyone suggest what could be the problem in stopping tomcat??