Unknown entity bean class after hot deploy: netbeans 6.9 + glassfish 2.1 + eclipselink jpa 2.0

后端 未结 5 1585
挽巷
挽巷 2021-01-19 06:39

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

5条回答
  •  鱼传尺愫
    2021-01-19 07:01

    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

提交回复
热议问题