james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hontvari Jozsef" <hontva...@solware.com>
Subject getInitAttribute (WAS: exception: No attribute named "onMailetException")
Date Wed, 25 Jun 2003 08:17:53 GMT
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" <hontvari3@solware.com>
To: "James Developers List" <james-dev@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


Mime
View raw message