[jboss-as7-dev] How to report exception cause in AS7 consoles?

Jason T. Greene jason.greene at redhat.com
Wed Mar 21 10:38:46 EDT 2012


On 3/21/12 8:21 AM, Alexey Loubyansky wrote:
> Good topic.
>
> On 03/21/2012 11:25 AM, Jeff Mesnil wrote:
>> Hi,
>>
>> I am working on a messaging issue[1] to add more contextual info when
>> reporting messaging failure on CLI operations.
>>
>> In this case, a JMS queue can not been added because the user specified
>> an invalid filter.
>> We throw a StartException with a cause Throwable (corresponding to the
>> invalid filter parsing) but the CLI console displays only the
>> StartException's message 'failed to create queue' and not its cause.
>>
>> I have several ways to fix the issue and I am not sure which one is the
>> more appropriate for AS7:
>>
>> 1) I can fix the code in the messaging subsystem to append the cause's
>> localized message to the StartException message every time I throw one
>>
>> 2) In the controller code, when I report the StartException to the user,
>> I append the cause's l10ned message (if there is a cause) to
>> StartException.toString() message (this impacts all thrown
>> StartException, not only those from messaging subsystem)
>>
>> 3) I update StartException.toString() to append the cause message
>>
>> I prefer (3) since as it is the only place where I would have to deal
>> with this but I don't realize the whole implication.
>
>    From these 3, the third one is less "evil".

Another option is that you can add extra validation to the Add* 
operations before you even get to the point of starting the service.

-- 
Jason T. Greene
JBoss AS Lead / EAP Platform Architect
JBoss, a division of Red Hat


More information about the jboss-as7-dev mailing list