I agree it's a very odd error report,

I 'd just like to add that you could protect your hairiness level
contributing to the factory default defaults service, there you can define
factory defaults to symbols which in some cases saves you from crashing in
that way.

Of course there 're some situations a default value is not an option so I
'm happy Howard also agrees to change the error reporting in these cases...
but anyway that's my two cents. (by the way it would be great to have a
default value for hairiness set to false!)


Nicolás.-


On Sat, Apr 20, 2013 at 1:43 PM, Michael Prescott <
michael.r.presc...@gmail.com> wrote:

> I'm using Symbols injected into my app's tapestry module to read web
> context init parameters.
>
> class MyModule {
>    @Inject
>    @Symbol("myapp.hairinesslevel")
>    private int hairinessLevel;
> }
>
> I run the app in a bunch of different ways - in jetty:run, deployed as a
> service, and in a web container, so occasionally I forget to define a
> symbol.
>
> Unfortunately, that tends to result in a very hard to read error about
> recursion in the definition of 'ApplicationDefaults'.
>
> Is there some canonical approach for injecting symbol that produces cleaner
> error messages when the symbol is undefined?
>
> Gratefully,
>
> Michael
>

Reply via email to