When trying to inject arguments into the constructor of a CDI bean (ApplicationScoped), I\'m encountering the following issue:
Caused by: org.jboss.weld.exceptio
Splitting
in interface
and implementation won't solve the problem completely.
The Problem is that the interface
will not be ApplicationScoped
, because an ApplicationScoped
Bean needs a Default "no args" Construcutor
, to be proxyable.
Like this it will always create a new instance of the implementation.
So the implementation behaves like a @Dependent
annotated bean.
If you want to solve it this way, you need to use a method with @PostConstruct
to handle the inject of the argument
and only use a non arg constructor
.