Hi Ian,
Found it finally :-).  You are quite right. I am missing the
resolutionPathInfo property to send back and hence going to a wrong
servlet. I set it to json and it gave me a json rendered page. Awesome !!.


On Thu, Aug 22, 2013 at 7:57 AM, Dishara Wijewardana <
[email protected]> wrote:

> Hi Ian,
> I found the place which redirects and causing the loop in debugging. This
> is  for a similar request on
> http://localhost:8080/content/cassandra/pnode1/cnode1.
>
> The class is StreamRendererServlet. My request always falls inside the
> else block that specified in BOLD and it redirects the response and hence
> this issue. So following is the status I noticed in the debug flow. Can you
> give me some clues, whether this flow correct ? Should the "stream" be not
> NULL ? Or included=true. What is the path the request should suppose to go
> ? Appreciate any input since I am kind of blocked here..
>
>         if (!included) {  *included=false*
>             ResourceMetadata meta = resource.getResourceMetadata();
>             long modifTime = meta.getModificationTime();
> *
> Inside unmodified request.getDateHeader(HEADER_IF_MODIFIED_SINCE) returns
> -1 and hence if block evaluates to false.*
>             if (unmodified(request, modifTime)) {
>                 response.setStatus(SC_NOT_MODIFIED);
>                 return;
>             }
>         }
>
>         // fall back to plain text rendering if the resource has no stream
>         InputStream stream = resource.adaptTo(InputStream.class);
>         if (stream != null) {     *stream=NULL*
>
>             streamResource(resource, stream, included, request, response);
>
>         } else {
>
>             // the resource is the root, do not redirect, immediately index
>             if (isRootResourceRequest(resource)) {
>
>                 renderDirectory(request, response, included);
>
>             } else if (included || response.isCommitted() ) 
> {*response.isCommitted()
> = false  and included=false*
>
>                 // request is included or committed, not redirecting
>                 request.getRequestProgressTracker().log(
>                     "StreamRendererServlet: Not redirecting with trailing
> slash, response is committed or request included");
>                 log.warn("StreamRendererServlet: Not redirecting with
> trailing slash, response is committed or request included");
>
>             } *else {*
> *
> *
> *                // redirect to this with trailing slash to render the
> index*
> *                String url = request.getResourceResolver().map(request,*
> *                    resource.getPath())*
> *                    + "/";*
> *                response.sendRedirect(url);*
> *
> *
> *            }*
>         }
>
>
>
>
>
>
> On Wed, Aug 21, 2013 at 4:16 PM, Ian Boston <[email protected]> wrote:
>
>> Hi,
>> IIRC the behaviour where the resource resolver iterates up the tree is
>> normal resource resolver behaviour but the recursion is not. Neither
>> is the integration test failure.
>>
>> The resource resolver may be looking for the sling:resourceSuperType,
>> but that is just a hunch.
>>
>> Either, the implementation of the ResourceProvider wiring inside the
>> ResourceResolver is buggy, or the Properties of the resource you are
>> sending back are incorrect, which is triggering the behaviour.
>>
>> I would suggest you look carefully at what a standard JcrResource
>> looks like when you make a simular request. Its listed at [1].
>>
>> Ian
>>
>> 1 http://localhost:8080/system/console/recentRequests
>>
>>
>> On 21 August 2013 08:59, Dishara Wijewardana <[email protected]>
>> wrote:
>> > Hi
>> > Since I am doing something similar to PlanetResource, I ran the
>> integration
>> > test of PlanetResource to verify it works in trunk. But that also got
>> > failed and started a thread on that also.
>> >
>> >
>> > On Wed, Aug 21, 2013 at 8:50 AM, Dishara Wijewardana <
>> > [email protected]> wrote:
>> >
>> >> Hi,
>> >> As per Ian's request I tried calling a resource URL ends with .json to
>> get
>> >> a json rendered page.
>> >> There I just noticed that, the response I am getting was which I
>> claimed
>> >> earlier a blank page, is not actually a blank page. Sorry for the
>> >> inconvenience.
>> >>
>> >> In the browser there is a message as follows. So then I debug it
>> again. I
>> >> put a debug pointer only inside CassandraProvider.getResource(), and
>> >> observed that it is getting hit continuously. I also noticed that if I
>> hit
>> >> for http://localhost:8080/content/cassandra/pnode1/cnode1 ,
>> >> it continuously calls CassandraProvider.getResource with following
>> paths
>> >> over and over again.   Appreciate any input on this ? Why the request
>> is
>> >> getting looped ? Because in the code I see no reason to call
>> getResource in
>> >> a loop.
>> >>
>> >> - /content/cassandra/pnode1/cnode1
>> >> - /content/cassandra/pnode1
>> >> - /content/cassandra
>> >>
>> >> This webpage has a redirect loop
>> >> The webpage at *http://localhost:8080/cassandra/pnode1/cnode1/* has
>> >> resulted in too many redirects. Clearing your cookies for this site or
>> >> allowing third-party cookies may fix the problem. If not, it is
>> possibly a
>> >> server configuration issue and not a problem with your computer.
>> >>
>> >> --
>> >> Thanks
>> >> /Dishara
>> >>
>> >
>> >
>> >
>> > --
>> > Thanks
>> > /Dishara
>>
>
>
>
> --
> Thanks
> /Dishara
>



-- 
Thanks
/Dishara

Reply via email to