Hi,
The CassandraResource doesnt have the correct properties based on the
path. Have a look at the properties for a non CassandraResource that
does exist.

In particular your value for suffix should be null, but its the full
path. It looks like your processing of path is wrong.

Perhaps the best way of debugging this is to implement the
CassandraResource.toString method to print out all the properties in
the same way the JcrResource.toString does.



Here is a standard JcrResource for reference.

curl http://localhost:8080/content/test/subnode.tidy.json

      0 (2013-08-16 06:37:25) TIMER_START{ResourceResolution}
     78 (2013-08-16 06:37:25) TIMER_END{78,ResourceResolution}
URI=/content/test/subnode.tidy.json resolves to
Resource=JcrNodeResource, type=nt:unstructured, superType=null,
path=/content/test/subnode
     78 (2013-08-16 06:37:25) LOG Resource Path Info:
SlingRequestPathInfo: path='/content/test/subnode',
selectorString='tidy', extension='json', suffix='null'
     78 (2013-08-16 06:37:25) TIMER_START{ServletResolution}
     78 (2013-08-16 06:37:25)
TIMER_START{resolveServlet(JcrNodeResource, type=nt:unstructured,
superType=null, path=/content/test/subnode)}
    266 (2013-08-16 06:37:25)
TIMER_END{188,resolveServlet(JcrNodeResource, type=nt:unstructured,
superType=null, path=/content/test/subnode)} Using servlet
org.apache.sling.servlets.get.DefaultGetServlet
    266 (2013-08-16 06:37:25) TIMER_END{188,ServletResolution}
URI=/content/test/subnode.tidy.json handled by
Servlet=org.apache.sling.servlets.get.DefaultGetServlet
    266 (2013-08-16 06:37:25) LOG Applying Requestfilters

Ian

On 16 August 2013 03:12, Dishara Wijewardana <ddwijeward...@gmail.com> wrote:
> Hi,
> Is there a reason why I can resolve my cassandra paths at
> http://localhost:8080/system/console/jcrresolver<http://localhost:8080/system/console/jcrresolver?>
> with the path "/content/cassandra/movies/foo/bar1/test/bbb.json"  but fails
> on http://localhost:8080/content/cassandra/movies/foo/bar1/test/bbb.json with
> following.
>
> Internal Server Error (500)
>
> The requested URL /content/cassandra/movies/foo/bar1/test/bbb.json resulted
> in an error in Sling (Ad Hoc) Default Error Handler Servlet.
> Exception:
>
> java.lang.NullPointerException
>         at 
> org.apache.sling.servlets.resolver.internal.SlingServletResolver.resolveServlet(SlingServletResolver.java:581)
>         at 
> org.apache.sling.servlets.resolver.internal.SlingServletResolver.resolveServlet(SlingServletResolver.java:273)
>         at 
> org.apache.sling.engine.impl.request.RequestData.initServlet(RequestData.java:228)
>         at 
> org.apache.sling.engine.impl.SlingRequestProcessorImpl.processRequest(SlingRequestProcessorImpl.java:141)
>         at 
> org.apache.sling.engine.impl.SlingMainServlet.service(SlingMainServlet.java:207)
>         at 
> org.apache.felix.http.base.internal.handler.ServletHandler.doHandle(ServletHandler.java:96)
>         at 
> org.apache.felix.http.base.internal.handler.ServletHandler.handle(ServletHandler.java:79)
>         at 
> org.apache.felix.http.base.internal.dispatch.ServletPipeline.handle(ServletPipeline.java:42)
>         at 
> org.apache.felix.http.base.internal.dispatch.InvocationFilterChain.doFilter(InvocationFilterChain.java:49)
>         at 
> org.apache.felix.http.base.internal.dispatch.HttpFilterChain.doFilter(HttpFilterChain.java:33)
>         at 
> org.apache.sling.engine.impl.log.RequestLoggerFilter.doFilter(RequestLoggerFilter.java:75)
>         at 
> org.apache.felix.http.base.internal.handler.FilterHandler.doHandle(FilterHandler.java:88)
>         at 
> org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:76)
>         at 
> org.apache.felix.http.base.internal.dispatch.InvocationFilterChain.doFilter(InvocationFilterChain.java:47)
>         at 
> org.apache.felix.http.base.internal.dispatch.HttpFilterChain.doFilter(HttpFilterChain.java:33)
>         at 
> org.apache.felix.http.base.internal.dispatch.FilterPipeline.dispatch(FilterPipeline.java:48)
>         at 
> org.apache.felix.http.base.internal.dispatch.Dispatcher.dispatch(Dispatcher.java:39)
>         at 
> org.apache.felix.http.base.internal.DispatcherServlet.service(DispatcherServlet.java:67)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
>         at 
> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
>         at 
> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390)
>         at 
> org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
>         at 
> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
>         at 
> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
>         at org.mortbay.jetty.Server.handle(Server.java:326)
>         at 
> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
>         at 
> org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:926)
>         at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:549)
>         at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
>         at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
>         at 
> org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410)
>         at 
> org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
>
> Request Progress:
>
>       0 (2013-08-16 07:38:16) TIMER_START{Request Processing}
>       0 (2013-08-16 07:38:16) COMMENT timer_end format is {<elapsed
> msec>,<timer name>} <optional message>
>       0 (2013-08-16 07:38:16) LOG Method=GET,
> PathInfo=/content/cassandra/movies/foo/bar1/test/bbb.json
>       0 (2013-08-16 07:38:16) TIMER_START{ResourceResolution}
>       4 (2013-08-16 07:38:16) TIMER_END{4,ResourceResolution}
> URI=/content/cassandra/movies/foo/bar1/test/bbb.json resolves to
> Resource=org.apache.sling.cassandra.resource.provider.CassandraResource@53436f66
>       4 (2013-08-16 07:38:16) LOG Resource Path Info:
> SlingRequestPathInfo:
> path='/content/cassandra/movies/foo/bar1/test/bbb.json',
> selectorString='null', extension='null',
> suffix='/content/cassandra/movies/foo/bar1/test/bbb.json'
>       4 (2013-08-16 07:38:16) TIMER_START{ServletResolution}
>       4 (2013-08-16 07:38:16)
> TIMER_START{resolveServlet(org.apache.sling.cassandra.resource.provider.CassandraResource@53436f66)}
>       4 (2013-08-16 07:38:16)
> TIMER_START{handleError:throwable=java.lang.NullPointerException}
>       5 (2013-08-16 07:38:16)
> TIMER_END{1,handleError:throwable=java.lang.NullPointerException}
> Using handler Sling (Ad Hoc) Default Error Handler Servlet
>       6 (2013-08-16 07:38:16) TIMER_END{6,Request Processing} Dumping
> SlingRequestProgressTracker Entries
>
>
>
> --
> Thanks
> /Dishara

Reply via email to