CDI object not proxyable with injected constructor
05:02 03 Oct 2017

When trying to inject arguments into the constructor of a CDI bean (ApplicationScoped), I'm encountering the following issue:

Caused by: org.jboss.weld.exceptions.UnproxyableResolutionException: WELD-001435: Normal scoped bean class xx.Config is not proxyable because it has no no-args constructor - Managed Bean [class xx.Config] with qualifiers [@Default @Named @Any].
    at org.jboss.weld.bean.proxy.DefaultProxyInstantiator.validateNoargConstructor(DefaultProxyInstantiator.java:50)
    at org.jboss.weld.util.Proxies.getUnproxyableClassException(Proxies.java:217)
    at org.jboss.weld.util.Proxies.getUnproxyableTypeException(Proxies.java:178)

However, I do have an injectable constructor on the class:

@Inject
public Config(ConfigLocator configLocator) {
    defaultConfigPath = configLocator.getPath();
    doStuff();
}

With a default constructor, variable injection and a postconstruct method, this all works fine, but I'd prefer the constructor injection in this case.

Any thoughts what is going wrong here?

java dependency-injection cdi weld