You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by Robert Godfrey <ro...@gmail.com> on 2010/03/23 01:23:45 UTC

Re: [Java] The use of setLinkedException in JMSException is not a good idea

I agree we should use initCause *in addition to* setLinkedException

-- Rob

On 22 March 2010 21:03, Rajith Attapattu <ra...@gmail.com> wrote:

> I would rather prefer to use initCause instead of (actually alongside)
> setLinkedException in JMSException as the latter looses the stack
> trace which makes it very difficult to debug.
> Since the entire stack trace is not visible it's not easy to figure
> out the underlying root cause.
> More often than not, the real reason is not visible at all !
> Ex. If a queue reaches it's limit, the JMS client will throw an
> exception on the send but has no useful information to say that it was
> due to a resource exceeded condition.
>
> We need to ensure that our exception handling conveys as much
> information as possible.
> Therefore I suggest we use initCause method as it preserve the stack trace.
>
> Regards,
>
> Rajith Attapattu
> Red Hat
> http://rajith.2rlabs.com/
>
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project:      http://qpid.apache.org
> Use/Interact: mailto:dev-subscribe@qpid.apache.org
>
>

Re: [Java] The use of setLinkedException in JMSException is not a good idea

Posted by Rajith Attapattu <ra...@gmail.com>.
Thx, I really appreciate it.
I have committed the patch.

Rajith

On Tue, May 11, 2010 at 11:29 AM, Emmanuel Bourg <eb...@apache.org> wrote:
> Le 11/05/2010 15:44, Rajith Attapattu a écrit :
>
>> I am slammed atm, so a patch would be very much appreciated !
>
> Here it is:
>
> https://issues.apache.org/jira/browse/QPID-2594
>
> https://issues.apache.org/jira/secure/attachment/12444205/initcause.patch
>
> Emmanuel Bourg
>
>



-- 
Regards,

Rajith Attapattu
Red Hat
http://rajith.2rlabs.com/

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: [Java] The use of setLinkedException in JMSException is not a good idea

Posted by Emmanuel Bourg <eb...@apache.org>.
Le 11/05/2010 15:44, Rajith Attapattu a écrit :

> I am slammed atm, so a patch would be very much appreciated !

Here it is:

https://issues.apache.org/jira/browse/QPID-2594

https://issues.apache.org/jira/secure/attachment/12444205/initcause.patch

Emmanuel Bourg


Re: [Java] The use of setLinkedException in JMSException is not a good idea

Posted by Rajith Attapattu <ra...@gmail.com>.
Emmanuel,

I am slammed atm, so a patch would be very much appreciated !

Rajith

On Mon, May 10, 2010 at 4:33 PM, Emmanuel Bourg <eb...@apache.org> wrote:
> Le 23/03/2010 13:57, Rajith Attapattu a écrit :
>>
>> Thanks for the input.
>> I will create a JIRA and take care of this.
>
> This change would be much welcome. I didn't find the JIRA report, if you
> want I can provide a patch addressing this issue.
>
> Emmanuel Bourg
>
>



-- 
Regards,

Rajith Attapattu
Red Hat
http://rajith.2rlabs.com/

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: [Java] The use of setLinkedException in JMSException is not a good idea

Posted by Emmanuel Bourg <eb...@apache.org>.
Le 11/05/2010 12:48, Andrew Kennedy a écrit :

> Don't we need to use setLinkedException, since it's the JMS
> specification required mechanism. If you wanted to add an initCause,
> that would be in addition to this, since some JMS clients would expect
> the setLinkedException to be set?

Yes, that's what Aidan and Robert proposed.

Emmanuel Bourg


Re: [Java] The use of setLinkedException in JMSException is not a good idea

Posted by Andrew Kennedy <an...@gmail.com>.
On 10 May 2010 21:33, Emmanuel Bourg <eb...@apache.org> wrote:
> Le 23/03/2010 13:57, Rajith Attapattu a écrit :
>>
>> Thanks for the input.
>> I will create a JIRA and take care of this.
>
> This change would be much welcome. I didn't find the JIRA report, if you
> want I can provide a patch addressing this issue.
>
> Emmanuel Bourg

Don't we need to use setLinkedException, since it's the JMS
specification required mechanism. If you wanted to add an initCause,
that would be in addition to this, since some JMS clients would expect
the setLinkedException to be set?

Andrew.
-- 
-- andrew d kennedy ? edinburgh : +44 7941 197 134

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: [Java] The use of setLinkedException in JMSException is not a good idea

Posted by Emmanuel Bourg <eb...@apache.org>.
Le 23/03/2010 13:57, Rajith Attapattu a écrit :
> Thanks for the input.
> I will create a JIRA and take care of this.

This change would be much welcome. I didn't find the JIRA report, if you 
want I can provide a patch addressing this issue.

Emmanuel Bourg


Re: [Java] The use of setLinkedException in JMSException is not a good idea

Posted by Rajith Attapattu <ra...@gmail.com>.
Thanks for the input.
I will create a JIRA and take care of this.

Rajith

On Mon, Mar 22, 2010 at 11:18 PM, Aidan Skinner <ai...@gmail.com> wrote:
> On Tue, Mar 23, 2010 at 12:23 AM, Robert Godfrey
> <ro...@gmail.com> wrote:
>
>> I agree we should use initCause *in addition to* setLinkedException
>
> This. We should probably switch everything that uses one or the other
> to use both.
>
> - Aidan
>
> --
> Apache Qpid - AMQP, JMS, other messaging love http://qpid.apache.org
> "A witty saying proves nothing" - Voltaire
>
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project:      http://qpid.apache.org
> Use/Interact: mailto:dev-subscribe@qpid.apache.org
>
>



-- 
Regards,

Rajith Attapattu
Red Hat
http://rajith.2rlabs.com/

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: [Java] The use of setLinkedException in JMSException is not a good idea

Posted by Aidan Skinner <ai...@gmail.com>.
On Tue, Mar 23, 2010 at 12:23 AM, Robert Godfrey
<ro...@gmail.com> wrote:

> I agree we should use initCause *in addition to* setLinkedException

This. We should probably switch everything that uses one or the other
to use both.

- Aidan

-- 
Apache Qpid - AMQP, JMS, other messaging love http://qpid.apache.org
"A witty saying proves nothing" - Voltaire

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org