问题
I'm creating a new NetBeans EE Enterprise Application, and when I try to create Entity classes from database (Customer from the sample database), I can't select it because of this error :

Any idea? I'm using NetBeans 7.3 with Glassfish 3.1.2.
回答1:
I found the answer after spending the last few hours searching in Google. Delete the cache folder in the following
C:\Users\yourusername\AppData\Local\NetBeans\Cache
It solved the problem for me.
回答2:
In case of NetBeans for Linux the answer of @Lawrence Wong applies too; but the cache folder is located in
~/.cache/netbeans
(at least in Fedora).
In my case, the problem was probably caused by assigning an Entity Class from a database in a test project that no longer exists.
来源:https://stackoverflow.com/questions/21207398/x-cannot-be-added-because-it-is-already-mapped-to-the-entities-x-entity-class-a