You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Ivan (JIRA)" <de...@myfaces.apache.org> on 2011/09/19 16:17:09 UTC

[jira] [Created] (MYFACES-3309) Throw correct exception while using FactoryFinderProvider SPI

Throw correct exception while using FactoryFinderProvider SPI
-------------------------------------------------------------

                 Key: MYFACES-3309
                 URL: https://issues.apache.org/jira/browse/MYFACES-3309
             Project: MyFaces Core
          Issue Type: Bug
          Components: SPI
    Affects Versions: 2.1.3, 2.0.9
            Reporter: Ivan


While using FactoryFinderProvider SPI, it is required to check the real exception from InvocationTargetException, and throw some exceptions directly.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Issue Comment Edited] (MYFACES-3309) Throw correct exception while using FactoryFinderProvider SPI

Posted by "Ivan (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/MYFACES-3309?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13108317#comment-13108317 ] 

Ivan edited comment on MYFACES-3309 at 9/20/11 1:45 AM:
--------------------------------------------------------

Sometimes, those exceptions are thrown from runtime. e.g. If users called FactoryFinder.getFactory("invalidfactory"), there should be an IllegalStateException exception is thrown. If it is not possible to have a new release, could you please help to review the patch ? I wonder whether I missed anything. So that, I could try to do something from Geronimo side.
Thanks.

      was (Author: xuhaihong):
    Sometimes, those exceptions are thrown from runtime. e.g. If users called FactoryFinder.getFactory("invalidfactory"), there should be an IllegalStateException exception is thrown. If it is not possible to have a new release, could you please help to review the patch ? I wonder whether I missed anything.
  
> Throw correct exception while using FactoryFinderProvider SPI
> -------------------------------------------------------------
>
>                 Key: MYFACES-3309
>                 URL: https://issues.apache.org/jira/browse/MYFACES-3309
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: SPI
>    Affects Versions: 2.0.9, 2.1.3
>            Reporter: Ivan
>         Attachments: MYFACES-3309.patch
>
>
> While using FactoryFinderProvider SPI, it is required to check the real exception from InvocationTargetException, and throw some exceptions directly.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (MYFACES-3309) Throw correct exception while using FactoryFinderProvider SPI

Posted by "Ivan (JIRA)" <de...@myfaces.apache.org>.
     [ https://issues.apache.org/jira/browse/MYFACES-3309?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ivan updated MYFACES-3309:
--------------------------

    Status: Patch Available  (was: Open)

> Throw correct exception while using FactoryFinderProvider SPI
> -------------------------------------------------------------
>
>                 Key: MYFACES-3309
>                 URL: https://issues.apache.org/jira/browse/MYFACES-3309
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: SPI
>    Affects Versions: 2.0.9, 2.1.3
>            Reporter: Ivan
>
> While using FactoryFinderProvider SPI, it is required to check the real exception from InvocationTargetException, and throw some exceptions directly.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (MYFACES-3309) Throw correct exception while using FactoryFinderProvider SPI

Posted by "Leonardo Uribe (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/MYFACES-3309?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13108038#comment-13108038 ] 

Leonardo Uribe commented on MYFACES-3309:
-----------------------------------------

I don't think so. This looks like an improvement, instead a bug. It is true the try/catch block wraps all exceptions into a FacesException,and instead it should throw the exceptions like the javadoc of FactoryFinder says. Anyway, the real cause can be found using getCause(), so in practice it is possible to add some code that check that. 

> Throw correct exception while using FactoryFinderProvider SPI
> -------------------------------------------------------------
>
>                 Key: MYFACES-3309
>                 URL: https://issues.apache.org/jira/browse/MYFACES-3309
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: SPI
>    Affects Versions: 2.0.9, 2.1.3
>            Reporter: Ivan
>         Attachments: MYFACES-3309.patch
>
>
> While using FactoryFinderProvider SPI, it is required to check the real exception from InvocationTargetException, and throw some exceptions directly.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (MYFACES-3309) Throw correct exception while using FactoryFinderProvider SPI

Posted by "Ivan (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/MYFACES-3309?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13108317#comment-13108317 ] 

Ivan commented on MYFACES-3309:
-------------------------------

Sometimes, those exceptions are thrown from runtime. e.g. If users called FactoryFinder.getFactory("invalidfactory"), there should be an IllegalStateException exception is thrown. If it is not possible to have a new release, could you please help to review the patch ? I wonder whether I missed anything.

> Throw correct exception while using FactoryFinderProvider SPI
> -------------------------------------------------------------
>
>                 Key: MYFACES-3309
>                 URL: https://issues.apache.org/jira/browse/MYFACES-3309
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: SPI
>    Affects Versions: 2.0.9, 2.1.3
>            Reporter: Ivan
>         Attachments: MYFACES-3309.patch
>
>
> While using FactoryFinderProvider SPI, it is required to check the real exception from InvocationTargetException, and throw some exceptions directly.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (MYFACES-3309) Throw correct exception while using FactoryFinderProvider SPI

Posted by "Ivan (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/MYFACES-3309?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13107859#comment-13107859 ] 

Ivan commented on MYFACES-3309:
-------------------------------

If it is really a bug, is it possible for the community to publish a new 2.0.x ? Or is there a workaround that I could do for it ? Thanks.

> Throw correct exception while using FactoryFinderProvider SPI
> -------------------------------------------------------------
>
>                 Key: MYFACES-3309
>                 URL: https://issues.apache.org/jira/browse/MYFACES-3309
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: SPI
>    Affects Versions: 2.0.9, 2.1.3
>            Reporter: Ivan
>         Attachments: MYFACES-3309.patch
>
>
> While using FactoryFinderProvider SPI, it is required to check the real exception from InvocationTargetException, and throw some exceptions directly.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (MYFACES-3309) Throw correct exception while using FactoryFinderProvider SPI

Posted by "Leonardo Uribe (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/MYFACES-3309?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13108309#comment-13108309 ] 

Leonardo Uribe commented on MYFACES-3309:
-----------------------------------------

In theory if an exception is thrown in that location, that means initialization should be aborted and the web application should not be started. Maybe the problem could be seen in a different way. There is no mechanism in MyFaces to check if a setup for a web application is correct. So if something wrong, it just fails without an explanation. Again, it looks like an improvement. Since the base case using the default algorithm works as expected, I think this issue can wait until next version scheduled in 2 months (or unless another issue with high priority comes out).

> Throw correct exception while using FactoryFinderProvider SPI
> -------------------------------------------------------------
>
>                 Key: MYFACES-3309
>                 URL: https://issues.apache.org/jira/browse/MYFACES-3309
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: SPI
>    Affects Versions: 2.0.9, 2.1.3
>            Reporter: Ivan
>         Attachments: MYFACES-3309.patch
>
>
> While using FactoryFinderProvider SPI, it is required to check the real exception from InvocationTargetException, and throw some exceptions directly.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (MYFACES-3309) Throw correct exception while using FactoryFinderProvider SPI

Posted by "Ivan (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/MYFACES-3309?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13108282#comment-13108282 ] 

Ivan commented on MYFACES-3309:
-------------------------------

Not sure I miss anything, it will cause some JSF compatible cases failed, and did not see there is a way to solve in in integration codes.

> Throw correct exception while using FactoryFinderProvider SPI
> -------------------------------------------------------------
>
>                 Key: MYFACES-3309
>                 URL: https://issues.apache.org/jira/browse/MYFACES-3309
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: SPI
>    Affects Versions: 2.0.9, 2.1.3
>            Reporter: Ivan
>         Attachments: MYFACES-3309.patch
>
>
> While using FactoryFinderProvider SPI, it is required to check the real exception from InvocationTargetException, and throw some exceptions directly.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (MYFACES-3309) Throw correct exception while using FactoryFinderProvider SPI

Posted by "Leonardo Uribe (Updated) (JIRA)" <de...@myfaces.apache.org>.
     [ https://issues.apache.org/jira/browse/MYFACES-3309?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Leonardo Uribe updated MYFACES-3309:
------------------------------------

       Resolution: Fixed
    Fix Version/s: 2.1.4
                   2.0.10
         Assignee: Leonardo Uribe
           Status: Resolved  (was: Patch Available)

I checked the patch and the changes proposed are reasonable. Thanks to Ivan for provide this patch. 
                
> Throw correct exception while using FactoryFinderProvider SPI
> -------------------------------------------------------------
>
>                 Key: MYFACES-3309
>                 URL: https://issues.apache.org/jira/browse/MYFACES-3309
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: SPI
>    Affects Versions: 2.0.9, 2.1.3
>            Reporter: Ivan
>            Assignee: Leonardo Uribe
>             Fix For: 2.0.10, 2.1.4
>
>         Attachments: MYFACES-3309.patch
>
>
> While using FactoryFinderProvider SPI, it is required to check the real exception from InvocationTargetException, and throw some exceptions directly.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira