2 Replies Latest reply on Jul 13, 2013 1:22 AM by jaikiran pai

    org.hibernate.hql.internal.ast.QuerySyntaxException: <Classname> is not mapped

    Ankur Goel Newbie

      Hi ,


      I  am trying to deploy an application using spring roo which deploys and works fineon Tomcat 7.

      Also I have succeessfully deployed that application on Jboss  As 7.1.1.Final.


      However , when I  try to use the application ,  it tries to run a JPA query , and gives following exception :

      org.hibernate.hql.internal.ast.QuerySyntaxException: Resource is not mapped.


      I have following class which I am am mapping to a table as follows :


      @RooJpaActiveRecord(versionField = "", table = "resource", finders = { "findResourcesByYashEmpIdEquals", "findResourcesByEmailIdEquals", "findResourcesByCurrentReportingManager", "findResourcesByCurrentReportingManagerTwo", "findResourcesByUserNameEquals" })


      public class Resource implements Comparable<com.yash.rms.domain.Resource>, UserDetails, Serializable {



          private MultipartFile file;



          private List<GrantedAuthority> authorities = new ArrayList<GrantedAuthority>();







      My Code is using the follwing query to map  get the Resource Entity :

              EntityManager em = Resource.entityManager();

              TypedQuery<Resource> q = em.createQuery("SELECT o FROM Resource AS o WHERE LOWER(o.userName) = :userName", Resource.class);



      It appears that Jboss is not processing the Entity annotations (@RooJpaActiveRecord) , so that it can map the Resource class to resource table.


      Can anyone please help me to resolve this issue .


      I am attaching following file here :

      1. jboss-web.xm






      7.deployment.log -> logs from server.log for deployment of my application.


      Let me know if I am missing any configurations in configuration files.