CQ 5.6.1 getWorkflowSession导致未捕获的Throwable java.lang.NullPointerException [英] CQ 5.6.1 getWorkflowSession cause Uncaught Throwable java.lang.NullPointerException

查看:122
本文介绍了CQ 5.6.1 getWorkflowSession导致未捕获的Throwable java.lang.NullPointerException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在org.apache.sling.api.servlets.SlingSafeMethodsServlet.mayService(SlingSafeMethodsServlet.java:268)
在org.ap. apache.sling.api.servlets.SlingSafeMethodsServlet.service(SlingSafeMethodsServlet.java:344)在org.apache.sling.api.servlets.SlingSafeMethodsServlet.service(SlingSafeMethodsServlet.java:375)
在org。 apache.sling.engine.impl.request.RequestData.service(RequestData.java:508)
在org.apache.sling.engine.impl.filter.SlingComponentFilterChain.render(SlingComponentFilterChain.java:45)
在org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:64)处
在com.day.cq.wcm.core.impl.WCMDebugFilter.doFilter(WCMDebugFilter.java:146 )
(位于org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:60)
位于com.day.cq.wcm.core.impl.WCMComponentFilter.filterRootInclude(WCMComponentFilter .java:356)
在com.day.cq.wcm.core.impl.WCMComponentFilter.doFilter(WCMComponentFilter.java:168)处
在org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:60) com.day.cq.personalization.impl.TargetComponentFilter.doFilter(TargetComponentFilter.java:96)的
org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java: 60)org.apache.sling.engine.impl.SlingRequestProcessorImpl.processComponent(SlingRequestProcessorImpl.java:254)中的

at com.cuso.Mao.doGet(Mao.java:97) at org.apache.sling.api.servlets.SlingSafeMethodsServlet.mayService(SlingSafeMethodsServlet.java:268) at org.apache.sling.api.servlets.SlingSafeMethodsServlet.service(SlingSafeMethodsServlet.java:344) at org.apache.sling.api.servlets.SlingSafeMethodsServlet.service(SlingSafeMethodsServlet.java:375) at org.apache.sling.engine.impl.request.RequestData.service(RequestData.java:508) at org.apache.sling.engine.impl.filter.SlingComponentFilterChain.render(SlingComponentFilterChain.java:45) at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:64) at com.day.cq.wcm.core.impl.WCMDebugFilter.doFilter(WCMDebugFilter.java:146) at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:60) at com.day.cq.wcm.core.impl.WCMComponentFilter.filterRootInclude(WCMComponentFilter.java:356) at com.day.cq.wcm.core.impl.WCMComponentFilter.doFilter(WCMComponentFilter.java:168) at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:60) at com.day.cq.personalization.impl.TargetComponentFilter.doFilter(TargetComponentFilter.java:96) at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:60) at org.apache.sling.engine.impl.SlingRequestProcessorImpl.processComponent(SlingRequestProcessorImpl.java:254)

第97行只是调用WorkflowSession wf = workflowServiceObject.getWorkflowSession(jcrsessionObject);
我应该使用JACKRABBIT SESSION而不是jcrSession吗?哪一个是对的?

line 97 is just calling the WorkflowSession wf = workflowServiceObject.getWorkflowSession(jcrsessionObject); Should I use JACKRABBIT SESSION instead of jcrSession? Which one is right?

推荐答案

我遇到了类似的情况。您传递的模型节点没有问题。

I was facing a similar situation.There is nothing wrong with the model node that you are passing.

从工作流程服务获取新的工作流程会话提供了空指针,因此我必须使用 getServiceReference 方法将工作流程服务获取到激活器中,并将其分配给实用程序类中的静态变量。仍然得到:
并记录以下内容:-

Getting new workflowSession from workflowService was giving nullpointer so I had to get the workflowService inside my Activator using the getServiceReference way and have it assigned to a static variable in a utility class.Still I got: and following was getting logged:-

无法从节点:/ etc /中读取工作流模型工作流程/模型/删除内容/ jcr:内容/模型

还有一个会话已关闭问题。为此,我再次使resolverFactory成为实用程序类的一部分,使用该类我可以在servlet中获取管理资源。

And there was one more "session already closed" issue. For that I again made the resolverFactory a part of my utility class using which I could get administrativeResourceResolver in my servlet.

这篇关于CQ 5.6.1 getWorkflowSession导致未捕获的Throwable java.lang.NullPointerException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆