我有一个关于bean.xml文件的正确格式和用法的问题。在我的项目中,我通常用这个内容我bean.xml文件(不使用explizit bean声明):CDI - 什么是正确的bean.xml格式?
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
</beans>
这非常适用于WildFly 8和9。但我不得不在GlassFish中4部署问题在问题:Glassfish 4, simple example in CDI fails with WELD-001408 Unsatisfied dependencies我写了一个替代格式:
<beans
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/beans_1_1.xsd"
bean-discovery-mode="all">
</beans>
使用了不同的命名空间。 GlassFish4似乎关心这一点。
什么是空bean.xml的正确格式用于JEE7的文件?