You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@sling.apache.org by Phil Rice <ph...@googlemail.com> on 2011/07/29 18:18:06 UTC
Strategies for debugging
I would appreciate help with advice on how to chase down a bug in the
DefaultGetServlet.
I make a GET to a page:
html:localhost:8888//jars/a23/a23734d6e9cdb1eef1aef5d242a0522dc300f0019.json
and get the following response
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<h1>Forbidden (403)</h1>
<p>The requested URL
/jars/a23/a23734d6e9cdb1eef1aef5d242a0522dc300f0019.json/ resulted in
an error in org.apache.sling.servlets.get.DefaultGetServlet.</p>
<h3>Request Progress:</h3>
<pre>
0 (2011-07-29 17:01:12) TIMER_START{Request Processing}
0 (2011-07-29 17:01:12) COMMENT timer_end format is {<elapsed
msec>,<timer name>} <optional message>
0 (2011-07-29 17:01:12) LOG Method=GET,
PathInfo=/jars/a23/a23734d6e9cdb1eef1aef5d242a0522dc300f0019.json/
0 (2011-07-29 17:01:12) TIMER_START{ResourceResolution}
0 (2011-07-29 17:01:12) TIMER_END{0,ResourceResolution}
URI=/jars/a23/a23734d6e9cdb1eef1aef5d242a0522dc300f0019.json/ resolves
to Resource=JcrNodeResource, type=nt:unstructured, superType=null,
path=/jars/a23/a23734d6e9cdb1eef1aef5d242a0522dc300f0019.json
0 (2011-07-29 17:01:12) LOG Resource Path Info:
SlingRequestPathInfo:
path='/jars/a23/a23734d6e9cdb1eef1aef5d242a0522dc300f0019.json',
selectorString='null', extension='null', suffix='/'
0 (2011-07-29 17:01:12) TIMER_START{ServletResolution}
0 (2011-07-29 17:01:12)
TIMER_START{resolveServlet(JcrNodeResource, type=nt:unstructured,
superType=null,
path=/jars/a23/a23734d6e9cdb1eef1aef5d242a0522dc300f0019.json)}
0 (2011-07-29 17:01:12)
TIMER_END{0,resolveServlet(JcrNodeResource, type=nt:unstructured,
superType=null,
path=/jars/a23/a23734d6e9cdb1eef1aef5d242a0522dc300f0019.json)} Using
servlet org.apache.sling.servlets.get.DefaultGetServlet
0 (2011-07-29 17:01:12) TIMER_END{0,ServletResolution}
URI=/jars/a23/a23734d6e9cdb1eef1aef5d242a0522dc300f0019.json/ handled
by Servlet=org.apache.sling.servlets.get.DefaultGetServlet
0 (2011-07-29 17:01:12) LOG Applying Requestfilters
0 (2011-07-29 17:01:12) LOG Calling filter:
org.apache.sling.engine.impl.debug.RequestProgressTrackerLogFilter
1 (2011-07-29 17:01:12)
TIMER_START{org.apache.sling.servlets.get.DefaultGetServlet#0}
1 (2011-07-29 17:01:12) LOG Using
org.apache.sling.servlets.get.impl.helpers.StreamRendererServlet to
render for extension=null
1 (2011-07-29 17:01:12) TIMER_START{handleError:status=403}
1 (2011-07-29 17:01:12) TIMER_END{0,handleError:status=403}
Using handler org.apache.sling.servlets.resolver.internal.defaults.DefaultErrorHandlerServlet
2 (2011-07-29 17:01:12) TIMER_END{2,Request Processing} Dumping
SlingRequestProgressTracker Entries
</pre>
<hr>
<address>ApacheSling/2.2 (Java HotSpot(TM) 64-Bit Server VM 1.6.0_24;
Windows 7 6.1 amd64)</address>
</body>
</html>
When I investigate in the logs I find the following line:
29.07.2011 17:14:58.805 *INFO* [127.0.0.1 [1311956098799] GET
/jars/a23/a23734d6e9cdb1eef1aef5d242a0522dc300f0019.json/ HTTP/1.1]
logs/request.log 29/Jul/2011:17:14:58 +0100 [212] <- 403 text/html;
charset=UTF-8 6ms
So this tells me that there was an error but not what...
I have had a number of errors like this, and fixed them, but it takes
me a while. Are there are tips that you could advise on how to chase
these errors down quicker?
Thanks
RE: Strategies for debugging
Posted by Mike Müller <mi...@mysign.ch>.
Hi Phil
Under [1] you will find how to set up remote debugging in Eclipse.
best regards
mike
[1] http://sling.apache.org/site/getting-and-building-sling.html#GettingandBuildingSling-FurtherTipsandTricks
> -----Original Message-----
> From: Phil Rice [mailto:phil.rice.erudine@googlemail.com]
> Sent: Friday, July 29, 2011 6:18 PM
> To: users@sling.apache.org
> Subject: Strategies for debugging
>
> I would appreciate help with advice on how to chase down a bug in the
> DefaultGetServlet.
>
> I make a GET to a page:
> html:localhost:8888//jars/a23/a23734d6e9cdb1eef1aef5d242a0522dc300f0019.json
> and get the following response
>
> <html>
> <head>
> <title>403 Forbidden</title>
> </head>
> <body>
> <h1>Forbidden (403)</h1>
> <p>The requested URL
> /jars/a23/a23734d6e9cdb1eef1aef5d242a0522dc300f0019.json/ resulted in
> an error in org.apache.sling.servlets.get.DefaultGetServlet.</p>
> <h3>Request Progress:</h3>
> <pre>
> 0 (2011-07-29 17:01:12) TIMER_START{Request Processing}
> 0 (2011-07-29 17:01:12) COMMENT timer_end format is {<elapsed
> msec>,<timer name>} <optional message>
> 0 (2011-07-29 17:01:12) LOG Method=GET,
> PathInfo=/jars/a23/a23734d6e9cdb1eef1aef5d242a0522dc300f0019.json/
> 0 (2011-07-29 17:01:12) TIMER_START{ResourceResolution}
> 0 (2011-07-29 17:01:12) TIMER_END{0,ResourceResolution}
> URI=/jars/a23/a23734d6e9cdb1eef1aef5d242a0522dc300f0019.json/ resolves
> to Resource=JcrNodeResource, type=nt:unstructured, superType=null,
> path=/jars/a23/a23734d6e9cdb1eef1aef5d242a0522dc300f0019.json
> 0 (2011-07-29 17:01:12) LOG Resource Path Info:
> SlingRequestPathInfo:
> path='/jars/a23/a23734d6e9cdb1eef1aef5d242a0522dc300f0019.json',
> selectorString='null', extension='null', suffix='/'
> 0 (2011-07-29 17:01:12) TIMER_START{ServletResolution}
> 0 (2011-07-29 17:01:12)
> TIMER_START{resolveServlet(JcrNodeResource, type=nt:unstructured,
> superType=null,
> path=/jars/a23/a23734d6e9cdb1eef1aef5d242a0522dc300f0019.json)}
> 0 (2011-07-29 17:01:12)
> TIMER_END{0,resolveServlet(JcrNodeResource, type=nt:unstructured,
> superType=null,
> path=/jars/a23/a23734d6e9cdb1eef1aef5d242a0522dc300f0019.json)} Using
> servlet org.apache.sling.servlets.get.DefaultGetServlet
> 0 (2011-07-29 17:01:12) TIMER_END{0,ServletResolution}
> URI=/jars/a23/a23734d6e9cdb1eef1aef5d242a0522dc300f0019.json/ handled
> by Servlet=org.apache.sling.servlets.get.DefaultGetServlet
> 0 (2011-07-29 17:01:12) LOG Applying Requestfilters
> 0 (2011-07-29 17:01:12) LOG Calling filter:
> org.apache.sling.engine.impl.debug.RequestProgressTrackerLogFilter
> 1 (2011-07-29 17:01:12)
> TIMER_START{org.apache.sling.servlets.get.DefaultGetServlet#0}
> 1 (2011-07-29 17:01:12) LOG Using
> org.apache.sling.servlets.get.impl.helpers.StreamRendererServlet to
> render for extension=null
> 1 (2011-07-29 17:01:12) TIMER_START{handleError:status=403}
> 1 (2011-07-29 17:01:12) TIMER_END{0,handleError:status=403}
> Using handler
> org.apache.sling.servlets.resolver.internal.defaults.DefaultErrorHandlerServlet
> 2 (2011-07-29 17:01:12) TIMER_END{2,Request Processing} Dumping
> SlingRequestProgressTracker Entries
> </pre>
> <hr>
> <address>ApacheSling/2.2 (Java HotSpot(TM) 64-Bit Server VM 1.6.0_24;
> Windows 7 6.1 amd64)</address>
> </body>
> </html>
>
> When I investigate in the logs I find the following line:
> 29.07.2011 17:14:58.805 *INFO* [127.0.0.1 [1311956098799] GET
> /jars/a23/a23734d6e9cdb1eef1aef5d242a0522dc300f0019.json/ HTTP/1.1]
> logs/request.log 29/Jul/2011:17:14:58 +0100 [212] <- 403 text/html;
> charset=UTF-8 6ms
>
> So this tells me that there was an error but not what...
>
> I have had a number of errors like this, and fixed them, but it takes
> me a while. Are there are tips that you could advise on how to chase
> these errors down quicker?
>
> Thanks
Re: Query Servlet and SQL2
Posted by Mark Adamcin <ad...@gmail.com>.
I believe the queryType parameter should map to the query language constant
values defined by javax.jcr.query.Query. The value for JCR_SQL2 is
"JCR-SQL2".
Mark Adamcin
Acquity Group
On Thu, Aug 4, 2011 at 10:09 AM, Mark Herman <MH...@nbme.org> wrote:
> I'm trying to use the .query.json request with a JCR_SQL2 query but I can't
> find what queryType I should pass on or even if it's supported. Of course I
> could use the old sql syntax but I was trying to stick to SQL2 considering
> that JCR2.0 depreciates the old one. Thanks.
>
RE: Query Servlet and SQL2
Posted by Mark Herman <MH...@NBME.org>.
Thanks to both for quick responses. Unfortunately I'm tied to a earlier
release for now but my question is answered. Thanks.
-----Original Message-----
From: Eric Norman [mailto:eric.d.norman@gmail.com]
Sent: Thursday, August 04, 2011 1:22 PM
To: users@sling.apache.org
Subject: Re: Query Servlet and SQL2
See https://issues.apache.org/jira/browse/SLING-1533
On Thu, Aug 4, 2011 at 10:09 AM, Mark Herman <MH...@nbme.org> wrote:
> I'm trying to use the .query.json request with a JCR_SQL2 query but I can't
> find what queryType I should pass on or even if it's supported. Of course I
> could use the old sql syntax but I was trying to stick to SQL2 considering
> that JCR2.0 depreciates the old one. Thanks.
>
Re: Query Servlet and SQL2
Posted by Eric Norman <er...@gmail.com>.
See https://issues.apache.org/jira/browse/SLING-1533
On Thu, Aug 4, 2011 at 10:09 AM, Mark Herman <MH...@nbme.org> wrote:
> I'm trying to use the .query.json request with a JCR_SQL2 query but I can't
> find what queryType I should pass on or even if it's supported. Of course I
> could use the old sql syntax but I was trying to stick to SQL2 considering
> that JCR2.0 depreciates the old one. Thanks.
>
Query Servlet and SQL2
Posted by Mark Herman <MH...@NBME.org>.
I'm trying to use the .query.json request with a JCR_SQL2 query but I can't
find what queryType I should pass on or even if it's supported. Of course I
could use the old sql syntax but I was trying to stick to SQL2 considering
that JCR2.0 depreciates the old one. Thanks.
Re: Strategies for debugging
Posted by Justin Edelson <ju...@justinedelson.com>.
Use remote debugging and walk through the code ?
In this particular case, you have a node called
/jars/a23/a23734d6e9cdb1eef1aef5d242a0522dc300f0019.json of type
nt:unstructured. You are requesting
/jars/a23/a23734d6e9cdb1eef1aef5d242a0522dc300f0019.json/ and have
directory indexes turned off. This causes the StreamRenderServlet to
return a FORBIDDEN error.
Setting a breakpoint at the top of DefaultGetServlet.doGet() should
illustrate this for you.
Justin
On Fri, Jul 29, 2011 at 12:18 PM, Phil Rice
<ph...@googlemail.com> wrote:
> I would appreciate help with advice on how to chase down a bug in the
> DefaultGetServlet.
>
> I make a GET to a page:
> html:localhost:8888//jars/a23/a23734d6e9cdb1eef1aef5d242a0522dc300f0019.json
> and get the following response
>
> <html>
> <head>
> <title>403 Forbidden</title>
> </head>
> <body>
> <h1>Forbidden (403)</h1>
> <p>The requested URL
> /jars/a23/a23734d6e9cdb1eef1aef5d242a0522dc300f0019.json/ resulted in
> an error in org.apache.sling.servlets.get.DefaultGetServlet.</p>
> <h3>Request Progress:</h3>
> <pre>
> 0 (2011-07-29 17:01:12) TIMER_START{Request Processing}
> 0 (2011-07-29 17:01:12) COMMENT timer_end format is {<elapsed
> msec>,<timer name>} <optional message>
> 0 (2011-07-29 17:01:12) LOG Method=GET,
> PathInfo=/jars/a23/a23734d6e9cdb1eef1aef5d242a0522dc300f0019.json/
> 0 (2011-07-29 17:01:12) TIMER_START{ResourceResolution}
> 0 (2011-07-29 17:01:12) TIMER_END{0,ResourceResolution}
> URI=/jars/a23/a23734d6e9cdb1eef1aef5d242a0522dc300f0019.json/ resolves
> to Resource=JcrNodeResource, type=nt:unstructured, superType=null,
> path=/jars/a23/a23734d6e9cdb1eef1aef5d242a0522dc300f0019.json
> 0 (2011-07-29 17:01:12) LOG Resource Path Info:
> SlingRequestPathInfo:
> path='/jars/a23/a23734d6e9cdb1eef1aef5d242a0522dc300f0019.json',
> selectorString='null', extension='null', suffix='/'
> 0 (2011-07-29 17:01:12) TIMER_START{ServletResolution}
> 0 (2011-07-29 17:01:12)
> TIMER_START{resolveServlet(JcrNodeResource, type=nt:unstructured,
> superType=null,
> path=/jars/a23/a23734d6e9cdb1eef1aef5d242a0522dc300f0019.json)}
> 0 (2011-07-29 17:01:12)
> TIMER_END{0,resolveServlet(JcrNodeResource, type=nt:unstructured,
> superType=null,
> path=/jars/a23/a23734d6e9cdb1eef1aef5d242a0522dc300f0019.json)} Using
> servlet org.apache.sling.servlets.get.DefaultGetServlet
> 0 (2011-07-29 17:01:12) TIMER_END{0,ServletResolution}
> URI=/jars/a23/a23734d6e9cdb1eef1aef5d242a0522dc300f0019.json/ handled
> by Servlet=org.apache.sling.servlets.get.DefaultGetServlet
> 0 (2011-07-29 17:01:12) LOG Applying Requestfilters
> 0 (2011-07-29 17:01:12) LOG Calling filter:
> org.apache.sling.engine.impl.debug.RequestProgressTrackerLogFilter
> 1 (2011-07-29 17:01:12)
> TIMER_START{org.apache.sling.servlets.get.DefaultGetServlet#0}
> 1 (2011-07-29 17:01:12) LOG Using
> org.apache.sling.servlets.get.impl.helpers.StreamRendererServlet to
> render for extension=null
> 1 (2011-07-29 17:01:12) TIMER_START{handleError:status=403}
> 1 (2011-07-29 17:01:12) TIMER_END{0,handleError:status=403}
> Using handler org.apache.sling.servlets.resolver.internal.defaults.DefaultErrorHandlerServlet
> 2 (2011-07-29 17:01:12) TIMER_END{2,Request Processing} Dumping
> SlingRequestProgressTracker Entries
> </pre>
> <hr>
> <address>ApacheSling/2.2 (Java HotSpot(TM) 64-Bit Server VM 1.6.0_24;
> Windows 7 6.1 amd64)</address>
> </body>
> </html>
>
> When I investigate in the logs I find the following line:
> 29.07.2011 17:14:58.805 *INFO* [127.0.0.1 [1311956098799] GET
> /jars/a23/a23734d6e9cdb1eef1aef5d242a0522dc300f0019.json/ HTTP/1.1]
> logs/request.log 29/Jul/2011:17:14:58 +0100 [212] <- 403 text/html;
> charset=UTF-8 6ms
>
> So this tells me that there was an error but not what...
>
> I have had a number of errors like this, and fixed them, but it takes
> me a while. Are there are tips that you could advise on how to chase
> these errors down quicker?
>
> Thanks
>