You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Bernhard Huemer (JIRA)" <de...@myfaces.apache.org> on 2008/01/12 21:39:34 UTC

[jira] Created: (MYFACES-1802) FacesException and nested exceptions

FacesException and nested exceptions
------------------------------------

                 Key: MYFACES-1802
                 URL: https://issues.apache.org/jira/browse/MYFACES-1802
             Project: MyFaces Core
          Issue Type: Bug
          Components: JSR-127
    Affects Versions: 1.1.5
            Reporter: Bernhard Huemer


The JSF 1.1 specification requires any implementation to support Java 1.3 and that's why the FacesException isn't allowed to utilize builtin exception chaining mechanisms (i.e. initCause(), etc..) as they have been introduced in Java 1.4. However, the FacesException retains it's cause by delegating to the parent's constructor (for example, "super(cause);" or "super(message, cause);"). 

Although this bug is rather easy to fix, I've assigned the priority level 'Major' as it breaks the specification.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (MYFACES-1802) FacesException and nested exceptions

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

Bernhard Huemer commented on MYFACES-1802:
------------------------------------------

The problem is that it seems that noone is using MyFaces 1.1.x in a Java 1.3 environment, but everyone "suffers" from the resulting performance impact. I wouldn't pay attention to every single case where we can improve MyFaces 1.1.x for users still working in a Java 1.3 environment (at least not if there's an impact for our actual userbase and keep in mind that obviously noone has been using MyFaces 1.1.x in a Java 1.3 environment!). Note that the Spring 2.5 developers have dropped Java 1.3 support  ..

Simon, I guess I have to admit that I can't find something regarding method linkage in the JLS either, but then we can still introduce an additional indirection, for example by using an interface "ExceptionCauseRetriever" with two implementations, one assuming that it is running a Java >= 1.4 environment and the other one using reflection to support backward compatible exceptions too (just as Mario suggested).

> FacesException and nested exceptions
> ------------------------------------
>
>                 Key: MYFACES-1802
>                 URL: https://issues.apache.org/jira/browse/MYFACES-1802
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: JSR-127
>    Affects Versions: 1.1.5
>            Reporter: Bernhard Huemer
>             Fix For:  1.1.6-SNAPSHOT
>
>         Attachments: MyFaces-1802.patch
>
>
> The JSF 1.1 specification requires any implementation to support Java 1.3 and that's why the FacesException isn't allowed to utilize builtin exception chaining mechanisms (i.e. initCause(), etc..) as they have been introduced in Java 1.4. However, the FacesException retains it's cause by delegating to the parent's constructor (for example, "super(cause);" or "super(message, cause);"). 
> Although this bug is rather easy to fix, I've assigned the priority level 'Major' as it breaks the specification.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (MYFACES-1802) FacesException and nested exceptions

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

Simon Kitching commented on MYFACES-1802:
-----------------------------------------

This looks good to me. And yes I think serialVersionUID does need to be updated.

However I see a dozen places elsewhere in the api module code where Throwable.getCause() is being called, so they would also need to be somehow fixed. It's clear that no-one has tried to run this on java 1.3 for a very long time..

> FacesException and nested exceptions
> ------------------------------------
>
>                 Key: MYFACES-1802
>                 URL: https://issues.apache.org/jira/browse/MYFACES-1802
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: JSR-127
>    Affects Versions: 1.1.5
>            Reporter: Bernhard Huemer
>         Attachments: MyFaces-1802.patch
>
>
> The JSF 1.1 specification requires any implementation to support Java 1.3 and that's why the FacesException isn't allowed to utilize builtin exception chaining mechanisms (i.e. initCause(), etc..) as they have been introduced in Java 1.4. However, the FacesException retains it's cause by delegating to the parent's constructor (for example, "super(cause);" or "super(message, cause);"). 
> Although this bug is rather easy to fix, I've assigned the priority level 'Major' as it breaks the specification.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (MYFACES-1802) FacesException and nested exceptions

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

Bernhard Huemer commented on MYFACES-1802:
------------------------------------------

Well, not every single call to getCause() is illegal as most of the time it's either a FacesException or an EvaluationException being asked for its cause. However, it wouldn't be advisable to remove all calls to Throwable.getCause() as I think we have to leverage builtin exception chaining in order to provide more meaningful error messages but only if MyFaces is running in the appropriate environment (i.e. the version of the Java VM is at least 1.4). I've already seen code that uses reflection to check for the existence of for example initCause() to determine whether it's safe to call getCause(), but I'd rather parse the java.version system property (just as for example Spring does).

> FacesException and nested exceptions
> ------------------------------------
>
>                 Key: MYFACES-1802
>                 URL: https://issues.apache.org/jira/browse/MYFACES-1802
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: JSR-127
>    Affects Versions: 1.1.5
>            Reporter: Bernhard Huemer
>         Attachments: MyFaces-1802.patch
>
>
> The JSF 1.1 specification requires any implementation to support Java 1.3 and that's why the FacesException isn't allowed to utilize builtin exception chaining mechanisms (i.e. initCause(), etc..) as they have been introduced in Java 1.4. However, the FacesException retains it's cause by delegating to the parent's constructor (for example, "super(cause);" or "super(message, cause);"). 
> Although this bug is rather easy to fix, I've assigned the priority level 'Major' as it breaks the specification.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (MYFACES-1802) FacesException and nested exceptions

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

Simon Kitching resolved MYFACES-1802.
-------------------------------------

       Resolution: Fixed
    Fix Version/s:  1.1.6-SNAPSHOT

Ok, fixed. However I have not extensively tested it, as this requires triggering an exception to really try it out.

It wasn't such a big patch as I first thought; as Bernhard noted most of those getCause() calls were actually to FacesException or subclasses of it. In the end only two classes needed to be fixed.

Bernhard, regarding just checking java.version, I presume you mean:
   if (java.version is  1.4 or later)
     return ex.getCause();
  else
    return null;

This relies on the jvm not trying to resolve the linkage for a method call until the call is actually invoked. This does seem to be the way that Sun's jvm works but I've never seen anything in the java specifications that say that this is actually required, so I'd rather use reflection.

> FacesException and nested exceptions
> ------------------------------------
>
>                 Key: MYFACES-1802
>                 URL: https://issues.apache.org/jira/browse/MYFACES-1802
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: JSR-127
>    Affects Versions: 1.1.5
>            Reporter: Bernhard Huemer
>             Fix For:  1.1.6-SNAPSHOT
>
>         Attachments: MyFaces-1802.patch
>
>
> The JSF 1.1 specification requires any implementation to support Java 1.3 and that's why the FacesException isn't allowed to utilize builtin exception chaining mechanisms (i.e. initCause(), etc..) as they have been introduced in Java 1.4. However, the FacesException retains it's cause by delegating to the parent's constructor (for example, "super(cause);" or "super(message, cause);"). 
> Although this bug is rather easy to fix, I've assigned the priority level 'Major' as it breaks the specification.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (MYFACES-1802) FacesException and nested exceptions

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

Mario Ivankovits commented on MYFACES-1802:
-------------------------------------------

I'd check the existence of getCause() using reflection as then it will also work with pre Java 1.4 Exceptions implementing getCause() - for example those Exceptions prepared to be backward compatible.

> FacesException and nested exceptions
> ------------------------------------
>
>                 Key: MYFACES-1802
>                 URL: https://issues.apache.org/jira/browse/MYFACES-1802
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: JSR-127
>    Affects Versions: 1.1.5
>            Reporter: Bernhard Huemer
>         Attachments: MyFaces-1802.patch
>
>
> The JSF 1.1 specification requires any implementation to support Java 1.3 and that's why the FacesException isn't allowed to utilize builtin exception chaining mechanisms (i.e. initCause(), etc..) as they have been introduced in Java 1.4. However, the FacesException retains it's cause by delegating to the parent's constructor (for example, "super(cause);" or "super(message, cause);"). 
> Although this bug is rather easy to fix, I've assigned the priority level 'Major' as it breaks the specification.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (MYFACES-1802) FacesException and nested exceptions

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

Bernhard Huemer commented on MYFACES-1802:
------------------------------------------

Introducing a new interface with two implementations ... it seems that I've overengineered the problem a little bit. As we only use reflection in an error case, I think it's fine if we keep status quo (i.e. the changes that Simon has commited). 

> FacesException and nested exceptions
> ------------------------------------
>
>                 Key: MYFACES-1802
>                 URL: https://issues.apache.org/jira/browse/MYFACES-1802
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: JSR-127
>    Affects Versions: 1.1.5
>            Reporter: Bernhard Huemer
>             Fix For:  1.1.6-SNAPSHOT
>
>         Attachments: MyFaces-1802.patch
>
>
> The JSF 1.1 specification requires any implementation to support Java 1.3 and that's why the FacesException isn't allowed to utilize builtin exception chaining mechanisms (i.e. initCause(), etc..) as they have been introduced in Java 1.4. However, the FacesException retains it's cause by delegating to the parent's constructor (for example, "super(cause);" or "super(message, cause);"). 
> Although this bug is rather easy to fix, I've assigned the priority level 'Major' as it breaks the specification.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.