title: servletengine Unable to send back last chunk: Software caused connection abort: socket write error
body: <p>I have created a bundle for the class com.xxx.cq.wcm.foundation.profile.impl.TnailImages from the foundation file com.day.cq.wcm.foundation.profile.impl.ProfileImages.</p>
  
  <p>Here are the changes I made ot this class</p>
  
  <ol>
  <li><p>width and height for the default foundation class ProfileImages to have our own default width and height in TnailImages.</p></li>
  <li><p>selectors changed to our own like</p>
  
  <ul>
  <li><p>@scr.property name="sling.servlet.selectors" values.0="adjust"</p></li>
  <li><p>values.1="adjust.small"</p></li>
  </ul></li>
  <li><p>Variable changed to  private static final String THUMBNAIL = "small";</p></li>
  <li><p>Metatype annotation won't compile for CQ5.5  I changed this  * @scr.component metatype="false"</p>
  
  <p>to</p>
  
  <ul>
  <li>@Component(immediate = true)</li>
  </ul></li>
  </ol>
  
  <p>This bundle compiled successfully and I see it in OSGi felix console, it is in start mode. Even then I did a restart of this bundle as well as whole CQ5.</p>
  
  <p>When I call an image using the following tag</p>
  
  <p></p>
  
  <p>there are no spases anywhere</p>
  
  <p>the servlet ThumbNailImages is not being call, I see the following error in error.log</p>
  
  <p>servletengine Unable to send back last chunk: Software caused connection abort: socket write error</p>
  
  <p>this image is not being displayed in the page, firebug displays failed to load URL</p>
  
  <p>Default img works fine</p>
  
  <p></p>
  
  <p>Class com.day.cq.wcm.foundation.profile.impl.ProfileImages is available in</p>
  
  <p>/libs/foundation/src/impl/src/main/java/com/day/cq/wcm/foundation/profile/impl/ProfileImages.java</p>
  
  <p>Here are my annotations</p>
  
  <pre><code> * @Component(immediate = true)
   * @scr.service
   * @scr.property name="sling.servlet.resourceTypes" value="nt:file"
   * @scr.property name="sling.servlet.extensions" values.0="res"
   *                          values.1="jpg"
   *                          values.2="png"
   *                          values.3="gif"
   * @scr.property name="sling.servlet.selectors" values.0="adjust"
   *                                              values.1="adjust.small"
   */
  </code></pre>
  
  <p>It seems that this servlet is not being called, when I invoke 
  <a href="http://xyz.com:4502/content/dam/geometrixx/portraits/scott_reynolds.jpg.adjust.small.jpg" rel="nofollow">http://xyz.com:4502/content/dam/geometrixx/portraits/scott_reynolds.jpg.adjust.small.jpg</a>
  I am getting 404 
  Cannot serve request to /content/dam/geometrixx/portraits/scott_reynolds.jpg.adjust.small.jpg in org.apache.sling.servlets.get.DefaultGetServlet</p>
  
  <p>3 (2013-05-20 11:02:40) TIMER_END{2,resolveServlet(JcrNodeResource, type=dam:Asset, superType=null, path=/content/dam/geometrixx/portraits/scott_reynolds.jpg)} Using servlet com.day.cq.dam.core.impl.servlet.BinaryProviderServlet
        3 (2013-05-20 11:02:40) TIMER_END{2,ServletResolution} URI=/content/dam/geometrixx/portraits/scott_reynolds.jpg.adjust.small.jpg handled by Servlet=com.day.cq.dam.core.impl.servlet.BinaryProviderServlet</p>
  
  <p>It seems that my Servlet TnailImages is not being called, it is always going to default servlet.</p>