9.2. Use CDI
9.2.1. First Steps
184.108.40.206. Enable CDI
Contexts and Dependency Injection (CDI) is one of the core technologies in JBoss EAP 6, and is enabled by default. If for some reason it is disabled and you need to enable it, follow this procedure.
Procedure 9.1. Enable CDI in JBoss EAP 6
Check to see if the CDI subsystem details are commented out of the configuration file.A subsystem can be disabled by commenting out the relevant section of the
standalone.xmlconfiguration files, or by removing the relevant section altogether.To find the CDI subsystem in
EAP_HOME/standalone/configuration/standalone.xml, search them for the following string. If it exists, it is located inside the <extensions> section.
<extension module="org.jboss.as.weld"/>The following line must also be present in the profile you are using. Profiles are in individual <profile> elements within the <profiles> section.
Before editing any files, stop JBoss EAP 6.JBoss EAP 6 modifies the configuration files during the time it is running, so you must stop the server before you edit the configuration files directly.
Edit the configuration file to restore the CDI subsystem.If the CDI subsystem was commented out, remove the comments.If it was removed entirely, restore it by adding this line to the file in a new line directly above the </extensions> tag:
- You also need to add the following line to the relevant profile in the <profiles> section.
Restart JBoss EAP 6.Start JBoss EAP 6 with your updated configuration.
JBoss EAP 6 starts with the CDI subsystem enabled.