2 Replies Latest reply on Dec 2, 2011 11:10 AM by robert walker

    jboss7 and it's included hibernate giving "Cannot create TypedQuery for query with more than one return" error

    robert walker Newbie

      Hi all, I am getting the "Cannot create TypedQuery for query with more than one return" error that was fixed in release 3.6.8 (HHH-6591) when running my JPA2 (hibernate provider)  application under jboss7 (7.0.2)

       

      my application does not contain any hibernate jars in it's WEB-INF\lib directory, and solely depends on jboss hibernate jars


      I can do some queries, but not this one

       

      @NamedQuery(name = "Carrier.findAllCarriers", query = "SELECT c, ir21.version, ir21.subVersion, ir21.updatedDatetime, ir21.userVdas.userId FROM Carrier c, Ir21Data ir21"),
         
      em.createNamedQuery("Carrier.findAllCarriers", Carrier.class).getResultList();

       

          

      I get the TypedQuery error :-(

       

      I think jboss7 is using the latest hibernate (and not a version that is known to yield the above error)

      because I see the following jar in it's modules dir


      jboss_home\modules\org\jboss\as\jpa\hibernate\3\jboss-as-jpa-hibernate3-7.0.2.Final.jar
      jboss_home\modules\org\jboss\as\jpa\hibernate\4\jboss-as-jpa-hibernate4-7.0.2.Final.jar

       

      and

       

      jboss_home\modules\org\hibernate\main\hibernate-core-4.0.0.CR2.jar
      jboss_home\modules\org\hibernate\main\hibernate-commons-annotations-4.0.0.CR2.jar
      jboss_home\modules\org\hibernate\main\hibernate-entitymanager-4.0.0.CR2.jar
      jboss_home\modules\org\hibernate\main\hibernate-infinispan-4.0.0.CR2.jar


      can someon help me and tell me how I can execute the namedquery?

       

      thanks

       

       

      13:48:48,568 SEVERE [javax.enterprise.resource.webcontainer.jsf.application] (http--127.0.0.1-8080-1) Error Rendering View[/administration/carrier.xhtml]: javax.faces.FacesException: javax.el.ELException: /administration/carrier.xhtml @26,29 value="#{carrierController.carrierList}": javax.ejb.EJBException: java.lang.IllegalArgumentException: Cannot create TypedQuery for query with more than one return

              at javax.faces.component.UIComponentBase$AttributesMap.get(UIComponentBase.java:2346) [jboss-jsf-api_2.1_spec-2.0.0.Beta1.jar:2.0.0.Beta1]

              at org.richfaces.DataScrollerUtils.eval(DataScrollerUtils.java:86) [richfaces-components-ui-4.1.0-20111026.142033-173.jar:]