Moved EntityManagerFactory to a ServletContextListener so there is only EMF for the application and it is started when application is deployed.