title: Resource annotations in Servlets are only working with Java 8, not with Java 11 on a Tomcat 8 server
body: <p>I have developed a HTTP servlet that implements MessageListener and connects to a JMS-based MQ system using javax.jms.ConnectionFactoy.</p>
  <p>The connection factory is injected to the servlet via a Resource annotation.</p>
  <pre><code>@Resource(name = &quot;jms/ConnectionFactory&quot;)
  private ConnectionFactory connectionFactory;
  </code></pre>
  <p>The resource is defined in the context.xml configuration file.</p>
  <p>What I have experienced is that when I compile the servlet using Java 11, the javax.annotation.Ressource is simply ignored, while I can still lookup the resource based on its name in the context directly.
  But, when I compile it using Java 8, the resource is injected to the annotated field in the servlet.</p>
  <p>Can someone explain this?</p>
  <p>Another point is that the javax namespace is replaced by the jakarate one, when migrating from Java EE to Jakarta EE. Most of the JMS library are still implemented using the javax.jms.* interfaces, like ConnectionFactory, Queue, etc.</p>
  <p>Does anyone has experience how compatibility looks like or is a reimplementation of JMS libs necessary?</p>