3 Replies Latest reply on Apr 23, 2007 7:12 PM by Jason Long

    seam-gen generate entities problem

    sstrenn Newbie

      I am trying out seam 1.2 and jboss 4.0.5 ejb. I setup a project with seam-gen that accesses a simple little mysql database with users and blogs. After I call seam generate-entities, and restart seam, I get the following error trace upon accessing the users page.

      In the example below, it appears that the User object "is not mapped", even though it has been generated by seam-gen. Same goes for my other domain objects.

      Any ideas as to what is wrong? BTW - same thing happens w/postgresql.


      08:05:54,875 ERROR [STDERR] Feb 15, 2007 8:05:54 AM com.sun.facelets.FaceletViewHandler handleRenderException
      SEVERE: Error Rendering View[/UserList.xhtml]
      javax.faces.el.EvaluationException: /UserList.xhtml @57,57 rendered="#{empty userList.resultList}": Exception getting value of property resultList of base of type : blogtest.UserList$$EnhancerByCGLIB$$ef8d664f
      at com.sun.facelets.el.LegacyValueBinding.getValue(LegacyValueBinding.java:60)
      at javax.faces.component.UIComponentBase.isRendered(UIComponentBase.java:1075)
      at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:241)
      at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:249)
      at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:573)
      at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.jboss.seam.servlet.SeamRedirectFilter.doFilter(SeamRedirectFilter.java:29)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.jboss.seam.servlet.SeamExceptionFilter.doFilter(SeamExceptionFilter.java:43)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
      at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
      at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
      at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
      at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
      at java.lang.Thread.run(Unknown Source)
      Caused by: javax.faces.el.EvaluationException: Bean: blogtest.UserList$$EnhancerByCGLIB$$ef8d664f, property: resultList
      at org.apache.myfaces.el.PropertyResolverImpl.getProperty(PropertyResolverImpl.java:442)
      at org.apache.myfaces.el.PropertyResolverImpl.getValue(PropertyResolverImpl.java:82)
      at com.sun.facelets.el.LegacyELContext$LegacyELResolver.getValue(LegacyELContext.java:141)
      at com.sun.el.parser.AstValue.getValue(AstValue.java:117)
      at com.sun.el.parser.AstEmpty.getValue(AstEmpty.java:49)
      at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:192)
      at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:71)
      at com.sun.facelets.el.LegacyValueBinding.getValue(LegacyValueBinding.java:56)
      ... 32 more
      Caused by: java.lang.reflect.InvocationTargetException
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.apache.myfaces.el.PropertyResolverImpl.getProperty(PropertyResolverImpl.java:438)
      ... 39 more
      Caused by: java.lang.IllegalArgumentException: org.hibernate.hql.ast.QuerySyntaxException: User is not mapped [select user from User user]
      at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:634)
      at org.hibernate.ejb.AbstractEntityManagerImpl.createQuery(AbstractEntityManagerImpl.java:95)
      at org.jboss.seam.framework.EntityQuery.createQuery(EntityQuery.java:104)
      at org.jboss.seam.framework.EntityQuery.getResultList(EntityQuery.java:40)
      at org.jboss.seam.framework.EntityQuery$$FastClassByCGLIB$$225925e6.invoke()
      at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
      at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:45)
      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:55)
      at org.jboss.seam.interceptors.OutcomeInterceptor.interceptOutcome(OutcomeInterceptor.java:21)
      at sun.reflect.GeneratedMethodAccessor105.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
      at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
      at org.jboss.seam.interceptors.RollbackInterceptor.rollbackIfNecessary(RollbackInterceptor.java:29)
      at sun.reflect.GeneratedMethodAccessor104.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
      at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
      at org.jboss.seam.interceptors.ConversationInterceptor.endOrBeginLongRunningConversation(ConversationInterceptor.java:52)
      at sun.reflect.GeneratedMethodAccessor103.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
      at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
      at org.jboss.seam.interceptors.TransactionInterceptor$1.work(TransactionInterceptor.java:28)
      at org.jboss.seam.util.Work.workInTransaction(Work.java:37)
      at org.jboss.seam.interceptors.TransactionInterceptor.doInTransactionIfNecessary(TransactionInterceptor.java:23)
      at sun.reflect.GeneratedMethodAccessor102.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
      at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
      at org.jboss.seam.interceptors.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:27)
      at sun.reflect.GeneratedMethodAccessor101.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
      at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
      at org.jboss.seam.intercept.RootInterceptor.createSeamInvocationContext(RootInterceptor.java:144)
      08:05:54,875 ERROR [STDERR]
      at org.jboss.seam.intercept.RootInterceptor.invokeInContexts(RootInterceptor.java:129)
      at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:102)
      at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:145)
      at org.jboss.seam.intercept.JavaBeanInterceptor.intercept(JavaBeanInterceptor.java:80)
      at blogtest.UserList$$EnhancerByCGLIB$$ef8d664f.getResultList()
      ... 44 more
      Caused by: org.hibernate.hql.ast.QuerySyntaxException: User is not mapped [select user from User user]
      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:265)
      at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElement(HqlSqlBaseWalker.java:3056)
      at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElementList(HqlSqlBaseWalker.java:2945)
      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)
      at org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:229)
      at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:228)
      at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:160)
      at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:111)
      at org.hibernate.engine.query.HQLQueryPlan.(HQLQueryPlan.java:77)
      at org.hibernate.engine.query.HQLQueryPlan.(HQLQueryPlan.java:56)
      at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:72)
      at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:133)
      at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:112)
      at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1623)
      at org.hi