jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ulrich <For...@gombers.de>
Subject JCR-SQL2: JOIN fails with javax.jcr.RepositoryException: Internal Server Error
Date Mon, 17 Jun 2013 09:20:42 GMT
>From another thread I've opened here I've derived another problem. I'm trying to
run a SQL2-query to find all nt:file-type nodes with a child-node of type
"nt:resource" (this is probably true for all nt:file-nodes but the query is just
a start to become familiar with JOIN).
In the other thread I had problems with the syntax ( the description in the
JCR-Specs chapter 6.7.22 is really misleading; there the selectorname is sort of
enclosed with square brackets, but it is the path which needs to this kind of
enclosement). In this thread I want to understand how to get this query to run:

queryString = "select * from [nt:file] as parent " +
              "inner join [nt:resource] as child on ISCHILDNODE(child,parent)" +
              "WHERE ISDESCENDANTNODE(descendant,[/content/testit])";

>From the query I get the Exception:
Exception in thread "main" javax.jcr.RepositoryException: Internal Server Error
        at
org.apache.jackrabbit.spi2dav.ExceptionConverter.generate(ExceptionConverter.java:120)
        at
org.apache.jackrabbit.spi2dav.ExceptionConverter.generate(ExceptionConverter.java:51)
        at
org.apache.jackrabbit.spi2dav.ExceptionConverter.generate(ExceptionConverter.java:45)
        at
org.apache.jackrabbit.spi2dav.RepositoryServiceImpl.executeQuery(RepositoryServiceImpl.java:2004)
        at
org.apache.jackrabbit.jcr2spi.WorkspaceManager.executeQuery(WorkspaceManager.java:349)
        at
org.apache.jackrabbit.jcr2spi.query.QueryImpl.execute(QueryImpl.java:149)
        at
com.lsy.samplejcr.query.JSQL2gettingStarted.runSQL2(JSQL2gettingStarted.java:94)
        at
com.lsy.samplejcr.query.JSQL2gettingStarted.<init>(JSQL2gettingStarted.java:62)
        at
com.lsy.samplejcr.query.JSQL2gettingStarted.main(JSQL2gettingStarted.java:144)
Caused by: org.apache.jackrabbit.webdav.DavException: Internal Server Error
        at
org.apache.jackrabbit.webdav.client.methods.DavMethodBase.getResponseException(DavMethodBase.java:162)
        at
org.apache.jackrabbit.webdav.client.methods.DavMethodBase.checkSuccess(DavMethodBase.java:174)
        at
org.apache.jackrabbit.spi2dav.RepositoryServiceImpl.executeQuery(RepositoryServiceImpl.java:1996)


and the servers error.log says:
17.06.2013 11:04:22.509+0200 *INFO* [127.0.0.1 [1371459862509] SEARCH
/crx/server/crx.default HTTP/1.1] servletengine Servlet threw exception:
 java.lang.StringIndexOutOfBoundsException: String index out of range: -1
        at java.lang.String.substring(Unknown Source)
        at
org.apache.jackrabbit.commons.query.sql2.Parser.getSyntaxError(Parser.java:974)
        at org.apache.jackrabbit.commons.query.sql2.Parser.read(Parser.java:652)
        at
org.apache.jackrabbit.commons.query.sql2.Parser.createQueryObjectModel(Parser.java:109)
        at
org.apache.jackrabbit.commons.query.sql2.SQL2QOMBuilder.createQueryObjectModel(SQL2QOMBuilder.java:55)
        at
org.apache.jackrabbit.core.query.QOMQueryFactory.createQuery(QOMQueryFactory.java:69)
        at
org.apache.jackrabbit.core.query.CompoundQueryFactory.createQuery(CompoundQueryFactory.java:67)
        at
org.apache.jackrabbit.core.query.QueryManagerImpl$2.perform(QueryManagerImpl.java:95)
        at
org.apache.jackrabbit.core.query.QueryManagerImpl$2.perform(QueryManagerImpl.java:91)
        at
org.apache.jackrabbit.core.session.SessionState.perform(SessionState.java:216)
        at
org.apache.jackrabbit.core.query.QueryManagerImpl.perform(QueryManagerImpl.java:197)
        at
org.apache.jackrabbit.core.query.QueryManagerImpl.createQuery(QueryManagerImpl.java:91)
        at
org.apache.jackrabbit.webdav.jcr.search.SearchResourceImpl.getQuery(SearchResourceImpl.java:168)
        at
org.apache.jackrabbit.webdav.jcr.search.SearchResourceImpl.search(SearchResourceImpl.java:98)
        at
org.apache.jackrabbit.webdav.jcr.AbstractResource.search(AbstractResource.java:560)
        at
org.apache.jackrabbit.webdav.jcr.WorkspaceResourceImpl.search(WorkspaceResourceImpl.java:84)
        at
org.apache.jackrabbit.webdav.server.AbstractWebdavServlet.doSearch(AbstractWebdavServlet.java:1308)
        at
org.apache.jackrabbit.webdav.server.AbstractWebdavServlet.execute(AbstractWebdavServlet.java:365)
        at
org.apache.jackrabbit.webdav.server.AbstractWebdavServlet.service(AbstractWebdavServlet.java:263)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
        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.i18n.impl.I18NFilter.doFilter(I18NFilter.java:117)
        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
com.adobe.granite.license.impl.LicenseCheckFilter.doFilter(LicenseCheckFilter.java:179)
        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.sling.security.impl.ReferrerFilter.doFilter(ReferrerFilter.java:238)
        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.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
com.day.j2ee.servletengine.ServletRuntimeEnvironment.service(ServletRuntimeEnvironment.java:250)
        at
com.day.j2ee.servletengine.RequestDispatcherImpl.doFilter(RequestDispatcherImpl.java:315)
        at
com.day.j2ee.servletengine.RequestDispatcherImpl.service(RequestDispatcherImpl.java:334)
        at
com.day.j2ee.servletengine.RequestDispatcherImpl.service(RequestDispatcherImpl.java:377)
        at
com.day.j2ee.servletengine.ServletHandlerImpl.process(ServletHandlerImpl.java:351)
        at
com.day.j2ee.servletengine.HttpListener$Worker.run(HttpListener.java:625)
        at java.lang.Thread.run(Unknown Source)

Has anyone got an idea what might be wrong here?

Ulrich

Mime
View raw message