[
http://jira.jboss.com/jira/browse/JBSEAM-570?page=comments#action_12351015 ]
Alexandre Touret commented on JBSEAM-570:
-----------------------------------------
Hello,
Why do you say this is not a bug in seam ?
I dont understand. I suppose the scanner classloading doesnt load ejb entities in the
classpath before the current class directory.
Regards,
Alexandre Touret
The persistence manager doesnt find EJB3 entities when testclasses
and ejbs are separated
-----------------------------------------------------------------------------------------
Key: JBSEAM-570
URL:
http://jira.jboss.com/jira/browse/JBSEAM-570
Project: JBoss Seam
Issue Type: Bug
Components: EJB3
Affects Versions: 1.1.0.CR2
Environment: JBOSS AS 4.0.5GA
JDK 1.5
Reporter: Alexandre Touret
Attachments: booking.tgz
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
Maven separates classes build directory and test build directory.
I have this directory layout:
target/classes --> EJB builds
target/test-classes
/ejb-container
testcases classes built
/micro-container
/resources files
When I start a test which seems like BookingTest (in sample booking) everything works
fine, but when I start BookingUnitTest, the persistencemanager doesnt find the entity
I have this error:
javax.persistence.PersistenceException: org.hibernate.hql.ast.QuerySyntaxException: Hotel
is not map
ped [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)
Regards,
Alexandre Touret
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira