3 Replies Latest reply on Oct 31, 2012 1:34 PM by john.p.71

    Servlet Not Getting Resolved

    john.p.71 Level 1

      We've been using CQ since 5.0.  We recently setup a prototype CQ 5.5 runing it as a war file inside of Tomcat.  Everything seems to be going smoothly, until we started writing servlets like we always have.  The servlet derives from org.apache.sling.api.servlets.SlingAllMethodsServlet and includes SlingServlet annotations to register it in OSGi:


      @Service(value = Servlet.class)

      @SlingServlet(generateService = true, paths = { "/bin/myservlet" }, resourceTypes = { "aptimus/cq/myservlet" }, extensions = {

                          "html", "xml", "css", "json" })

      public class MyServlet extends SlingAllMethodsServlet {




      When I look at the system console (Felix), I can see the configuration for the servlet got registered with the appropriate path, extensions, etc.  I also verified in Felix that the "/bin/" path is registered in the "Execution Paths" part of the "Apache Sling Servlet/Script Resolver and Error Handler".


      All that being said, though, when I try to access it I get:

      No resource found


      0 (2012-10-31 12:00:08) TIMER_START{Request Processing}

      0 (2012-10-31 12:00:08) COMMENT timer_end format is {<elapsed msec>,<timer name>} <optional message>

      0 (2012-10-31 12:00:08) LOG Method=GET, PathInfo=/bin/myservlet.css

      0 (2012-10-31 12:00:08) TIMER_START{ResourceResolution}

      1 (2012-10-31 12:00:08) TIMER_END{1,ResourceResolution} URI=/cq/55/bin/myservlet.css resolves to Resource=NonExistingResource, path=/bin/myservlet.css

      1 (2012-10-31 12:00:08) LOG Resource Path Info: SlingRequestPathInfo: path='/bin/myservlet.css', selectorString='null', extension='css', suffix='null'



      Any ideas?  This seems like something new in CQ 5.5...this sort of thing used to work fine in CQ 5.4.