OmniFaces cdi Param does not work using in constructor injection #295

temaleva opened this Issue Aug 5, 2016 · 3 comments


None yet

2 participants

temaleva commented Aug 5, 2016

I have the application that uses together omnifaces, deltaspike and weld as cdi implementation.
trying to use Param in this code to be injected in constructor

public class RequestParameterHelperImpl{

String token;

    RequestParameterHelperImpl( @Param String token) {
        this.token = token;

I get following Deployment Exception. 
Weld is able to find deltaspike property producer, (but that is not match by qualifier and this OK) and is not able to find omnifaces Param.
(With field injection everything works fine.)

org.jboss.weld.exceptions.DeploymentException: WELD-001408: Unsatisfied dependencies for type String with qualifiers @Param
  at injection point [BackedAnnotatedParameter] Parameter 1 of [BackedAnnotatedConstructor] @Inject String)
WELD-001475: The following beans match by type, but none have matching qualifiers:
  - Producer Method [String] with qualifiers [@ConfigProperty @Any] declared as [[BackedAnnotatedMethod] @Produces @Dependent @ConfigProperty public org.apache.deltaspike.core.impl.config.DefaultConfigPropertyProducer.produceStringConfiguration(InjectionPoint)]

    at org.jboss.weld.bootstrap.Validator.validateInjectionPointForDeploymentProblems(
    at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(
    at org.jboss.weld.bootstrap.Validator.validateGeneralBean(
    at org.jboss.weld.bootstrap.Validator.validateRIBean(
    at org.jboss.weld.bootstrap.Validator.validateBean(
    at org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(
    at org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(
    at org.jboss.weld.executor.IterativeWorkerTaskFactory$
    at org.jboss.weld.executor.IterativeWorkerTaskFactory$
    at java.util.concurrent.ThreadPoolExecutor.runWorker(
    at java.util.concurrent.ThreadPoolExecutor$

BalusC commented Aug 5, 2016

@Param is only supported on fields, not on method arguments.

We will clarify documentation on this.

BalusC commented Aug 14, 2016 edited

I have to take back my previous comment. It actually worked in Tomcat + Weld 2.3.5, but you have to explicitly specify a name.

public class Bean {

    public Bean(@Param(name="token") String token) {
        // ...


Only dynamic types (i.e. non-String types) are not supported and will produce exactly the exception as you reported.

Not sure why String didn't work for you, but extracting the name from the constructor argument will not work (this information is not available in bytecode). I will at least improve the documentation on this and add support for dynamic types here.

@BalusC BalusC closed this in 245ae13 Aug 14, 2016
BalusC commented Aug 14, 2016

Fix is available in today's latest 2.5-SNAPSHOT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment