[
http://jira.jboss.com/jira/browse/RF-2576?page=all ]
Juergen Zimmermann reopened RF-2576:
------------------------------------
The issue is still in 3.2.0CR5. You are still traversing partially initialized persistent
objects. This worked in the past and was necessary due to performance reasons.
Here is the stacktrace:
2008-03-25 15:28:11,280 ERROR [org.hibernate.LazyInitializationException] failed to lazily
initialize a collection of role: de.hska.kundenverwaltung.db.Kunde.bestellungen, no
session or session was closed
org.hibernate.LazyInitializationException: failed to lazily initialize a collection of
role: de.hska.kundenverwaltung.db.Kunde.bestellungen, no session or session was closed
at
org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:358)
at
org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.java:350)
at
org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:343)
at
org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:86)
at org.hibernate.collection.PersistentBag.iterator(PersistentBag.java:249)
at org.ajax4jsf.javascript.ScriptUtils.toScript(ScriptUtils.java:80)
at org.ajax4jsf.javascript.ScriptUtils.toScript(ScriptUtils.java:135)
at org.ajax4jsf.javascript.ScriptUtils.toScript(ScriptUtils.java:85)
at org.ajax4jsf.javascript.ScriptUtils.toScript(ScriptUtils.java:105)
at org.ajax4jsf.renderkit.AJAXDataSerializer.asString(AJAXDataSerializer.java:40)
at org.ajax4jsf.renderkit.AjaxRendererUtils.encodeAreas(AjaxRendererUtils.java:775)
at
org.ajax4jsf.renderkit.AjaxContainerRenderer.encodeAjax(AjaxContainerRenderer.java:125)
at org.ajax4jsf.component.AjaxViewRoot.encodeAjax(AjaxViewRoot.java:641)
at org.ajax4jsf.component.AjaxViewRoot.encodeChildren(AjaxViewRoot.java:512)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:936)
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:189)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:109)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:147)
at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:276)
at org.ajax4jsf.Filter.doFilter(Filter.java:175)
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.Http11AprProcessor.process(Http11AprProcessor.java:856)
at
org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:566)
at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1508)
at java.lang.Thread.run(Thread.java:619)
Make objects selection optional for the component. (was suggestionbox
broken in 3.2.0 nightly 20080318)
-------------------------------------------------------------------------------------------------------
Key: RF-2576
URL:
http://jira.jboss.com/jira/browse/RF-2576
Project: RichFaces
Issue Type: Task
Affects Versions: 3.2.0
Environment: RF nightly, JBossAS 4.2.2, JSF-RI ("Mojarra") 1.2_08
Reporter: Juergen Zimmermann
Assigned To: Aleksej Yanul
Fix For: 3.2.0
The following was working with 3.1.4 and 3.2.0CR3. Using nightly 20080318
rich:suggestionbox is broken (see stacktrace below).
The problem seems to be the following:
* Java objects are instantiated from a database by using Hibernate (inside JBossAS)
* The Java objects, however, are only partially instantiated due to a lazy fetching
strategy. For instance the suggestionbox needs the customers' lastname, but not all
their orders. Therefore, the orders of each customer are not fetched from the database due
to performance reasons.
* suggestionbox resp. ScriptUtils.toScript() tries to iterate over the *NOT* fetched
collection. Therefore, Hibernate throws a LazyInitializationException.
* Why do you iterate over such a collection? Why do you need this?
Here is the stacktrace:
2008-03-18 10:50:02,155 ERROR [org.hibernate.LazyInitializationException] failed to
lazily initialize a collection of role: de.hska.kundenverwaltung.db.Kunde.bestellungen, no
session or session was closed
org.hibernate.LazyInitializationException: failed to lazily initialize a collection of
role: de.hska.kundenverwaltung.db.Kunde.bestellungen, no session or session was closed
at
org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:358)
at
org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.java:350)
at
org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:343)
at
org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:86)
at org.hibernate.collection.PersistentBag.iterator(PersistentBag.java:249)
at org.ajax4jsf.javascript.ScriptUtils.toScript(ScriptUtils.java:80)
at org.ajax4jsf.javascript.ScriptUtils.toScript(ScriptUtils.java:135)
at org.ajax4jsf.javascript.ScriptUtils.toScript(ScriptUtils.java:85)
at org.ajax4jsf.javascript.ScriptUtils.toScript(ScriptUtils.java:105)
at org.ajax4jsf.renderkit.AJAXDataSerializer.asString(AJAXDataSerializer.java:40)
at org.ajax4jsf.renderkit.AjaxRendererUtils.encodeAreas(AjaxRendererUtils.java:775)
at
org.ajax4jsf.renderkit.AjaxContainerRenderer.encodeAjax(AjaxContainerRenderer.java:125)
at org.ajax4jsf.component.AjaxViewRoot.encodeAjax(AjaxViewRoot.java:633)
at org.ajax4jsf.component.AjaxViewRoot.encodeChildren(AjaxViewRoot.java:505)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:936)
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:185)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:109)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:143)
at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:276)
at org.ajax4jsf.Filter.doFilter(Filter.java:165)
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.Http11AprProcessor.process(Http11AprProcessor.java:856)
at
org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:566)
at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1508)
at java.lang.Thread.run(Thread.java:619)
--
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