You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by Hontvari Jozsef <ho...@solware.com> on 2003/06/25 09:59:05 UTC

exception: No attribute named "onMailetException"

I have got an error notification email with the following reason:

"Error message below:
Embedded configuration exception was: No attribute named "onMailetException"
is associated with the configuration element "mailet" at
file:/C:/james/apps/james/SAR-INF/config.xml:178:-1"

(Interestingly I cannot find this message in the log, which may indicate
another problem.)

Looking at the source of MailetConfigImpl and the javadoc of the avalon
Configuration class it turns out that the avalon class throws an exception
if the attribute is not supplied. (On the other hand it has another method,
which has a default value parameter, that doesn't throw an exception). The
javadoc on MailetConfigImpl getInitAttribute doesn't specify its behaviour
if the attribute is not supplied. Actually it throws a RuntimeException. I
am not sure what was to original intent, but the it should be decided and
documented. (I can submit a patch if it is decided.)




---------------------------------------------------------------------
To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-dev-help@jakarta.apache.org


RE: getInitAttribute (WAS: exception: No attribute named "onMailetException")

Posted by Vincenzo Gianferrari Pini <vi...@praxis.it>.
> I guess the original assumption was that avalon Configuration 
> doesn't throw
> an exception on a not supplied attribute, and an occassional
> ConfigurationException indicates some exotic problem.
> 
Exact, that is what I had assumed.

> current implementation of getInitAttribute(String name):
>         try {
>             return configuration.getAttribute(name);
>         } catch (ConfigurationException ce) {
>             throw new RuntimeException("Embedded configuration exception
> was: " + ce.getMessage());
>         }
> 
> I propose the following change:
> doc: it returns the attribute value or null if the attribute is 
> not supplied
> or empty
> code: return configuration.getAttribute(name, null);
> 

Thanks for the diagnosis and the suggestion. I'll commit it up in a few minutes.

Vincenzo


---------------------------------------------------------------------
To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-dev-help@jakarta.apache.org


getInitAttribute (WAS: exception: No attribute named "onMailetException")

Posted by Hontvari Jozsef <ho...@solware.com>.
I guess the original assumption was that avalon Configuration doesn't throw
an exception on a not supplied attribute, and an occassional
ConfigurationException indicates some exotic problem.

current implementation of getInitAttribute(String name):
        try {
            return configuration.getAttribute(name);
        } catch (ConfigurationException ce) {
            throw new RuntimeException("Embedded configuration exception
was: " + ce.getMessage());
        }

I propose the following change:
doc: it returns the attribute value or null if the attribute is not supplied
or empty
code: return configuration.getAttribute(name, null);






----- Original Message ----- 
From: "Hontvari Jozsef" <ho...@solware.com>
To: "James Developers List" <ja...@jakarta.apache.org>
Sent: Wednesday, June 25, 2003 9:59 AM
Subject: exception: No attribute named "onMailetException"


> I have got an error notification email with the following reason:
>
> "Error message below:
> Embedded configuration exception was: No attribute named
"onMailetException"
> is associated with the configuration element "mailet" at
> file:/C:/james/apps/james/SAR-INF/config.xml:178:-1"
>
> (Interestingly I cannot find this message in the log, which may indicate
> another problem.)
>
> Looking at the source of MailetConfigImpl and the javadoc of the avalon
> Configuration class it turns out that the avalon class throws an exception
> if the attribute is not supplied. (On the other hand it has another
method,
> which has a default value parameter, that doesn't throw an exception). The
> javadoc on MailetConfigImpl getInitAttribute doesn't specify its behaviour
> if the attribute is not supplied. Actually it throws a RuntimeException. I
> am not sure what was to original intent, but the it should be decided and
> documented. (I can submit a patch if it is decided.)
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: james-dev-help@jakarta.apache.org
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-dev-help@jakarta.apache.org