We used Hibernate containers in the spring application. Data portability is performed by the Java Persistence API using EntityManagerFactory, which is entered through the xml context.
When we switched to Hibernate 4, the application does not stop when it is deployed to tomcat 7. The 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)
Can anyone suggest what might be the problem when stopping tomcat?
source share