Expand my Community achievements bar.

Sling Resolver to json.jsp Invalid recursion error

Avatar

Former Community Member

If I use this URL :-

http://localhost:4502/content/aviva/en_uk/general-insurance/travel/single-trip.telephone.html

I can see that my telephone.jsp rendering script is successfully found and outputs some html

However, if I only change the extension to json : http://localhost:4502/content/aviva/en_uk/general-insurance/travel/single-trip.telephone.json

I get a nasty surprise :-

Invalid recursion selector value 'telephone'

Cannot serve request to /content/aviva/en_uk/general-insurance/travel/single-trip.telephone.json in org.apache.sling.servlets.get.DefaultGetServlet

...

I do have a json.jsp in the same location as my telephone.jsp and assumed that it would be found. But clearly not ??

Can anyone explain why this is ??

If I look at the request log info for telephone.html, I can see that the request is handled by the primary foundation component Page.jsp :-

single-trip.telephone.html handled by Servlet=/libs/foundation/components/primary/cq/Page/Page.jsp

0 (2014-03-19 22:23:30) LOG Method=GET, PathInfo=/content/aviva/en_uk/general-insurance/travel/single-trip.telephone.html 0 (2014-03-19 22:23:30) TIMER_START{ResourceResolution} 0 (2014-03-19 22:23:30) TIMER_END{0,ResourceResolution} URI=/content/aviva/en_uk/general-insurance/travel/single-trip.telephone.html resolves to Resource=JcrNodeResource, type=cq:Page, superType=null, path=/content/aviva/en_uk/general-insurance/travel/single-trip 1 (2014-03-19 22:23:30) LOG Resource Path Info: SlingRequestPathInfo: path='/content/aviva/en_uk/general-insurance/travel/single-trip', selectorString='telephone', extension='html', suffix='null' 1 (2014-03-19 22:23:30) TIMER_START{ServletResolution} 1 (2014-03-19 22:23:30) TIMER_START{resolveServlet(JcrNodeResource, type=cq:Page, superType=null, path=/content/aviva/en_uk/general-insurance/travel/single-trip)} 1 (2014-03-19 22:23:30) TIMER_END{0,resolveServlet(JcrNodeResource, type=cq:Page, superType=null, path=/content/aviva/en_uk/general-insurance/travel/single-trip)} Using servlet /libs/foundation/components/primary/cq/Page/Page.jsp 1 (2014-03-19 22:23:30) TIMER_END{0,ServletResolution} URI=/content/aviva/en_uk/general-insurance/travel/single-trip.telephone.html handled by Servlet=/libs/foundation/components/primary/cq/Page/Page.jsp

and then eventually the telephone.jsp :-

36 (2014-03-19 22:23:30) LOG Including resource Paragraph, path=/content/aviva/en_uk/general-insurance/travel/single-trip/jcr:content/par/telephone, type=avivapocs/components/telephone, cssClass=default, column=0/0, diffInfo=[null], resource=[JcrNodeResource, type=avivapocs/components/telephone, superType=null, path=/content/aviva/en_uk/general-insurance/travel/single-trip/jcr:content/par/telephone] (SlingRequestPathInfo: path='/content/aviva/en_uk/general-insurance/travel/single-trip/jcr:content/par/telephone', selectorString='telephone', extension='html', suffix='null') 36 (2014-03-19 22:23:30) TIMER_START{resolveServlet(Paragraph, path=/content/aviva/en_uk/general-insurance/travel/single-trip/jcr:content/par/telephone, type=avivapocs/components/telephone, cssClass=default, column=0/0, diffInfo=[null], resource=[JcrNodeResource, type=avivapocs/components/telephone, superType=null, path=/content/aviva/en_uk/general-insurance/travel/single-trip/jcr:content/par/telephone])} 36 (2014-03-19 22:23:30) TIMER_END{0,resolveServlet(Paragraph, path=/content/aviva/en_uk/general-insurance/travel/single-trip/jcr:content/par/telephone, type=avivapocs/components/telephone, cssClass=default, column=0/0, diffInfo=[null], resource=[JcrNodeResource, type=avivapocs/components/telephone, superType=null, path=/content/aviva/en_uk/general-insurance/travel/single-trip/jcr:content/par/telephone])} Using servlet /apps/avivapocs/components/telephone/telephone.jsp

Looking at the same log for telephone.json, it appears that it uses an entirely different resolution process (Using servlet org.apache.sling.servlets.get.DefaultGetServlet) :-

0 (2014-03-19 22:25:04) LOG Method=GET, PathInfo=/content/aviva/en_uk/general-insurance/travel/single-trip.telephone.json 0 (2014-03-19 22:25:04) TIMER_START{ResourceResolution} 0 (2014-03-19 22:25:04) TIMER_END{0,ResourceResolution} URI=/content/aviva/en_uk/general-insurance/travel/single-trip.telephone.json resolves to Resource=JcrNodeResource, type=cq:Page, superType=null, path=/content/aviva/en_uk/general-insurance/travel/single-trip 0 (2014-03-19 22:25:04) LOG Resource Path Info: SlingRequestPathInfo: path='/content/aviva/en_uk/general-insurance/travel/single-trip', selectorString='telephone', extension='json', suffix='null' 0 (2014-03-19 22:25:04) TIMER_START{ServletResolution} 0 (2014-03-19 22:25:04) TIMER_START{resolveServlet(JcrNodeResource, type=cq:Page, superType=null, path=/content/aviva/en_uk/general-insurance/travel/single-trip)} 0 (2014-03-19 22:25:04) TIMER_END{0,resolveServlet(JcrNodeResource, type=cq:Page, superType=null, path=/content/aviva/en_uk/general-insurance/travel/single-trip)} Using servlet org.apache.sling.servlets.get.DefaultGetServlet 0 (2014-03-19 22:25:04) TIMER_END{0,ServletResolution} URI=/content/aviva/en_uk/general-insurance/travel/single-trip.telephone.json handled by Servlet=org.apache.sling.servlets.get.DefaultGetServlet

and eventually to : /libs/sling/servlet/errorhandler/default.jsp !!

0 (2014-03-19 22:25:04) LOG Applying Requestfilters 0 (2014-03-19 22:25:04) LOG Calling filter: org.apache.sling.bgservlets.impl.BackgroundServletStarterFilter 0 (2014-03-19 22:25:04) LOG Calling filter: org.apache.sling.i18n.impl.I18NFilter 0 (2014-03-19 22:25:04) LOG Calling filter: org.apache.sling.rewriter.impl.RewriterFilter 0 (2014-03-19 22:25:04) LOG Calling filter: com.day.cq.wcm.designimporter.CanvasPageDeleteRequestFilter 0 (2014-03-19 22:25:04) LOG Calling filter: com.adobe.cq.history.impl.HistoryRequestFilter 0 (2014-03-19 22:25:04) LOG Calling filter: com.day.cq.wcm.core.impl.WCMRequestFilter 0 (2014-03-19 22:25:04) LOG Calling filter: com.adobe.granite.optout.impl.OptOutFilter 0 (2014-03-19 22:25:04) LOG Calling filter: com.day.cq.theme.impl.ThemeResolverFilter 0 (2014-03-19 22:25:04) LOG Calling filter: com.day.cq.wcm.foundation.forms.impl.FormsHandlingServlet 0 (2014-03-19 22:25:04) LOG Calling filter: org.apache.sling.engine.impl.debug.RequestProgressTrackerLogFilter 0 (2014-03-19 22:25:04) LOG Calling filter: com.day.cq.wcm.mobile.core.impl.redirect.RedirectFilter 0 (2014-03-19 22:25:04) LOG RedirectFilter did not redirect (request extension does not match) 0 (2014-03-19 22:25:04) LOG Calling filter: com.day.cq.wcm.core.impl.warp.TimeWarpFilter 0 (2014-03-19 22:25:04) LOG Calling filter: com.day.cq.wcm.core.impl.AuthoringUIModeServiceImpl 0 (2014-03-19 22:25:04) LOG Applying Componentfilters 0 (2014-03-19 22:25:04) LOG Calling filter: com.day.cq.personalization.impl.TargetComponentFilter 0 (2014-03-19 22:25:04) LOG Calling filter: com.day.cq.wcm.core.impl.WCMComponentFilter 0 (2014-03-19 22:25:04) LOG Calling filter: com.day.cq.wcm.core.impl.WCMDebugFilter 0 (2014-03-19 22:25:04) TIMER_START{org.apache.sling.servlets.get.DefaultGetServlet#0} 0 (2014-03-19 22:25:04) LOG Using org.apache.sling.servlets.get.impl.helpers.JsonRendererServlet to render for extension=json 0 (2014-03-19 22:25:04) LOG Applying Error filters 0 (2014-03-19 22:25:04) LOG Calling filter: org.apache.sling.rewriter.impl.RewriterFilter 0 (2014-03-19 22:25:04) TIMER_START{handleError:status=400} 15 (2014-03-19 22:25:04) TIMER_END{15,handleError:status=400} Using handler /libs/sling/servlet/errorhandler/default.jsp 15 (2014-03-19 22:25:04) LOG Found processor for post processing ProcessorConfiguration: {contentTypes=[text/html],order=-1, active=true, valid=true, processErrorResponse=true, pipeline=(generator=Config(type=htmlparser, config={}), transformers=(Config(type=linkchecker, config={}), Config(type=mobile, config=JcrPropertyMap [node=node /libs/cq/config/rewriter/default/transformer-mobile, values={component-optional=true, jcr:primaryType=nt:unstructured}]), Config(type=mobiledebug, config=JcrPropertyMap [node=node /libs/cq/config/rewriter/default/transformer-mobiledebug, values={component-optional=true, jcr:primaryType=nt:unstructured}]), Config(type=contentsync, config=JcrPropertyMap [node=node /libs/cq/config/rewriter/default/transformer-contentsync, values={component-optional=true, jcr:primaryType=nt:unstructured}]), serializer=Config(type=htmlwriter, config={}))} 15 (2014-03-19 22:25:04) TIMER_END{15,Request Processing} Dumping SlingRequestProgressTracker Entries 15 (2014-03-19 22:25:04) TIMER_END{15,handleError:status=400} Error handler finished 15 (2014-03-19 22:25:04) TIMER_END{15,org.apache.sling.servlets.get.DefaultGetServlet#0} 15 (2014-03-19 22:25:04) TIMER_END{15,Request Processing} Request Processing

If I add apps/foundation/primary/cq/Page/Page.jsp and proxy.jsp then everything works, but I just can't figure out why Sling resolution doesn't find my custom json.jsp without needing to do this ??

Help appreciated

Regards

Fraser.

0 Replies