AEM 6 - invoke Servlet (GET) - servlet as it is not in the list of allowed paths | Community
Skip to main content
Level 2
August 28, 2017
Solved

AEM 6 - invoke Servlet (GET) - servlet as it is not in the list of allowed paths

  • August 28, 2017
  • 6 replies
  • 7497 views

Hello everyone,

maybe it is a dummy question but I couldn't found a solution until now.

I have this simple Servlet:

@SlingServlet(

        paths={"/schafbergbahn/ticker"},

        methods = "GET",

        metatype=true

        )

public class SimpleServlet extends org.apache.sling.api.servlets.SlingAllMethodsServlet {

    @Override

    protected void doGet(final SlingHttpServletRequest req,

            final SlingHttpServletResponse resp) throws ServletException, IOException {

        resp.getOutputStream().println(

                "This content is generated by the SimpleServlet - QUMA");

    }

}

deployed in my AEM 6.2 environment and if I invoke this servlet with

    http://localhost:4552/myPath/ticker/

I get a HTTP 403 Forbidden (at bottom).

Does anyone know how I can solve this issue?

Thanks a lot!

Forbidden

Cannot serve request to /myPath/ticker/ in org.apache.sling.servlets.get.DefaultGetServlet

Request Progress:

0 TIMER_START{Request Processing} 
0 COMMENT timer_end format is {<elapsed msec>,<timer name>} <optional message>
0 LOG Method=GET, PathInfo=/myPath/ticker/
0 TIMER_START{ResourceResolution}
0 TIMER_END{0,ResourceResolution} URI=/myPath/ticker/ resolves to Resource=ServletResource, servlet=at.my.package.name.core.servlets.SimpleServlet, path=/myPath/ticker
0 LOG Resource Path Info: SlingRequestPathInfo: path='/MyPath/ticker', selectorString='null', extension='null', suffix='/'
0 TIMER_START{ServletResolution}
0 TIMER_START{resolveServlet(/myPath/ticker)} 0 LOG Will not look for a servlet at /myPath/ticker.servlet as it is not in the list of allowed paths
0 TIMER_END{0,resolveServlet(/myPath/ticker)} Using servlet org.apache.sling.servlets.get.DefaultGetServlet
0 TIMER_END{0,ServletResolution} URI=/myPath/ticker/ handled by Servlet=org.apache.sling.servlets.get.DefaultGetServlet
0 LOG Applying Requestfilters
0 LOG Calling filter: com.adobe.granite.resourceresolverhelper.impl.ResourceResolverHelperImpl 0 LOG Calling filter: org.apache.sling.bgservlets.impl.BackgroundServletStarterFilter
0 LOG Calling filter: com.adobe.granite.rest.impl.servlet.ApiResourceFilter
0 LOG Calling filter: org.apache.sling.i18n.impl.I18NFilter 0 LOG Calling filter: com.adobe.granite.httpcache.impl.InnerCacheFilter
0 LOG Calling filter: org.apache.sling.rewriter.impl.RewriterFilter
0 LOG Calling filter: com.adobe.cq.mcm.campaign.servlets.CampaignCopyTracker 0 LOG Calling filter: com.day.cq.wcm.core.impl.WCMRequestFilter
0 LOG Calling filter: com.adobe.cq.history.impl.HistoryRequestFilter
0 LOG Calling filter: com.adobe.granite.optout.impl.OptOutFilter 0 LOG Calling filter: com.day.cq.wcm.foundation.forms.impl.FormsHandlingServlet
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by viveksachdeva

Under Config manager, search for "Apache Sling Servlet/Script Resolver and error handler" and the property is "Execution Paths"

6 replies

Feike_Visser1
Adobe Employee
Adobe Employee
August 28, 2017

To me the path is set to /schafbergbahn/ticker

kautuk_sahni
Community Manager
Community Manager
August 29, 2017

As mentioned by Feike, the path set is

     @SlingServlet( 

             paths={"/schafbergbahn/ticker"}, 

And you are trying to " http://localhost:4552/myPath/ticker/

If it is a typo in writing the question, then make sure user has read/write permission "/myPath/ticker/ " or "/schafbergbahn/ticker" which ever is correct in your case.

~kautuk

Kautuk Sahni
Level 2
August 30, 2017

The right url is schafbergbahn/ticker -> I would generalize it to myPath/ticker

August 30, 2017

I do have the same problem.

How can I set the rights for general access to the servlet?

Best Regards,

Hannes

Level 2
August 30, 2017

With "/bin/schafbergbahn/ticker" it works fine -> /bin is accessable!

I would be interested in where to configure other paths in order to make it accessable.

Thanks!

viveksachdeva
Community Advisor
viveksachdevaCommunity AdvisorAccepted solution
Community Advisor
August 30, 2017

Under Config manager, search for "Apache Sling Servlet/Script Resolver and error handler" and the property is "Execution Paths"