{"id":128,"date":"2016-02-17T12:19:40","date_gmt":"2016-02-17T11:19:40","guid":{"rendered":"https:\/\/www.schoenberg-solutions.de\/arndtblog\/?p=128"},"modified":"2022-12-04T12:20:52","modified_gmt":"2022-12-04T11:20:52","slug":"spooky-exceptions-2-param_name-in-the-querys-selection-criteria-does-not-match-any-parameter-name-defined-in-the-query","status":"publish","type":"post","link":"https:\/\/www.schoenberg-solutions.de\/arndtblog\/?p=128","title":{"rendered":"Spooky Exceptions (2) &#8211; &#8230; [param_name] in the query&#8217;s selection criteria does not match any parameter name defined in the query"},"content":{"rendered":"\n<p>Die Anwendung, bei deren Entwicklung die Exception aufgetreten ist, basiert auf<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Java 8<\/li>\n\n\n\n<li>Wildfly 10.x<\/li>\n\n\n\n<li>Eclipselink<\/li>\n\n\n\n<li>Postgres 9.x<\/li>\n<\/ul>\n\n\n\n<p>Folgende Exception wurde bei einer JPA Suchanfrage geworfen<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">08:22:42,625 ERROR [org.jboss.as.ejb3.invocation] (default task-16) WFLYEJB0034: EJB Invocation failed on \ncomponent DeliveryAraeaFacade for method public java.util.List de.schoeso.desy.ejb.facade.ops.DeliveryAraeaFacade.findByVariousParameters(\nde.schoeso.desy.ejb.entity.org.unit.UnitOfOrganisationDepot,boolean): \njavax.ejb.EJBException: javax.persistence.PersistenceException: Exception [EclipseLink-6094] (Eclipse Persistence Services - 2.6.2.v20151217-774c696): \norg.eclipse.persistence.exceptions.QueryException\nException Description: The parameter name [mandator_id] in the query's selection criteria does not match any parameter name defined in the query.\nQuery: ReadObjectQuery(name=\"depot\" referenceClass=UnitOfOrganisationDepot sql=\"SELECT t0.dtype, t0.care_of, ... \nWHERE (((t0.mandator_id = ?) AND (t0.unit_id = ?)) AND (((t1.mandator_id = t0.mandator_id) AND (t1.unit_id = t0.unit_id)) AND (t0.dtype = ?)))\")\n\tat org.jboss.as.ejb3.tx.CMTTxInterceptor.handleExceptionInNoTx(CMTTxInterceptor.java:213)\n\tat org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInNoTx(CMTTxInterceptor.java:265)\n\tat org.jboss.as.ejb3.tx.CMTTxInterceptor.notSupported(CMTTxInterceptor.java:313)\n\tat org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:237)\n<\/pre>\n\n\n\n<p>In diesem Beispiel wurde eine JPA Query f\u00fcr die Klasse DeliveryAraea abgesetzt. Ursache f\u00fcr den Fehler ist, dass DeliveryAraea auf ein Objekt vom Typ Depot verweist und in den Join Columns zwei Attribute angegeben wurden. Das Attribut mandator_id wurde allerdings versehentlich mit<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">, insertable = false, updatable = false\n<\/pre>\n\n\n\n<p>versehen, ohne dass dieses Attribut an anderer Stelle geschrieben wurde. Hierdurch wird von dem JPA Provider der Parameter bei der Erstellung der SQL Abfrage nicht gefunden. Wird diese falsche Konfiguration gel\u00f6scht, funktioniert die Anfrage erwartungsgem\u00e4\u00df.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Die Anwendung, bei deren Entwicklung die Exception aufgetreten ist, basiert auf Folgende Exception wurde bei einer JPA Suchanfrage geworfen 08:22:42,625 ERROR [org.jboss.as.ejb3.invocation] (default task-16) WFLYEJB0034: EJB Invocation failed on component DeliveryAraeaFacade for method public java.util.List de.schoeso.desy.ejb.facade.ops.DeliveryAraeaFacade.findByVariousParameters( de.schoeso.desy.ejb.entity.org.unit.UnitOfOrganisationDepot,boolean): javax.ejb.EJBException: javax.persistence.PersistenceException: Exception [EclipseLink-6094] (Eclipse Persistence Services &#8211; 2.6.2.v20151217-774c696): org.eclipse.persistence.exceptions.QueryException Exception Description: The parameter name [mandator_id] in the [&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-128","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\/128","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=128"}],"version-history":[{"count":1,"href":"https:\/\/www.schoenberg-solutions.de\/arndtblog\/index.php?rest_route=\/wp\/v2\/posts\/128\/revisions"}],"predecessor-version":[{"id":129,"href":"https:\/\/www.schoenberg-solutions.de\/arndtblog\/index.php?rest_route=\/wp\/v2\/posts\/128\/revisions\/129"}],"wp:attachment":[{"href":"https:\/\/www.schoenberg-solutions.de\/arndtblog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=128"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.schoenberg-solutions.de\/arndtblog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=128"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.schoenberg-solutions.de\/arndtblog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=128"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}