X cannot be added because it is already mapped to the entities. X entity class and the entity is not in current project source

大憨熊 提交于 2019-12-21 16:49:47

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!