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
Although it is not apparent from the posted code if this is the solution but symptoms are the same.
It seems to happen when creating entity manager from entity manager factory outside of the container. The factory needs to be closed on un-deploying. That is why it works only first time when deployed and not on redeploy. See: Unknown entity bean class issue with glassfish v3