It is strange. If it was about this multi threading thing I think the close method would not been implemented right. It could wait till it is possible to close.
I wanted to use ServletContextListener to build session factory on contextInitialized and close it on contextDestroyed which I thought was a good idea.
I am learning hibernate and tried to use this setting:
to drop my schema after I stop Tomcat server.
But when I stop my Tomcat server it crashes.
Here are also the logs from log4j: