title: AEM 6.3 - Sling Model not working
body: <p>I am using a very basic Sling Model class which is not working at all. This is the class:</p>
  
  <pre><code>package com.aem.sites.models.test;
  
  import org.apache.sling.models.annotations.Model;
  import org.slf4j.Logger;
  import org.slf4j.LoggerFactory;
  
  import javax.annotation.PostConstruct;
  
  import org.apache.sling.api.resource.Resource;
  
  @Model(adaptables=Resource.class)
  public class TestModel {
  
      final static Logger logger = LoggerFactory.getLogger(TestModel.class);
  
      private String email;
  
      @PostConstruct
      public void init() {
          logger.info("=====================================================================inside init method");
          email = "something@something.com";
      }
  
      public String getEmail() {
          return email;
      }
  }
  </code></pre>
  
  <p>I have also included the package in the  section like this:</p>
  
  <p><a href="https://i.stack.imgur.com/tEyg6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tEyg6.png" alt="enter image description here"></a></p>
  
  <p>I also looked for the Sling Model class here <a href="http://localhost:4502/system/console/status-adapters" rel="nofollow noreferrer">http://localhost:4502/system/console/status-adapters</a> </p>
  
  <p>and found it's entry like this:</p>
  
  <pre><code>Adaptable: org.apache.sling.api.resource.Resource
  Providing Bundle: org.apache.sling.models.impl
  Available Adapters:
   * com.aem.sites.models.test.TestModel
  </code></pre>
  
  <p>What's more surprising to me is the Sling Model class in the package com.aem.sites.models.header is being called properly.</p>
  
  <p>I don't know what's wrong.</p>
  
  <p>Thanks in advance</p>
  
  <p>Sharing the HTL class:</p>
  
  <pre><code>&lt;sly data-sly-use.bannerObj=com.aem.sites.models.test.TestModel"&gt;
  &lt;section id="banner"
      style="background-image: url('/content/dam/aem-site/banner.jpg')"&gt;
      &lt;div class="inner"&gt;
          &lt;h2&gt;Today's temperature is&lt;/h2&gt;
          &lt;p&gt;
               ${bannerObj.email}
          &lt;/p&gt;
          &lt;ul class="actions"&gt;
              &lt;li&gt;&lt;a href="#content" class="button big special"&gt;Sign Up&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="#elements" class="button big alt"&gt;Learn More&lt;/a&gt;&lt;/li&gt;
          &lt;/ul&gt;
      &lt;/div&gt;
  &lt;/section&gt;
  &lt;/sly&gt;
  </code></pre>
  
  <p>By not working I mean nothing is happening. No errors or any logs are appearing in the error.log file.</p>