2 Replies Latest reply on Feb 29, 2012 4:15 PM by Esteve Aviles

    Differences between 7.1.0.Final and 7.1.0.Beta regarding JPA

    Esteve Aviles Newbie

      Hi,

       

      I have upgraded my applications from AS 7.1.0.Beta to 7.1.0.Final and I am getting issues regarding JPA.

      My application works well in 7.1.0.Beta but I am getting the following error deploying exactly the same code on 7.1.0.Final.

      I can't find the differences between this two releases regarding persistence. I am using Seam 3.1.0.Final.

      The error is this one:

      9:08:58,807 SEVERE [javax.enterprise.resource.webcontainer.jsf.application] (http--127.0.0.1-8080-1) Error Rendering View[/view/team/myteamcompetitions.xhtml]: org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.pelopiti.teamgol.model.CompetitionSeason.competitionSeasonTeams, no session or session was closed

                at org.hibernate.collection.internal.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:393) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]

                at org.hibernate.collection.internal.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.java:385) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]

                at org.hibernate.collection.internal.AbstractPersistentCollection.readSize(AbstractPersistentCollection.java:125) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]

                at org.hibernate.collection.internal.PersistentBag.size(PersistentBag.java:242) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]

                at javax.faces.model.ListDataModel.isRowAvailable(ListDataModel.java:110) [jboss-jsf-api_2.1_spec-2.0.0.Final.jar:2.0.0.Final]

                at javax.faces.model.ListDataModel.setRowIndex(ListDataModel.java:185) [jboss-jsf-api_2.1_spec-2.0.0.Final.jar:2.0.0.Final]

                at javax.faces.model.ListDataModel.setWrappedData(ListDataModel.java:220) [jboss-jsf-api_2.1_spec-2.0.0.Final.jar:2.0.0.Final]

                at javax.faces.model.ListDataModel.<init>(ListDataModel.java:79) [jboss-jsf-api_2.1_spec-2.0.0.Final.jar:2.0.0.Final]

                at com.sun.faces.facelets.component.UIRepeat.getDataModel(UIRepeat.java:257) [jsf-impl-2.1.5-jbossorg-1.jar:2.1.5-SNAPSHOT]

                at com.sun.faces.facelets.component.UIRepeat.setIndex(UIRepeat.java:443) [jsf-impl-2.1.5-jbossorg-1.jar:2.1.5-SNAPSHOT]

                at com.sun.faces.facelets.component.UIRepeat.process(UIRepeat.java:482) [jsf-impl-2.1.5-jbossorg-1.jar:2.1.5-SNAPSHOT]

                at com.sun.faces.facelets.component.UIRepeat.encodeChildren(UIRepeat.java:974) [jsf-impl-2.1.5-jbossorg-1.jar:2.1.5-SNAPSHOT]

                at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:304) [jsf-impl-2.1.5-jbossorg-1.jar:2.1.5-SNAPSHOT]

                at com.sun.faces.renderkit.html_basic.GroupRenderer.encodeChildren(GroupRenderer.java:105) [jsf-impl-2.1.5-jbossorg-1.jar:2.1.5-SNAPSHOT]

                at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:845) [jboss-jsf-api_2.1_spec-2.0.0.Final.jar:2.0.0.Final]

                at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1757) [jboss-jsf-api_2.1_spec-2.0.0.Final.jar:2.0.0.Final]

                at com.sun.faces.facelets.component.RepeatRenderer.encodeChildren(RepeatRenderer.java:104) [jsf-impl-2.1.5-jbossorg-1.jar:2.1.5-SNAPSHOT]

                at com.sun.faces.facelets.component.UIRepeat.process(UIRepeat.java:513) [jsf-impl-2.1.5-jbossorg-1.jar:2.1.5-SNAPSHOT]

                at com.sun.faces.facelets.component.UIRepeat.encodeChildren(UIRepeat.java:974) [jsf-impl-2.1.5-jbossorg-1.jar:2.1.5-SNAPSHOT]

                at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1757) [jboss-jsf-api_2.1_spec-2.0.0.Final.jar:2.0.0.Final]

                at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1760) [jboss-jsf-api_2.1_spec-2.0.0.Final.jar:2.0.0.Final]

                at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1760) [jboss-jsf-api_2.1_spec-2.0.0.Final.jar:2.0.0.Final]

                at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:402) [jsf-impl-2.1.5-jbossorg-1.jar:2.1.5-SNAPSHOT]

                at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131) [jsf-impl-2.1.5-jbossorg-1.jar:2.1.5-SNAPSHOT]

                at com.ocpsoft.pretty.faces.application.PrettyViewHandler.renderView(PrettyViewHandler.java:163) [prettyfaces-jsf2-3.3.2.jar:]

                at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:288) [jboss-jsf-api_2.1_spec-2.0.0.Final.jar:2.0.0.Final]

                at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:288) [jboss-jsf-api_2.1_spec-2.0.0.Final.jar:2.0.0.Final]

                at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:121) [jsf-impl-2.1.5-jbossorg-1.jar:2.1.5-SNAPSHOT]

                at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) [jsf-impl-2.1.5-jbossorg-1.jar:2.1.5-SNAPSHOT]

                at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139) [jsf-impl-2.1.5-jbossorg-1.jar:2.1.5-SNAPSHOT]

                at javax.faces.webapp.FacesServlet.service(FacesServlet.java:594) [jboss-jsf-api_2.1_spec-2.0.0.Final.jar:2.0.0.Final]

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.10.Final.jar:]

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.10.Final.jar:]

                at com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:126) [prettyfaces-jsf2-3.3.2.jar:]

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.10.Final.jar:]

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.10.Final.jar:]

                at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:734) [jbossweb-7.0.10.Final.jar:]

                at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:541) [jbossweb-7.0.10.Final.jar:]

                at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:479) [jbossweb-7.0.10.Final.jar:]

                at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:407) [jbossweb-7.0.10.Final.jar:]

                at com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:118) [prettyfaces-jsf2-3.3.2.jar:]

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.10.Final.jar:]

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.10.Final.jar:]

                at org.jboss.solder.servlet.exception.CatchExceptionFilter.doFilter(CatchExceptionFilter.java:65) [solder-impl-3.1.0.Beta5.jar:3.1.0.Beta5]

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.10.Final.jar:]

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.10.Final.jar:]

                at org.jboss.solder.servlet.event.ServletEventBridgeFilter.doFilter(ServletEventBridgeFilter.java:74) [solder-impl-3.1.0.Beta5.jar:3.1.0.Beta5]

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.10.Final.jar:]

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.10.Final.jar:]

                at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.10.Final.jar:]

                at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.10.Final.jar:]

                at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50) [jboss-as-jpa-7.1.0.Final.jar:7.1.0.Final]

                at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:154) [jboss-as-web-7.1.0.Final.jar:7.1.0.Final]

                at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) [jbossweb-7.0.10.Final.jar:]

                at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.10.Final.jar:]

                at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.10.Final.jar:]

                at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) [jbossweb-7.0.10.Final.jar:]

                at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.10.Final.jar:]

                at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671) [jbossweb-7.0.10.Final.jar:]

                at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930) [jbossweb-7.0.10.Final.jar:]

                at java.lang.Thread.run(Thread.java:619) [rt.jar:1.6.0_21]

       

       

      19:08:58,841 ERROR [com.pelopiti.teamgol.exceptioncontrol.GeneralExceptionHandler] (http--127.0.0.1-8080-1) Something bad happened: : org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.pelopiti.teamgol.model.CompetitionSeason.competitionSeasonTeams, no session or session was closed

                at org.hibernate.collection.internal.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:393) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]

                at org.hibernate.collection.internal.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.java:385) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]

                at org.hibernate.collection.internal.AbstractPersistentCollection.readSize(AbstractPersistentCollection.java:125) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]

                at org.hibernate.collection.internal.PersistentBag.size(PersistentBag.java:242) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]

                at javax.faces.model.ListDataModel.isRowAvailable(ListDataModel.java:110) [jboss-jsf-api_2.1_spec-2.0.0.Final.jar:2.0.0.Final]

                at javax.faces.model.ListDataModel.setRowIndex(ListDataModel.java:185) [jboss-jsf-api_2.1_spec-2.0.0.Final.jar:2.0.0.Final]

                at javax.faces.model.ListDataModel.setWrappedData(ListDataModel.java:220) [jboss-jsf-api_2.1_spec-2.0.0.Final.jar:2.0.0.Final]

                at javax.faces.model.ListDataModel.<init>(ListDataModel.java:79) [jboss-jsf-api_2.1_spec-2.0.0.Final.jar:2.0.0.Final]

                at com.sun.faces.facelets.component.UIRepeat.getDataModel(UIRepeat.java:257) [jsf-impl-2.1.5-jbossorg-1.jar:2.1.5-SNAPSHOT]

                at com.sun.faces.facelets.component.UIRepeat.setIndex(UIRepeat.java:443) [jsf-impl-2.1.5-jbossorg-1.jar:2.1.5-SNAPSHOT]

                at com.sun.faces.facelets.component.UIRepeat.process(UIRepeat.java:482) [jsf-impl-2.1.5-jbossorg-1.jar:2.1.5-SNAPSHOT]

                at com.sun.faces.facelets.component.UIRepeat.encodeChildren(UIRepeat.java:974) [jsf-impl-2.1.5-jbossorg-1.jar:2.1.5-SNAPSHOT]

                at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:304) [jsf-impl-2.1.5-jbossorg-1.jar:2.1.5-SNAPSHOT]

                at com.sun.faces.renderkit.html_basic.GroupRenderer.encodeChildren(GroupRenderer.java:105) [jsf-impl-2.1.5-jbossorg-1.jar:2.1.5-SNAPSHOT]

                at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:845) [jboss-jsf-api_2.1_spec-2.0.0.Final.jar:2.0.0.Final]

                at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1757) [jboss-jsf-api_2.1_spec-2.0.0.Final.jar:2.0.0.Final]

                at com.sun.faces.facelets.component.RepeatRenderer.encodeChildren(RepeatRenderer.java:104) [jsf-impl-2.1.5-jbossorg-1.jar:2.1.5-SNAPSHOT]

                at com.sun.faces.facelets.component.UIRepeat.process(UIRepeat.java:513) [jsf-impl-2.1.5-jbossorg-1.jar:2.1.5-SNAPSHOT]

                at com.sun.faces.facelets.component.UIRepeat.encodeChildren(UIRepeat.java:974) [jsf-impl-2.1.5-jbossorg-1.jar:2.1.5-SNAPSHOT]

                at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1757) [jboss-jsf-api_2.1_spec-2.0.0.Final.jar:2.0.0.Final]

                at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1760) [jboss-jsf-api_2.1_spec-2.0.0.Final.jar:2.0.0.Final]

                at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1760) [jboss-jsf-api_2.1_spec-2.0.0.Final.jar:2.0.0.Final]

                at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:402) [jsf-impl-2.1.5-jbossorg-1.jar:2.1.5-SNAPSHOT]

                at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131) [jsf-impl-2.1.5-jbossorg-1.jar:2.1.5-SNAPSHOT]

                at com.ocpsoft.pretty.faces.application.PrettyViewHandler.renderView(PrettyViewHandler.java:163) [prettyfaces-jsf2-3.3.2.jar:]

                at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:288) [jboss-jsf-api_2.1_spec-2.0.0.Final.jar:2.0.0.Final]

                at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:288) [jboss-jsf-api_2.1_spec-2.0.0.Final.jar:2.0.0.Final]

                at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:121) [jsf-impl-2.1.5-jbossorg-1.jar:2.1.5-SNAPSHOT]

                at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) [jsf-impl-2.1.5-jbossorg-1.jar:2.1.5-SNAPSHOT]

                at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139) [jsf-impl-2.1.5-jbossorg-1.jar:2.1.5-SNAPSHOT]

                at javax.faces.webapp.FacesServlet.service(FacesServlet.java:594) [jboss-jsf-api_2.1_spec-2.0.0.Final.jar:2.0.0.Final]

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.10.Final.jar:]

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.10.Final.jar:]

                at com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:126) [prettyfaces-jsf2-3.3.2.jar:]

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.10.Final.jar:]

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.10.Final.jar:]

                at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:734) [jbossweb-7.0.10.Final.jar:]

                at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:541) [jbossweb-7.0.10.Final.jar:]

                at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:479) [jbossweb-7.0.10.Final.jar:]

                at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:407) [jbossweb-7.0.10.Final.jar:]

                at com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:118) [prettyfaces-jsf2-3.3.2.jar:]

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.10.Final.jar:]

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.10.Final.jar:]

                at org.jboss.solder.servlet.exception.CatchExceptionFilter.doFilter(CatchExceptionFilter.java:65) [solder-impl-3.1.0.Beta5.jar:3.1.0.Beta5]

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.10.Final.jar:]

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.10.Final.jar:]

                at org.jboss.solder.servlet.event.ServletEventBridgeFilter.doFilter(ServletEventBridgeFilter.java:74) [solder-impl-3.1.0.Beta5.jar:3.1.0.Beta5]

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.10.Final.jar:]

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.10.Final.jar:]

                at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.10.Final.jar:]

                at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.10.Final.jar:]

                at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50) [jboss-as-jpa-7.1.0.Final.jar:7.1.0.Final]

                at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:154) [jboss-as-web-7.1.0.Final.jar:7.1.0.Final]

                at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) [jbossweb-7.0.10.Final.jar:]

                at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.10.Final.jar:]

                at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.10.Final.jar:]

                at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) [jbossweb-7.0.10.Final.jar:]

                at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.10.Final.jar:]

                at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671) [jbossweb-7.0.10.Final.jar:]

                at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930) [jbossweb-7.0.10.Final.jar:]

                at java.lang.Thread.run(Thread.java:619) [rt.jar:1.6.0_21]

       

      Thanks in advance

       

      Esteve