Skip to content

Instantly share code, notes, and snippets.

@rajendarreddyj
Created October 21, 2015 18:56
Show Gist options
  • Save rajendarreddyj/1e79c174e9d155b3c64b to your computer and use it in GitHub Desktop.
Save rajendarreddyj/1e79c174e9d155b3c64b to your computer and use it in GitHub Desktop.
Add beans.xml to META-INF or WEB-INF to enable Contexts and Dependency Injection(CDI) for the Java EE Platform. This will avoid NullPointerException while injecting.
<?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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment