[JBoss Seam] - [Booking Demo - Unit Test] The persistence manager doesnt fi
by littlewing1112
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
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3991731#3991731
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3991731
19 years, 4 months
[JBoss Seam] - Re: Possible component.xml problem in 1.1.0 CR2
by quilleashm
Tested without javaassist present
| SEVERE: Exception sending context initialized event to listener instance of class org.jboss.seam.servlet.SeamListener
| java.lang.NoClassDefFoundError: javassist/bytecode/ClassFile
| at org.jboss.seam.deployment.Scanner.<init>(Scanner.java:39)
| at org.jboss.seam.deployment.Scanner.<init>(Scanner.java:32)
| at org.jboss.seam.deployment.NamespaceScanner.<init>(NamespaceScanner.java:19)
| at org.jboss.seam.init.Initialization.addNamespaces(Initialization.java:546)
| at org.jboss.seam.init.Initialization.<init>(Initialization.java:79)
| at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:65)
| at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3826)
| at org.apache.catalina.core.StandardContext.start(StandardContext.java:4335)
| at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
| at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
| at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
| at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:625)
| at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:552)
| at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:487)
| at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1137)
| at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:310)
| at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
| at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1021)
| at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
| at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1013)
| at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442)
| at org.apache.catalina.core.StandardService.start(StandardService.java:450)
| at org.apache.catalina.core.StandardServer.start(StandardServer.java:709)
| at org.apache.catalina.startup.Catalina.start(Catalina.java:551)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287)
| at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:412)
|
Looks good to me. Thanks for the quick fix.
Cheers.
Mike.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3991726#3991726
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3991726
19 years, 4 months