When I deploy my app, it works perfectly until I make a change, save, and netbeans hot deploys the application. At this point I get an unknown entity bean class error on a c
I also got this problem in a web service that fetches data from database. I opted two solutions:- (1) Solution was to put a method in webservice like @PreDestroy public void destruct()==> Here i closed EntityManagerFactory (2) Introduced a listener ServletContextListener and closed open emf here also in case webservice method could not work due to any reason.
Because server-restart for re-deployment is not acceptable, I wanted to be on safer side,closing emf twice in case it remains open it has chance to get closed in listener.
Thanks Nitin