I have two Managed Beans:
SessionBean:
@Named(value = "sessionBean")
@SessionScoped
public class SessionBean implements Serializable {
  private final Param param
  SessionBean(Param param) {
      this.param = param;
  }
}
and TypesBean:
@Named(value = "typesBean")
@RequestScoped
public class TypesBean {
  @Inject
  private SessionBean session;
}
The project builds, but does not deploy:
Error occurred during deployment: Exception while loading the app : WELD-001410 The injection point [field] @Inject private com.example.TypesBean.session has non-proxyable dependencies. Please see server.log for more details.
What's the problem?
The problem is the lack of an accessible no-args constructor on the SessionBean class.
One solution as the OP pointed out is:
"The problem was in
finalmethods of SessionBean. Removingfinaland making methods just public - solve the problem. Sorry for wasting your time. "
Or alternatively...
@Named(value = "sessionBean")
@SessionScoped
public class SessionBean implements Serializable {
  . . . //variables, setters, getters and other methods
  private final Param param
  public SessionBean(Param param) {
      this.param = param;
  }
  // no-args constructor used by CDI for proxying only 
  // but is subsequently replaced with an instance 
  // created using the above constructor. 
  protected SessionBean() {
     this(null);
  }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With