{"id":1142,"date":"2010-12-03T09:42:57","date_gmt":"2010-12-03T09:42:57","guid":{"rendered":"http:\/\/salientsoft.co.uk\/?p=1142"},"modified":"2010-12-03T09:46:07","modified_gmt":"2010-12-03T09:46:07","slug":"jpa-error-class-is-mapped-but-is-not-included-in-any-persistence-unit","status":"publish","type":"post","link":"https:\/\/salientsoft.co.uk\/?p=1142","title":{"rendered":"JPA error &ldquo;Class is mapped, but is not included in any persistence unit&rdquo;"},"content":{"rendered":"<p>I received this compile time error from Eclipse with one of my test projects which was previously fine, using Eclipse Helios with Eclipselink 2.1.0 (and container managed JPA in EJBs). The error occurred when I was autodiscovering the entities rather than listing them in persistence.xml explicitly, even when <strong><em>&lt;exclude-unlisted-classes&gt;false&lt;\/exclude-unlisted-classes&gt;<\/em><\/strong> was explicitly present.<\/p>\n<p>Supposedly, as the annotated entity sources for the classes are in a subfolder of the parent of the <em>META-INF<\/em> folder containing persistence.xml, they should be discovered automatically. Listing the fully qualified classes explicitly in <em>persistence.xml<\/em> solved the problem, however this is not ideal as it would mean having an alternative version of <em>persistence.xml<\/em> for testing.<\/p>\n<p>I googled for the problem but could not find a solution listed anywhere. For now this is just one to be aware of \u2013 I\u2019ll stick with listing the classes explicitly and look further for a solution later on as and when it becomes a nuisance!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I received this compile time error from Eclipse with one of my test projects which was previously fine, using Eclipse Helios with Eclipselink 2.1.0 (and container managed JPA in EJBs). The error occurred when I was autodiscovering the entities rather than listing them in persistence.xml explicitly, even when &lt;exclude-unlisted-classes&gt;false&lt;\/exclude-unlisted-classes&gt; was explicitly present. Supposedly, as the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[8],"tags":[13,35,40,182,16],"_links":{"self":[{"href":"https:\/\/salientsoft.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/1142"}],"collection":[{"href":"https:\/\/salientsoft.co.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/salientsoft.co.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/salientsoft.co.uk\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/salientsoft.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1142"}],"version-history":[{"count":2,"href":"https:\/\/salientsoft.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/1142\/revisions"}],"predecessor-version":[{"id":1144,"href":"https:\/\/salientsoft.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/1142\/revisions\/1144"}],"wp:attachment":[{"href":"https:\/\/salientsoft.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1142"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/salientsoft.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1142"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/salientsoft.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1142"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}