Hi list,

I have an optional configuration encoded inside a symbol.
I inject the symbol using the annotation (pseudo code below).

@ServiceId("TheService")
public ... build(
        ... ,
        @Symbol("the-optional-symbol") File optionalFile,
        ... ){

}

When I do not provide the symbol (it's an optional configuration) and build the 
service, I got the following exception:

[ERROR] 11:05:05,966 Registry.log: [ 4] Resolving object of type java.io.File 
using MasterObjectProvider
org.apache.tapestry5.ioc.internal.OperationException: No service implements the 
interface java.io.File.

While I expected somehow to get a null value injected (or at least an exception 
from the SymbolSource).

I known that I can inject SymbolSource and manage manually the case, however I 
prefer the framework to do that for me ... if possibile.

My question then is:

                Is that really possible to inject a "non-provived symbol" ?



Reply via email to