December 18th, 2009
5:25 pm
Eclipse error “Class is listed in persistence.xml but not mapped”

Posted under Eclipse
Tags , , ,

Sometimes eclipse lists the following error in the problem view :-

Class xxx is listed in the persistence.xml file but is not mapped

This appears to be a synchronisation problem within Eclipse, as deleting the classes from persistence.xml and then adding them back by browsing with Eclipse’s own persistence.xml editor eliminates the problem, even though the resulting file is identical. Validating the original file did not solve the problem.

Even with the error listed, projects still run and build successfully, so the problem is not serious.

I have also had other cases where Eclipse has whinged about a perfectly good persistence.xml, and have in general just lived with it as it is not serious.

This is an important issue to be aware of though to prevent much head scratching when such a problem is believed to be a real error and is not!

No Comments »

Trackback URI | Comments RSS

Leave a Reply

You must be logged in to post a comment.