title: What could be reason CDI on Java EE not working
body: <p>I added  in pom.xml</p>
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;javax&lt;/groupId&gt;
      &lt;artifactId&gt;javaee-api&lt;/artifactId&gt;
      &lt;version&gt;8.0&lt;/version&gt;
      &lt;scope&gt;provided&lt;/scope&gt;
  &lt;/dependency&gt;
  </code></pre>
  <p>And normally CDI should just be provided by this dependency.</p>
  <p>I deploy my war on a Payara micro server.</p>
  <p>But all the @Inject annotations are not working.
  All the objects are still null.</p>
  <p>For example I have this class:</p>
  <pre><code>@ApplicationScoped
  public class GreetingService {
  
      public String getGreetingTemplate(String language) {
          String result = &quot;Hello %s&quot;;
          switch (language) {
          case &quot;fr&quot;:
              result = &quot;Bonjour %s&quot;;
              break;
          case &quot;de&quot;:
              result = &quot;Willkommen, %s&quot;;
              break;
          }
          return result;
      }
  }
  </code></pre>
  <p>Then I do</p>
  <pre><code>@Stateless
  public class MyClassImpl implements MyClass {
  
      @Inject
      private GreetingService greetingService;
        :
  </code></pre>
  <p>Whatever I do greetingService always is null.
  I have beans.xml even I read since Java EE 7 it is no longer required.
  I even set it to  bean-discovery-mode=&quot;all&quot;  .</p>
  <p>It already gives me headache. I really have not a single clue.</p>