javaserverfaces
  1. javaserverfaces
  2. JAVASERVERFACES-1806

Composite action method throws PropertyNotFoundException when method throws any exception

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.2
    • Fix Version/s: 2.0.4-b11, 2.1.10, 2.2.0-m04
    • Component/s: None
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      1,806
    • Status Whiteboard:
      Hide

      size_medium importance_medium

      Show
      size_medium importance_medium
    • Tags:

      Description

      When an action method is invoked by a composite component and the action method
      itself throws any exception, then JSF incorrectly rethrows it as a
      PropertyNotFoundException. This is confusing and not helpful. Here's a demo:

      /resources/components/test.xhtml
      --------------------------------
      <!DOCTYPE html>
      <html xmlns:h="http://java.sun.com/jsf/html"
      xmlns:cc="http://java.sun.com/jsf/composite">
      <cc:interface>
      <cc:attribute name="action" required="true"
      method-signature="java.lang.String action()" />
      </cc:interface>
      <cc:implementation>
      <h:form>
      <h:commandButton value="submit" action="#

      {cc.attrs.action}

      " />
      </h:form>
      </cc:implementation>
      </html>

      /test.xhtml
      -----------
      <!DOCTYPE html>
      <html xmlns:h="http://java.sun.com/jsf/html"
      xmlns:cc="http://java.sun.com/jsf/composite/components">
      <h:head>
      <title>Test</title>
      </h:head>
      <h:body>
      <p>Composite submit: <cc:test action="#

      {bean.submit}" />
      This throws PropertyNotFoundException.</p>
      <p>Normal submit: <h:form><h:commandButton value="submit"
      action="#{bean.submit}

      " /></h:form>
      This throws the original exception.</p>
      </h:body>
      </html>

      com.example.Bean
      ----------------
      package com.example;

      import javax.faces.bean.ManagedBean;
      import javax.faces.bean.ViewScoped;

      @ManagedBean
      @ViewScoped
      public class Bean {
      public String submit()

      { throw new RuntimeException(); }

      }

        Activity

        Hide
        amitev added a comment -

        I'm getting it too with 2.1.18

        Show
        amitev added a comment - I'm getting it too with 2.1.18
        Hide
        cdollar393 added a comment -

        I just downloaded the newly released 2.0.10 version and this issue is still not fixed. Is this going to make it into any of the 2.0.X revisions?

        Show
        cdollar393 added a comment - I just downloaded the newly released 2.0.10 version and this issue is still not fixed. Is this going to make it into any of the 2.0.X revisions?
        Hide
        ova2 added a comment -

        The issue is not fixed in the last Mojarra versions. See http://java.net/jira/browse/JAVASERVERFACES-2758 Please reopen it.

        Show
        ova2 added a comment - The issue is not fixed in the last Mojarra versions. See http://java.net/jira/browse/JAVASERVERFACES-2758 Please reopen it.
        Hide
        Jorei added a comment -

        @ova2: It seems that your issue is about the warnings generated from the code that was added to fix this issue here, but not the actual problem described above. If you want this issue to be reopened, you should check whether you get a PropertyNotFoundException from your action method or the original exception - regardless of any warnings.

        Show
        Jorei added a comment - @ova2: It seems that your issue is about the warnings generated from the code that was added to fix this issue here, but not the actual problem described above. If you want this issue to be reopened, you should check whether you get a PropertyNotFoundException from your action method or the original exception - regardless of any warnings.
        Hide
        lgraf added a comment -

        I also facing this issue with Mojarra 2.1.6 (SNAPSHOT 20111206).
        This issue makes it really hard to locate bugs that are happened in production ...

        Show
        lgraf added a comment - I also facing this issue with Mojarra 2.1.6 (SNAPSHOT 20111206). This issue makes it really hard to locate bugs that are happened in production ...

          People

          • Assignee:
            rogerk
            Reporter:
            balusc
          • Votes:
            26 Vote for this issue
            Watchers:
            12 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: