[JBoss Seam] - Re: pagination with lazy loading for readonly tables, seamdi
by petekol
"pete.muir(a)jboss.org" wrote : This is the JSF lifecycle, it is "needed". You could work around this by putting the query into a longer scope than request/event. This "problem" occurs in normal queries too.
|
| We should probably merge the lazy loading code from seamdiscs into a seam module and build one for richfaces.
<framework:entity-query name="discs" ejbql="select disc from Disc disc" scope="CONVERSATION" order="disc.name ASC" max-results="5"/>
<persistence:managed-persistence-context name="entityManager"
auto-create="true" scope="CONVERSATION"
persistence-unit-jndi-name="java:/seamdiscsEntityManagerFactory" />
longer scope does not work for Query component.....it's DataModel handling makes it not possible
may be i do something wrong so can you point me exactly what should i do to fix the "problem". I think 3 counts + 2 selects is not for real applications but for showcases only
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4111212#4111212
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4111212
18 years, 4 months
[JBoss Seam] - Re: Seam generated entity failed to deploy on JBossAS 4.2.2
by berna
Hi Guys,
I tried to a simple test to built a running Seam application using seam generator (no eclipse this time):
I switched to use jTDS 1.2.2 driver for this, and removed
| <property name="hibernate.hbm2ddl.auto" value="validate"/>
|
from persistent.xml
Then created a new Seam project:
seam setup
seam create-project
seam generate-entities
seam deploy
start jboss server (via run script)
My SQL script:
| CREATE TABLE [dbo].[TestUser] (
| [EmployeeId] [varchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
| [LoginId] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
| [UserRole] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
| [Password] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
| ) ON [PRIMARY]
| GO
|
There is only one simple TestUser table in my testdb this time. Accessesing the web application, there was a "TestUserList" generated. When click on the link, I got the exception show bellow.
Is there any known issue for seam entity generator on SqlServer 2k? Any solustions? The exception indicated the syntax error. The whole application was generated and there is no hand coding in this case.
| javax.faces.FacesException: javax.el.ELException: /TestUserList.xhtml @54,61 rendered="#{empty testUserList.resultList}": Error reading 'resultList' on type test.osa.session.TestUserList_$$_javassist_1
| at javax.faces.component.UIComponentBase.isRendered(UIComponentBase.java:373)
| at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:276)
| at org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:262)
| at org.richfaces.renderkit.html.PanelRenderer.doEncodeChildren(PanelRenderer.java:199)
| at org.richfaces.renderkit.html.PanelRenderer.doEncodeChildren(PanelRenderer.java:194)
| at org.ajax4jsf.renderkit.RendererBase.encodeChildren(RendererBase.java:121)
| at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:812)
| at javax.faces.component.UIComponent.encodeAll(UIComponent.java:886)
| at javax.faces.component.UIComponent.encodeAll(UIComponent.java:892)
| at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:592)
| at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
| at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:216)
| at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
| at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
| at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
| at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
| at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:44)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
| at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
| at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
| at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
| at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
| at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
| at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
| at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
| at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
| at java.lang.Thread.run(Thread.java:595)
| Caused by: javax.el.ELException: /TestUserList.xhtml @54,61 rendered="#{empty testUserList.resultList}": Error reading 'resultList' on type test.osa.session.TestUserList_$$_javassist_1
| at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:76)
| at javax.faces.component.UIComponentBase.isRendered(UIComponentBase.java:370)
| ... 52 more
| Caused by: javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not execute query
| at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:629)
| at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:73)
| at org.jboss.seam.framework.EntityQuery.initResultList(EntityQuery.java:74)
| at org.jboss.seam.framework.EntityQuery.getResultList(EntityQuery.java:65)
| 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.jboss.seam.util.Reflections.invoke(Reflections.java:21)
| at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
| at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:31)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
| at org.jboss.seam.transaction.TransactionInterceptor$1.work(TransactionInterceptor.java:38)
| at org.jboss.seam.util.Work.workInTransaction(Work.java:40)
| at org.jboss.seam.transaction.TransactionInterceptor.aroundInvoke(TransactionInterceptor.java:32)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
| at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
| at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:106)
| at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:155)
| at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:91)
| at sg.com.yellowpages.osa.session.TestUserList_$$_javassist_1.getResultList(TestUserList_$$_javassist_1.java)
| 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 javax.el.BeanELResolver.getValue(BeanELResolver.java:62)
| at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53)
| at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:64)
| at org.jboss.el.parser.AstPropertySuffix.getValue(AstPropertySuffix.java:53)
| at org.jboss.el.parser.AstValue.getValue(AstValue.java:67)
| at org.jboss.el.parser.AstEmpty.getValue(AstEmpty.java:29)
| at org.jboss.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
| at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:71)
| ... 53 more
| Caused by: org.hibernate.exception.SQLGrammarException: could not execute query
| at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)
| at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
| at org.hibernate.loader.Loader.doList(Loader.java:2223)
| at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
| at org.hibernate.loader.Loader.list(Loader.java:2099)
| at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:378)
| at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
| at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
| at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
| at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
| at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:64)
| ... 86 more
| Caused by: java.sql.SQLException: Line 1: Incorrect syntax near '-'.
| at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:368)
| at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2816)
| at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2254)
| at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:631)
| at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQLQuery(JtdsStatement.java:477)
| at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeQuery(JtdsPreparedStatement.java:777)
| at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:236)
| at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:186)
| at org.hibernate.loader.Loader.getResultSet(Loader.java:1787)
| at org.hibernate.loader.Loader.doQuery(Loader.java:674)
| at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
| at org.hibernate.loader.Loader.doList(Loader.java:2220)
| ... 94 more
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4111210#4111210
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4111210
18 years, 4 months
[JBoss Seam] - Re: Seam eats exceptions
by MSchmidke
"pete.muir(a)jboss.org" wrote : What was the xhtml? Facelets eats exceptions which occur e.g. on rendered attribute (I don't know why :(
I do not know whether xhtml is relevant in this case. I have digged one step further - Eaten Exception occurs during Outjection of a datamodel:
| @DataModel
| public Collection<Akteur> getEigentuemer() {
| Attributlieferant al = getAttribute();
| if (al == null) {
| return null;
| }
| return al.getEigentuemer();
| }
|
Exception occured in "getAttribute" call, but method getEigentuemer should only be called by seam, not by jsf. xhtml directly accesses the outjected datamodel:
| <ui:repeat var="p" value="#{eigentuemer}">
| <h:outputText value="#{p.anzeigename}" />
| </ui:repeat>
|
Ok, admit, I don't know why I used a DataModel for this special case. But keep in mind that I am still learning Seam by doing ...
Marcus.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4111206#4111206
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4111206
18 years, 4 months