3 Replies Latest reply on Oct 5, 2007 3:39 PM by Farrukh Najmi

    [Booking Demo - Unit Test] The persistence manager doesnt fi

    Alexandre Touret Newbie

      Hello,
      I m currently testing Seam. The samples bundled (expecially BookingUnitTest) with the distribution work but notin my environment:
      1- I splitted the sample in order to "be mavenized"
      2- I changed the database to postgreSQL
      3- add one more table
      4- move queries to namedqueries

      All the testcases work fine except the BookingUnitTest . This is really strange because, BookingTest runs fine.

      It seems the entitymanager doesnt find entities. I always have this kind of error:

      javax.persistence.PersistenceException: org.hibernate.hql.ast.QuerySyntaxException: Hotel is not mapped [from Hotel]
       at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:567)
       at org.hibernate.ejb.AbstractEntityManagerImpl.createQuery(AbstractEntityManagerImpl.java:79)
       at org.jboss.seam.example.booking.test.BookingUnitTest.testHotelBooking(BookingUnitTest.java:61)
      Caused by: org.hibernate.hql.ast.QuerySyntaxException: Hotel is not mapped [from Hotel]
       at org.hibernate.hql.ast.util.SessionFactoryHelper.requireClassPersister(SessionFactoryHelper.java:158)
       at org.hibernate.hql.ast.tree.FromElementFactory.addFromElement(FromElementFactory.java:87)
       at org.hibernate.hql.ast.tree.FromClause.addFromElement(FromClause.java:70)
       at org.hibernate.hql.ast.HqlSqlWalker.createFromElement(HqlSqlWalker.java:267)
       at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElement(HqlSqlBaseWalker.java:3049)
       at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElementList(HqlSqlBaseWalker.java:2938)
       at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromClause(HqlSqlBaseWalker.java:688)
       at org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:544)
       at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:281)


      But a couple of lines ahead I have this line :

      INFO] AnnotationBinder - Binding entity from annotated class: org.jboss.seam.example.booking.Hotel


      Does boookingUnitTest call an another mechanism than BookinTest ??

      Thanks in advance for your help!

      Regards,
      Alexandre