我正在将一个应用程序迁移到JavaEE7,并希望迁移到CDI1.1。但我不明白bean-discovery-mode="annotated"的意思。CDI 1.1 specification不是很有帮助。至少我没有找到任何有用的段落。我错过了吗?
此示例可以很好地与bean-discovery-mode="all"一起运行,并注入LoggingClass的一个实例
public class LoggingClass {
public Logger logger = Logger.getLogger("ALOGGER");
}
@Test
public class MMLoggerProducerIT extends Arquillian {
@Inject private LoggingClass lc;
}但是,如果我从bean-discovery-mode="all"更改为bean-discovery-mode="annotated",容器就不能将实例注入字段lc。
要正确使用bean-discovery-mode="annotated",我必须如何注释LoggingClass?
https://stackoverflow.com/questions/18310388
复制相似问题