{"id":149,"date":"2018-05-18T09:15:52","date_gmt":"2018-05-18T07:15:52","guid":{"rendered":"https:\/\/www.schoenberg-solutions.de\/arndtblog\/?p=149"},"modified":"2022-12-05T09:16:10","modified_gmt":"2022-12-05T08:16:10","slug":"spooky-exceptions-8-exception-description-entity-class-class-has-no-primary-key-specified-it-should-define-either-an-id-embeddedid-or-an-idclass","status":"publish","type":"post","link":"https:\/\/www.schoenberg-solutions.de\/arndtblog\/?p=149","title":{"rendered":"Spooky Exceptions (8) &#8211; Exception Description: Entity class [class &#8230; ] has no primary key specified. It should define either an @Id, @EmbeddedId or an @IdClass"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Umgebung<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Wildfly 12<\/li>\n\n\n\n<li>EE7<\/li>\n\n\n\n<li>Eclipselink<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Situation<\/h2>\n\n\n\n<p>Bei der Pr\u00fcfung der persistence.xml beim Hochfahren des Servers wird folgende Exception geworfen:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"> \nInternal Exception: Exception [EclipseLink-7161] (Eclipse Persistence Services - 2.6.4.v20160829-44060b6): \norg.eclipse.persistence.exceptions.ValidationException\nException Description: Entity class [class ...] has no primary key specified. It should define either an @Id, @EmbeddedId or an @IdClass. \nIf you have defined PK using any of these annotations then make sure that you do not have mixed access-type \n(both fields and properties annotated) in your entity class hierarchy.\n<\/pre>\n\n\n\n<p>In unserem Fall lag dies daran, dass es sich bei der betroffenen Entit\u00e4t um eine Entit\u00e4t handelte, die aus einer anderen abgeleitet ist. Die Parent-Entity liegt in einer ausgelagerten jar Datei, die neben der Projekt-Ejb Datei verwendet wurde. In der application.xml wurde aber vergessen, die ausgelagerte Datei als ejb-Modul einzutragen. Dadurch konnte der Scanner die \u00fcbergeordnete Klasse nicht erkennen und hat die in ihr enthaltene Annotation nicht auswerten k\u00f6nnen.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Umgebung Situation Bei der Pr\u00fcfung der persistence.xml beim Hochfahren des Servers wird folgende Exception geworfen: Internal Exception: Exception [EclipseLink-7161] (Eclipse Persistence Services &#8211; 2.6.4.v20160829-44060b6): org.eclipse.persistence.exceptions.ValidationException Exception Description: Entity class [class &#8230;] has no primary key specified. It should define either an @Id, @EmbeddedId or an @IdClass. If you have defined PK using any of these [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,7],"tags":[],"class_list":["post-149","post","type-post","status-publish","format-standard","hentry","category-jee","category-wildfly"],"_links":{"self":[{"href":"https:\/\/www.schoenberg-solutions.de\/arndtblog\/index.php?rest_route=\/wp\/v2\/posts\/149","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.schoenberg-solutions.de\/arndtblog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.schoenberg-solutions.de\/arndtblog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.schoenberg-solutions.de\/arndtblog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.schoenberg-solutions.de\/arndtblog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=149"}],"version-history":[{"count":1,"href":"https:\/\/www.schoenberg-solutions.de\/arndtblog\/index.php?rest_route=\/wp\/v2\/posts\/149\/revisions"}],"predecessor-version":[{"id":150,"href":"https:\/\/www.schoenberg-solutions.de\/arndtblog\/index.php?rest_route=\/wp\/v2\/posts\/149\/revisions\/150"}],"wp:attachment":[{"href":"https:\/\/www.schoenberg-solutions.de\/arndtblog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=149"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.schoenberg-solutions.de\/arndtblog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=149"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.schoenberg-solutions.de\/arndtblog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=149"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}