3 Replies Latest reply on Apr 17, 2013 11:42 PM by Nitin Jain

    Mulitiple EJB3.0 JARs on JBoss7.1.3 - Named query not found

    Nitin Jain Newbie

      Hello Forum,

       

      I am migrating an application from jboss-5.1.0.GA to jboss-eap-6.0.1 (AS 7.1.3.Final-redhat-4).

       

      When the EAR that contains multiple EJB3.0 specific JAR files (each EJB JAR file contains "persistence.xml") is deployed in jboss-5.1.0.GA, the named queries can be invoked successfully. While the deployment of the EAR is successful in jboss-eap-6.0.1, the finder methods invoking named queries fail with the following exception. 

      Caused by: java.lang.IllegalArgumentException: Named query not found: Company.findByName

      at org.hibernate.ejb.AbstractEntityManagerImpl.createNamedQuery(AbstractEntityManagerImpl.java:601)

      at org.jboss.as.jpa.container.AbstractEntityManager.createNamedQuery(AbstractEntityManager.java:356)

       

       

      Please advise why this exception is happening and what may be a probable solution.

       

      Thank you.

       

      Best Regards,

      Nitin