CDI: beans.xml, where do I put you?

前端 未结 3 1244
萌比男神i
萌比男神i 2020-11-28 06:50

I am using Weld as CDI implementation. My integration test, that tries to assemble object graph instantiating Weld container works well, when I have empty b

3条回答
  •  粉色の甜心
    2020-11-28 07:18

    Just to complement the above answer, here is an official reference on this: https://docs.oracle.com/javaee/6/tutorial/doc/gjbnz.html

    quote:

    An application that uses CDI must have a file named beans.xml. The file can be completely empty (it has content only in certain limited situations), but it must be present. For a web application, the beans.xml file must be in the WEB-INF directory. For EJB modules or JAR files, the beans.xml file must be in the META-INF directory.

提交回复
热议问题