-
Bug
-
Resolution: Done
-
Critical
-
2.6.0.Beta1
-
None
-
Workaround Exists
-
Triing to execute this code:
QueryManager qManager = session.getWorkspace().getQueryManager(); Query q = qManager.createQuery("SELECT [sling:vanityPath], [sling:redirect] FROM [sling:VanityPath] WHERE [sling:vanityPath] IS NOT NULL ORDER BY [sling:vanityOrder] DESC", javax.jcr.query.Query.JCR_SQL2); return q.execute();
Here the cnd for the table:
[sling:VanityPath] mixin - sling:vanityPath (string) multiple - sling:redirect (boolean) - sling:vanityOrder (long)
I get this error:
java.util.NoSuchElementException: Property 'sling:vanityOrder' on selector 'sling:VanityPath' is not used in query at org.modeshape.graph.query.process.QueryResultColumns.getColumnIndexForProperty(QueryResultColumns.java:476) at org.modeshape.graph.query.process.ProcessingComponent.createDynamicOperation(ProcessingComponent.java:158) at org.modeshape.graph.query.process.SortValuesComponent.createSortComparator(SortValuesComponent.java:130) at org.modeshape.graph.query.process.SortValuesComponent.createSortComparator(SortValuesComponent.java:88) at org.modeshape.graph.query.process.SortValuesComponent.<init>(SortValuesComponent.java:53) at org.modeshape.graph.query.process.QueryProcessor.createComponent(QueryProcessor.java:355) at org.modeshape.graph.query.process.QueryProcessor.execute(QueryProcessor.java:90) at org.modeshape.graph.query.QueryEngine.execute(QueryEngine.java:111) at org.modeshape.jcr.RepositoryQueryManager$SelfContained.query(RepositoryQueryManager.java:384) at org.modeshape.jcr.JcrQueryManager$SessionQueryContext.execute(JcrQueryManager.java:1426) at org.modeshape.jcr.query.JcrQuery.execute(JcrQuery.java:103) at org.apache.sling.jcr.resource.JcrResourceUtil.query(JcrResourceUtil.java:52) at org.apache.sling.jcr.resource.internal.JcrResourceResolver.findResources(JcrResourceResolver.java:860) at org.apache.sling.jcr.resource.internal.helper.MapEntries.loadVanityPaths(MapEntries.java:303) at org.apache.sling.jcr.resource.internal.helper.MapEntries.init(MapEntries.java:130) at org.apache.sling.jcr.resource.internal.helper.MapEntries.<init>(MapEntries.java:98) at org.apache.sling.jcr.resource.internal.JcrResourceResolverFactoryImpl.activate(JcrResourceResolverFactoryImpl.java:478) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.felix.scr.impl.helper.BaseMethod.invokeMethod(BaseMethod.java:227) at org.apache.felix.scr.impl.helper.BaseMethod.access$500(BaseMethod.java:38) at org.apache.felix.scr.impl.helper.BaseMethod$Resolved.invoke(BaseMethod.java:591) at org.apache.felix.scr.impl.helper.BaseMethod.invoke(BaseMethod.java:472) at org.apache.felix.scr.impl.helper.ActivateMethod.invoke(ActivateMethod.java:146) at org.apache.felix.scr.impl.manager.ImmediateComponentManager.createImplementationObject(ImmediateComponentManager.java:226) at org.apache.felix.scr.impl.manager.ImmediateComponentManager.createComponent(ImmediateComponentManager.java:118) at org.apache.felix.scr.impl.manager.AbstractComponentManager$Unsatisfied.activate(AbstractComponentManager.java:997) at org.apache.felix.scr.impl.manager.AbstractComponentManager.activateInternal(AbstractComponentManager.java:333) at org.apache.felix.scr.impl.manager.DependencyManager.serviceAdded(DependencyManager.java:283) at org.apache.felix.scr.impl.manager.DependencyManager.serviceChanged(DependencyManager.java:170) at org.apache.felix.framework.util.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:871) at org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:733) at org.apache.felix.framework.util.EventDispatcher.fireServiceEvent(EventDispatcher.java:662) at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:3735) at org.apache.felix.framework.Felix.access$000(Felix.java:80) at org.apache.felix.framework.Felix$2.serviceChanged(Felix.java:722) at org.apache.felix.framework.ServiceRegistry.registerService(ServiceRegistry.java:107) at org.apache.felix.framework.Felix.registerService(Felix.java:2847) at org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:251) at org.apache.sling.jcr.base.AbstractSlingRepository.registerService(AbstractSlingRepository.java:465) at org.apache.sling.jcr.base.AbstractSlingRepository.startRepository(AbstractSlingRepository.java:811) at org.apache.sling.jcr.base.AbstractSlingRepository.activate(AbstractSlingRepository.java:606) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.felix.scr.impl.helper.BaseMethod.invokeMethod(BaseMethod.java:227) at org.apache.felix.scr.impl.helper.BaseMethod.access$500(BaseMethod.java:38) at org.apache.felix.scr.impl.helper.BaseMethod$Resolved.invoke(BaseMethod.java:591) at org.apache.felix.scr.impl.helper.BaseMethod.invoke(BaseMethod.java:472) at org.apache.felix.scr.impl.helper.ActivateMethod.invoke(ActivateMethod.java:146) at org.apache.felix.scr.impl.manager.ImmediateComponentManager.createImplementationObject(ImmediateComponentManager.java:226) at org.apache.felix.scr.impl.manager.ImmediateComponentManager.createComponent(ImmediateComponentManager.java:118) at org.apache.felix.scr.impl.manager.AbstractComponentManager$Unsatisfied.activate(AbstractComponentManager.java:997) at org.apache.felix.scr.impl.manager.AbstractComponentManager.activateInternal(AbstractComponentManager.java:333) at org.apache.felix.scr.impl.manager.AbstractComponentManager.enable(AbstractComponentManager.java:157) at org.apache.felix.scr.impl.config.ConfiguredComponentHolder.enableComponents(ConfiguredComponentHolder.java:262) at org.apache.felix.scr.impl.BundleComponentActivator.loadDescriptor(BundleComponentActivator.java:253) at org.apache.felix.scr.impl.BundleComponentActivator.initialize(BundleComponentActivator.java:147) at org.apache.felix.scr.impl.BundleComponentActivator.<init>(BundleComponentActivator.java:111) at org.apache.felix.scr.impl.Activator.loadComponents(Activator.java:285) at org.apache.felix.scr.impl.Activator.bundleChanged(Activator.java:203) at org.apache.felix.framework.util.EventDispatcher.invokeBundleListenerCallback(EventDispatcher.java:807) at org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:729) at org.apache.felix.framework.util.EventDispatcher.fireBundleEvent(EventDispatcher.java:610) at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:3724) at org.apache.felix.framework.Felix.startBundle(Felix.java:1772) at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1148) at org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264) at java.lang.Thread.run(Thread.java:680)
If I add the [sling:vanityOrder] in the column lists so:
QueryManager qManager = session.getWorkspace().getQueryManager(); Query q = qManager.createQuery("SELECT [sling:vanityPath], [sling:redirect], [sling:vanityOrder] FROM [sling:VanityPath] WHERE [sling:vanityPath] IS NOT NULL ORDER BY [sling:vanityOrder] DESC", javax.jcr.query.Query.JCR_SQL2); return q.execute();
It's ok. It could be a request to force the column in the column list by modeshape.
But if I try this query without the ordering column in the columns list:
SELECT bogus, laughable, [car:year] FROM [nt:base] ORDER BY argle
it is ok too!!
- blocks
-
MODE-1396 Pass all the TCK tests
- Closed