Do not use the OpenWebBeans schema for beans.xml

The OpenWebBeans schema for the beans.xml file is not supported in the Liberty CDI 1.2 implementation. The Liberty CDI 1.2 feature is based on the Weld implementation, which adheres to the Contexts and Dependency Injection for the Java Platform, Enterprise Edition (Java EE) specification for beans.xml.

The following example shows a beans.xml file that is flagged by this rule.

<WebBeans xmlns="urn:java:ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
          xsi:schemaLocation="urn:java:ee http://java.sun.com/jee/beans-1.0.xsd"> 
          ...
</WebBeans> 

The following example shows a beans.xml file that is correctly defined according to the CDI 1.2 specification.

<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">
</beans> 

The automated fix provided by this rule replaces the legacy OpenWebBeans schema in your beans.xml files with the standard CDI schema. Copy the custom configuration to your application build file to enable the fix automation.

If you are considering using CDI 1.2 provided with Java EE 7, see Contexts and Dependency Injection 1.2 behavior changes.