WELD-001435: Normal scoped bean class ... is not proxyable because it has no no-args constructor in JBoss EAP 7
Issue
- We are trying to product an @ApplicationScoped bean that has no no-arg constructor and getting this error below.
@Produces
@ApplicationScoped
@Named("admin")
public BeanWithoutDefaultConstructorAdmin getAdmin(@Named("deployment") final BeanWithDefaultConstructorDeployment deployment) {
return new BeanWithoutDefaultConstructorAdmin(deployment);
}
@Produces
@Dependent
@Named("realm")
public BeanWithoutDefaultConstructorRealm getRealm( @Named("admin") final BeanWithoutDefaultConstructorAdmin admin ){
return admin.realm("test");
}
Error:
Caused by: org.jboss.weld.exceptions.UnproxyableResolutionException: WELD-001435: Normal scoped bean class com.jboss.examples.cdi.BeanWithoutDefaultConstructorAdmin is not proxyable because it has no no-args constructor - Producer Method [BeanWithoutDefaultConstructorAdmin] with qualifiers [@Default @Named @Any] declared as [[BackedAnnotatedMethod] @Produces @ApplicationScoped @Named public com.jboss.examples.cdi.MyProducer.getKeycloakAdminClient(@Named BeanWithDefaultConstructorDeployment)].
Environment
Red Hat JBoss Enterprise Application Platform (EAP) 7
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.