ICEfaces-EE
  1. ICEfaces-EE
  2. IPCK-418

ClassCastException thrown when including the icefaces-ee-accessible.jar file on the classpath

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: EE-3.0.0.GA_P01
    • Fix Version/s: EE-3.2.0.GA
    • Component/s: Accessible Components
    • Labels:
      None
    • Environment:
      All
    • Assignee Priority:
      P1
    • Salesforce Case Reference:

      Description

      A ClassCastException is thrown when a partial submit is fired on and ice:inputText component. The inputText component uses and el expresion for the required attribute. Sample code:

              <c:set var="required" value="true" />
              <ice:form id="form">
                  <ice:inputText id="testIceVar" value="somevalue" required="#{required}" partialSubmit="true" />
              </ice:form>

      On the surface, it looks like we might have some package+classname duplication between the icefaces-ee-compat.jar and the icefaces-ee-accessible.jar.

        Activity

        Hide
        Deryk Sinotte added a comment -

        In the icefaces-ee-accessible.jar, at the bottom of the META-INF/faces-config.xml file there is the following:

            <!-- configuration taken from compat/components -->
            <ordering>
                <after>
                    <name>ICEfacesCore</name>
                </after>
            </ordering>
            <lifecycle>
                <phase-listener>com.icesoft.faces.application.PartialSubmitPhaseListener</phase-listener>
            </lifecycle>
            <factory>
                <partial-view-context-factory>com.icesoft.faces.context.CompatDOMPartialViewContextFactory
                </partial-view-context-factory>
            </factory>
        

        This duplicates what is already in icefaces-compat.jar. Not sure if the accessible library can work without the compat components or not but the double registration of the com.icesoft.faces.application.PartialSubmitPhaseListener seems to be the problem. If I remove that from the faces-config file, the problem goes away.

        Show
        Deryk Sinotte added a comment - In the icefaces-ee-accessible.jar, at the bottom of the META-INF/faces-config.xml file there is the following: <!-- configuration taken from compat/components --> <ordering> <after> <name>ICEfacesCore</name> </after> </ordering> <lifecycle> <phase-listener>com.icesoft.faces.application.PartialSubmitPhaseListener</phase-listener> </lifecycle> <factory> <partial-view-context-factory>com.icesoft.faces.context.CompatDOMPartialViewContextFactory </partial-view-context-factory> </factory> This duplicates what is already in icefaces-compat.jar. Not sure if the accessible library can work without the compat components or not but the double registration of the com.icesoft.faces.application.PartialSubmitPhaseListener seems to be the problem. If I remove that from the faces-config file, the problem goes away.
        Hide
        Ken Fyten added a comment -

        Yip, please go ahead and remove the PartialSubmitPhaseListener from the Accessible Comps lib. This is not required by accessible and would already be setup by Compat, which Accessible requires anyway.

        Show
        Ken Fyten added a comment - Yip, please go ahead and remove the PartialSubmitPhaseListener from the Accessible Comps lib. This is not required by accessible and would already be setup by Compat, which Accessible requires anyway.
        Hide
        Mark Collette added a comment -

        I believe that this:
        <c:set var="required" value="true" />
        <ice:inputText required="#

        {required}

        " partialSubmit="true" />

        Is just another way of doing this:
        <ice:inputText value="required="#

        {true}

        " partialSubmit="true" />

        Which is to test the case where the required property has a ValueExpression, and not just a simple Boolean value. This is because the bug is with the replacement faked ValueExpression not being Serializable, and not yet having been swapped with the real one when our code prematurely triggers state saving.

        Show
        Mark Collette added a comment - I believe that this: <c:set var="required" value="true" /> <ice:inputText required="# {required} " partialSubmit="true" /> Is just another way of doing this: <ice:inputText value="required="# {true} " partialSubmit="true" /> Which is to test the case where the required property has a ValueExpression, and not just a simple Boolean value. This is because the bug is with the replacement faked ValueExpression not being Serializable, and not yet having been swapped with the real one when our code prematurely triggers state saving.
        Hide
        Deryk Sinotte added a comment -

        That makes sense. I retested putting everything back the way it was. Removing the duplicate PhaseListener "fixes" this particular problem.

        Show
        Deryk Sinotte added a comment - That makes sense. I retested putting everything back the way it was. Removing the duplicate PhaseListener "fixes" this particular problem.
        Hide
        yip.ng added a comment -

        Done. Error gone.

        Subversion: Committed revision 33300.

        M: C:\svn\repo\icefaces-ee3\trunk\icefaces-ee\ee-comps\ee-accessible\component-metadata\src\main\resources\com\icesoft\jsfmeta\templates\jsf11\resources\faces-config-rt.ftl#33300

        Show
        yip.ng added a comment - Done. Error gone. Subversion: Committed revision 33300. M: C:\svn\repo\icefaces-ee3\trunk\icefaces-ee\ee-comps\ee-accessible\component-metadata\src\main\resources\com\icesoft\jsfmeta\templates\jsf11\resources\faces-config-rt.ftl#33300

          People

          • Assignee:
            yip.ng
            Reporter:
            Arran Mccullough
          • Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: