org.apache.sling.adapter.Adaption with adaptables : [org.apache.sling.api.SlingHttpServletRequest] andorg.apache.sling.testing.mock.sling.MockAdapterManagerImpl - Registered service org.apache.sling.adapter.Adaptionwith
ResourceResolverFactory rrf = slingContext.getService(ResourceResolverFactory.class);}org.apache.sling.resourceresolver.impl.ResourceResolverFactoryActivator$1 cannot be cast to org.apache.sling.api.resource.ResourceResolverFactory
java.lang.ClassCastEx
: at org.apache.sling.scripting.core.impl.DefaultSlingScript.evalorg.apache.sling.scripting.core.impl.DefaultSlingScript.eval(DefaultSlingScript.java:17
: org.apache.sling.scripting.jsp.jasper.JasperException: Unable to compile class for JSP:
at org.apache.sling.scripting.core.impl.DefaultSlingScript.service(DefaultSlingScript.java:463):265)
at org.apache.sling.scripting.jsp.JspSc
我有一个非常基本的代码片段,它获取对象的currentNode并查看它的子节点。但出于某种原因,这不管用,我也搞不懂原因。getChildNodes()应该返回一个可迭代的子列表,但我得到的只有一个:“不能用节点类型的元素循环,它的集合是 iterable for (Node n : JcrUtils.getChildNodes(currentNode)){}