java.lang.IllegalStateException:无法从关联的请求加载当前对话,调用关联时出现严重错误

时间:2015-07-01 18:54:02

标签: jsf jsf-2 cdi

我有一个带有dataTable的对话框。删除按钮在dataTable上几行没有正常工作。

<p:dialog id="dlgEditPrices"
          header="#{msg.contractPriceEditPrices}"
          widgetVar="EditPricesDialog"
          modal="true"
          resizable="false"
          closable="false">

    <h:form id="frmEditPrices">
        <h:panelGroup id="displayEditPrices"
                      rendered="#{contractPriceBean.selected != null}">

            <p:dataTable id="dataEditPrices"
                         var="item"
                         value="#{contractPriceBean.contractPriceOffers}"
                         editable="true"
                         paginator="false"
                         scrollHeight="450"
                         scrollable="true"
                         tableStyle="table-layout: auto;"
                         rowClasses="even,odd"
                         style="width:900px">

                ...

                <p:column>
                    <p:commandButton icon="ui-icon-closethick"
                                     actionListener="#{contractPriceBean.removeContractPriceOffer(item)}"
                                     process="dataEditPrices"
                                     resetValues="true"
                                     update="dataEditPrices" />
                </p:column>

            </p:dataTable>

            ...

        </h:panelGroup>
    </h:form>
</p:dialog>

在Manage Bean上我使用:

import javax.inject.Named;
import org.omnifaces.cdi.ViewScoped;

@Named
@ViewScoped

但是当我加载一个更大的数据集(例如:331行)时,我总是单击“删除”按钮再次调用@PostContruct方法。

在搜索解决方案时,我将删除按钮上的更新更改为&#34; frmEditPrices&#34;。它继续调用@PostContruct方法每次单击按钮,但我可以在日志中看到错误:

09:15:00,241 SEVERE [javax.enterprise.resource.webcontainer.jsf.application] (http--0.0.0.0-8080-1) Error Rendering View[/restrict/contractPrice.xhtml]: java.lang.IllegalStateException: Unable to load current conversations from the associated request, something went badly wrong when associate() was called
at org.jboss.weld.context.AbstractConversationContext.getCurrentConversation(AbstractConversationContext.java:363) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at org.jboss.weld.jsf.ConversationAwareViewHandler.getActionURL(ConversationAwareViewHandler.java:101) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at javax.faces.application.ViewHandlerWrapper.getActionURL(ViewHandlerWrapper.java:183) [jsf-api-2.1.29-03.jar:2.1]
at com.sun.faces.renderkit.html_basic.FormRenderer.getActionStr(FormRenderer.java:251) [jsf-impl-2.1.29-03.jar:2.1.29-03]
at com.sun.faces.renderkit.html_basic.FormRenderer.encodeBegin(FormRenderer.java:143) [jsf-impl-2.1.29-03.jar:2.1.29-03]
at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:822) [jsf-api-2.1.29-03.jar:2.1]
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1776) [jsf-api-2.1.29-03.jar:2.1]
at com.sun.faces.context.PartialViewContextImpl$PhaseAwareVisitCallback.visit(PartialViewContextImpl.java:543) [jsf-impl-2.1.29-03.jar:2.1.29-03]
at com.sun.faces.component.visit.PartialVisitContext.invokeVisitCallback(PartialVisitContext.java:183) [jsf-impl-2.1.29-03.jar:2.1.29-03]
at javax.faces.component.UIForm.visitTree(UIForm.java:381) [jsf-api-2.1.29-03.jar:2.1]
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1622) [jsf-api-2.1.29-03.jar:2.1]
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1622) [jsf-api-2.1.29-03.jar:2.1]
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1622) [jsf-api-2.1.29-03.jar:2.1]
at com.sun.faces.context.PartialViewContextImpl.processComponents(PartialViewContextImpl.java:383) [jsf-impl-2.1.29-03.jar:2.1.29-03]
at com.sun.faces.context.PartialViewContextImpl.processPartial(PartialViewContextImpl.java:302) [jsf-impl-2.1.29-03.jar:2.1.29-03]
at javax.faces.context.PartialViewContextWrapper.processPartial(PartialViewContextWrapper.java:183) [jsf-api-2.1.29-03.jar:2.1]
at org.primefaces.context.PrimePartialViewContext.processPartial(PrimePartialViewContext.java:60) [primefaces-5.2.3.jar:5.2.3]
at javax.faces.component.UIViewRoot.encodeChildren(UIViewRoot.java:973) [jsf-api-2.1.29-03.jar:2.1]
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1778) [jsf-api-2.1.29-03.jar:2.1]
at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:426) [jsf-impl-2.1.29-03.jar:2.1.29-03]
at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:125) [jsf-impl-2.1.29-03.jar:2.1.29-03]
at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:286) [jsf-api-2.1.29-03.jar:2.1]
at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:286) [jsf-api-2.1.29-03.jar:2.1]
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120) [jsf-impl-2.1.29-03.jar:2.1.29-03]
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) [jsf-impl-2.1.29-03.jar:2.1.29-03]
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139) [jsf-impl-2.1.29-03.jar:2.1.29-03]
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:604) [jsf-api-2.1.29-03.jar:2.1]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]
at org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:100) [primefaces-5.2.3.jar:5.2.3]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]
at org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:62) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.13.Final.jar:]
at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50) [jboss-as-jpa-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) [jbossweb-7.0.13.Final.jar:]
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.13.Final.jar:]
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671) [jbossweb-7.0.13.Final.jar:]
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930) [jbossweb-7.0.13.Final.jar:]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_76]

升级到Mojarra 2.1.29-03并没有解决问题。

首先我怀疑Managed Bean因为大小而被钝化了。但我怎么检查这个? Managed Beans有一个@PrePassivate注释?

1 个答案:

答案 0 :(得分:1)

正如Kukeltje所指出的,我认为问题是提交时发送的参数数量。增加JBoss上的最大数量后,它运行良好。

在JBoss 7.1.1中,我添加了以下几行。它应该直接在&#34;扩展&#34;标签

<system-properties>
    <property name="org.apache.tomcat.util.http.Parameters.MAX_COUNT" value="5000"/>
</system-properties>