MyFaces Extensions Validator
  1. MyFaces Extensions Validator
  2. EXTVAL-108

f:validateBean + p:dialog cause java.lang.InstantiationException: org.apache.myfaces.extensions.validator.beanval.interceptor.BeanValidatorWrapper

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0.3
    • Fix Version/s: 2.0.4
    • Component/s: Bean Validation
    • Labels:
      None
    • Environment:
      PrimeFaces 2.0.0, Mojarra JSF Implementation (javax.faces/2.0) 2.0.2 -FCS, ExtVal: 2.0.4-SNAPSHOT

      Description

      I observe a strange exception by that appears inside of the
      BeanValidatorWrapper in a very specific scenario. Here is how it goes:

      I use PrimeFaces 2.0.2 running on Mojarra JSF and using ExtVal for Bean
      Validation (especially to support @Valid). It works perfect, except for
      one case. If I open a popup (p:dialog) and use a link (p:commandButton)
      which submits a form which contains a f:validateBean tag setting a Bean
      Validation group - an exception is thrown during an attempt to access an
      non-existent default constructor in BeanValidatorWrapper. If I remove
      the f:validateBean tag, everything works fine, and if I use it not from
      the popup too. Here is the VDL:

      <p:dialog widgetVar="PopupDialog" fixedCenter="true"
      header="Customer Search" modal="true" close="false">
      <h:form id="PopupDialogForm" prependId="false">
      <h:messages globalOnly="true" errorClass="error"
      fatalClass="fatal" infoClass="info" warnClass="warn" />
      <p:panel header="Customer Search">
      <h:panelGrid columns="1">
      <h:panelGrid columns="2">
      <h:outputLabel for="name" value="Name:" />
      <h:inputText id="name"
      value="#

      {searchController.search.name}

      " label="#

      {msgs.label}

      ">
      <f:validateBean
      validationGroups="de.techjava.web.popup.validation.SearchGroup" />
      </h:inputText>
      </h:panelGrid>
      <h:message for="name" id="name_msg" />
      <p:commandButton value="Search"
      action="#

      {searchController.doSearch}

      " onsuccess="if (args) { var isValid
      = args.isValid; if (isValid) { PopupDialog.hide();}}"
      update="@form" process="@form" />
      </h:panelGrid>
      </p:panel>
      <p:panel header="Customer Search Result">
      <p:dataTable id="items"
      value="#

      {searchController.result}

      " var="item">
      <p:column>
      <f:facet name="header">
      <h:outputText value="Name" />
      </f:facet>
      <h:outputText value="#

      {item.name}

      " />
      </p:column>
      </p:dataTable>
      </p:panel>
      <p:commandButton value="Close"
      action="#

      {searchController.doCancel}

      " onsuccess="PopupDialog.hide()"
      update="@none" process="@this" />
      </h:form>
      </p:dialog>

      The Stacktrace looks like following:

      java.lang.InstantiationException: org.apache.myfaces.extensions.validator.beanval.interceptor.BeanValidatorWrapper
      at java.lang.Class.newInstance0(Class.java:340)
      at java.lang.Class.newInstance(Class.java:308)
      at javax.faces.component.StateHolderSaver.restore(StateHolderSaver.java:103)
      at javax.faces.component.AttachedObjectListHolder.restoreState(AttachedObjectListHolder.java:153)
      at javax.faces.component.UIInput.restoreState(UIInput.java:1375)
      at com.sun.faces.application.view.StateManagementStrategyImpl$1.visit(StateManagementStrategyImpl.java:242)
      at com.sun.faces.component.visit.FullVisitContext.invokeVisitCallback(FullVisitContext.java:147)
      at javax.faces.component.UIComponent.visitTree(UIComponent.java:1442)
      at javax.faces.component.UIComponent.visitTree(UIComponent.java:1453)
      at javax.faces.component.UIComponent.visitTree(UIComponent.java:1453)
      at javax.faces.component.UIComponent.visitTree(UIComponent.java:1453)
      at javax.faces.component.UIComponent.visitTree(UIComponent.java:1453)
      at javax.faces.component.UIComponent.visitTree(UIComponent.java:1453)
      at javax.faces.component.UIComponent.visitTree(UIComponent.java:1453)
      at javax.faces.component.UIComponent.visitTree(UIComponent.java:1453)
      at javax.faces.component.UIComponent.visitTree(UIComponent.java:1453)
      at javax.faces.component.UIComponent.visitTree(UIComponent.java:1453)
      at javax.faces.component.UIForm.visitTree(UIForm.java:322)
      at javax.faces.component.UIComponent.visitTree(UIComponent.java:1453)
      at javax.faces.component.UIComponent.visitTree(UIComponent.java:1453)
      at com.sun.faces.application.view.StateManagementStrategyImpl.restoreView(StateManagementStrategyImpl.java:234)
      at com.sun.faces.application.StateManagerImpl.restoreView(StateManagerImpl.java:177)
      at com.sun.faces.application.view.ViewHandlingStrategy.restoreView(ViewHandlingStrategy.java:119)
      at com.sun.faces.application.view.FaceletViewHandlingStrategy.restoreView(FaceletViewHandlingStrategy.java:438)
      at com.sun.faces.application.view.MultiViewHandler.restoreView(MultiViewHandler.java:144)
      at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:198)
      at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:97)
      at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:107)
      at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:114)
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:308)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at ...

        Activity

        Simon Zambrovski created issue -
        Gerhard Petracek made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 2.0.4-SNAPSHOT [ 12314836 ]
        Resolution Fixed [ 1 ]
        Gerhard Petracek made changes -
        Summary validateBean and java.lang.InstantiationException: org.apache.myfaces.extensions.validator.beanval.interceptor.BeanValidatorWrapper f:validateBean causes java.lang.InstantiationException: org.apache.myfaces.extensions.validator.beanval.interceptor.BeanValidatorWrapper
        Gerhard Petracek made changes -
        Priority Major [ 3 ] Minor [ 4 ]
        Gerhard Petracek made changes -
        Summary f:validateBean causes java.lang.InstantiationException: org.apache.myfaces.extensions.validator.beanval.interceptor.BeanValidatorWrapper f:validateBean + p:dialog cause java.lang.InstantiationException: org.apache.myfaces.extensions.validator.beanval.interceptor.BeanValidatorWrapper
        Gerhard Petracek made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Simon Zambrovski
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development