This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | Injecting a POJO shows a warning message | ||
---|---|---|---|
Product: | javaee | Reporter: | arungupta <arungupta> |
Component: | CDI | Assignee: | Denis Anisimov <ads> |
Status: | RESOLVED DUPLICATE | ||
Severity: | normal | ||
Priority: | P3 | ||
Version: | 7.1 | ||
Hardware: | PC | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: |
Description
arungupta
2012-02-13 12:48:01 UTC
What exactly is incorrect ? A POJO can be injected as is, it is a direct target of injection. Why warning ? There can be a number of reasons when typesafe resolution cannot find eligible for injection element: f.e. bean is disabled, has normal scope and is not proxyable . Please describe exact situation : - class with injected point - your POJO. I need all information to be able to reproduce this issue. POJO is not enough information . POJO is: @Model public class CustomerName { private String value; public String getValue() { return value; } public void setValue(String value) { this.value = value; } } Injected in a stateless session bean as: @Stateless @LocalBean @Named @Path("/customers") public class CustomerSessionBean { @PersistenceContext EntityManager em; @Inject CustomerName name; List<Customer> cust; The last line gives the warning message. @javax.enterprise.inject.Model' definition : @Named @RequestScoped @Stereotype @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME) public @interface Model {} So it is @RequestedScoped and CustomerName class has a normal scope. This is duplicate of issue #201825 *** This bug has been marked as a duplicate of bug 201825 *** Thanks, that explains! |