CDI object not proxyable with injected constructor

前端 未结 5 1952
广开言路
广开言路 2021-02-20 01:07

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         


        
5条回答
  •  [愿得一人]
    2021-02-20 02:09

    The non-private, no-arg constructor is needed for the implementation to create a proxy to your managed bean You don't lose the functionality of your injected constructor based on the presence of the non-private, no-arg constructor.

    The container uses proxies to allow things like interception, decoration, and to retrieve the right contextual instance when the bean is dereferenced. It's also needed to allow circular injection between beans.

提交回复
热议问题