Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
AEM 6.1 Uber Jar Maven依赖项_Maven_Workflow_Aem_Uberjar_Aem 6 - Fatal编程技术网

AEM 6.1 Uber Jar Maven依赖项

AEM 6.1 Uber Jar Maven依赖项,maven,workflow,aem,uberjar,aem-6,Maven,Workflow,Aem,Uberjar,Aem 6,我使用AEM 6.1和Maven作为构建管理器。我已经用Adobe提供的未融合的UberJar更新了.m2本地文件夹。我得到以下错误: 错误[JobHandler:/etc/workflow/instances/server0/2016-07-15/model_157685507700064:/content/myApp/testing/wf_test01] com.adobe.granite.workflow.core.job.JobHandler流程实施 未找到:com.myApp.work

我使用
AEM 6.1
Maven
作为构建管理器。我已经用Adobe提供的未融合的
UberJar
更新了.m2本地文件夹。我得到以下错误:

错误[JobHandler:/etc/workflow/instances/server0/2016-07-15/model_157685507700064:/content/myApp/testing/wf_test01] com.adobe.granite.workflow.core.job.JobHandler流程实施 未找到:com.myApp.workflow.ActivatemyAppPageProcess com.adobe.granite.workflow.WorkflowException:流程实施 未找到:com.myApp.workflow.ActivatemyAppPageProcess位于 com.adobe.granite.workflow.core.job.HandlerBase.executeProcess(HandlerBase.java:197) 在 com.adobe.granite.workflow.core.job.JobHandler.process(JobHandler.java:232) 在 org.apache.sling.event.impl.jobs.JobConsumerManager$JobConsumerRapper.process(JobConsumerManager.java:512) 在 org.apache.sling.event.impl.jobs.queues.JobRunner.run(JobRunner.java:205) 在 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) 在 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) 运行(Thread.java:745)

UberJar
似乎没有
com.adobe.granite.workflow.core.job
包。有没有办法解决这个问题

流程步骤的
.execute
方法
ActivatemyAppPageProcess

public void execute(WorkItem workItem, WorkflowSession workflowSession, MetaDataMap args) throws WorkflowException {
    Session participantSession = null;
    Session replicationSession = null;
    // ResourceResolver resourceResolver = null;
    try {
        log.info("Inside ActivatemyAppPageProcess ");
        Session session = workflowSession.getSession();
        if (replicateAsParticipant(args)) {
            String approverId = resolveParticipantId(workItem, workflowSession);
            if (approverId != null) {
                participantSession = getParticipantSession(approverId, workflowSession);
            }
        }
        if (participantSession != null)
            replicationSession = participantSession;
        else {
            replicationSession = session;
        }

        WorkflowData data = workItem.getWorkflowData();
        String path = null;
        String type = data.getPayloadType();
        if ((type.equals("JCR_PATH")) && (data.getPayload() != null)) {
            String payloadData = (String) data.getPayload();
            if (session.itemExists(payloadData))
                path = payloadData;
            }
            else if ((data.getPayload() != null) && (type.equals("JCR_UUID"))) {
                Node node = session.getNodeByUUID((String) data.getPayload());
                path = node.getPath();
            }
            ReplicationOptions opts = null;
            String rev = (String) data.getMetaDataMap().get("resourceVersion", String.class);
            if (rev != null) {
                opts = new ReplicationOptions();
                opts.setRevision(rev);
            }
            opts = prepareOptions(opts);

            if (path != null) {
                ResourceCollection rcCollection = 
                    ResourceCollectionUtil
                        .getResourceCollection(
                            (Node) this.admin.getItem(path), 
                                (ResourceCollectionManager) this.rcManager);
                boolean isWFPackage = isWorkflowPackage(path, resolverFactory, workflowSession);
                List<String> paths = getPaths(path, rcCollection);
                for (String aPath : paths)
                    if (canReplicate(replicationSession, aPath)) {
                        if (opts != null) {
                            if (isWFPackage) {
                                setRevisionForPage(aPath, opts, data);
                            }
                            this.replicator
                                    .replicate(replicationSession, 
                                                   getReplicationType(),
                                                       aPath,
                                                           opts);
                            } else {
                                this.replicator
                                        .replicate(replicationSession, 
                                                       getReplicationType(),
                                                           aPath);
                        }
                    } else {
                        log.debug(session.getUserID() + " is not allowed to replicate " + "this page/asset " + aPath + ". Issuing request for 'replication");

                        Dictionary properties = new Hashtable();
                        properties.put("path", aPath);
                        properties.put("replicationType", getReplicationType());
                        properties.put("userId", session.getUserID());
                        Event event = new Event("com/day/cq/wcm/workflow/req/for/activation", properties);
                        this.eventAdmin.sendEvent(event);
                    }
            } else {
                log.warn("Cannot activate page or asset because path is null for this workitem: " + workItem.toString());
            }
        } catch (RepositoryException e) {
            throw new WorkflowException(e);
        } catch (ReplicationException e) {
            throw new WorkflowException(e);
        } finally {
            if ((participantSession != null) && (participantSession.isLive())) {
                participantSession.logout();
                participantSession = null;
            }
        }
    }
public void execute(WorkItem WorkItem、WorkflowSession WorkflowSession、MetaDataMap args)抛出WorkflowException{
会话参与者会话=空;
会话复制会话=null;
//ResourceResolver ResourceResolver=null;
试一试{
log.info(“内部ActivatemyAppPageProcess”);
会话会话=workflowSession.getSession();
if(参与者(args)){
字符串approverId=ResolveParticipanId(工作项,工作流程会话);
如果(approverId!=null){
participantSession=getParticipantSession(approverId,workflowSession);
}
}
if(participantSession!=null)
复制会话=参与者会话;
否则{
复制会话=会话;
}
WorkflowData=workItem.getWorkflowData();
字符串路径=null;
字符串类型=data.getPayloadType();
if((type.equals(“JCR_PATH”)&&(data.getPayload()!=null)){
String payloadData=(String)data.getPayload();
if(session.itemExists(payloadData))
路径=有效载荷数据;
}
else if((data.getPayload()!=null)和&(type.equals(“JCR_UUID”)){
Node Node=session.getnodebyuid((字符串)data.getPayload());
path=node.getPath();
}
复制选项opts=null;
String rev=(String)data.getMetaDataMap().get(“resourceVersion”,String.class);
如果(rev!=null){
opts=新的复制选项();
选项集修订版(修订版);
}
opts=准备选项(opts);
if(路径!=null){
ResourceCollection rcCollection=
ResourceCollectionUtil
.getResourceCollection(
(节点)this.admin.getItem(路径),
(ResourceCollectionManager)此.rcManager);
布尔值iswfpack=isWorkflowPackage(路径、解析工厂、workflowSession);
列表路径=获取路径(路径,rcCollection);
用于(字符串:路径)
如果(可以复制(复制会话,aPath)){
如果(选项!=null){
if(isWFPackage){
setRevisionForPage(页面、选项、数据);
}
这个是复制器
.复制(复制会话,
getReplicationType(),
阿帕斯,
选择);
}否则{
这个是复制器
.复制(复制会话,
getReplicationType(),
磷灰石);
}
}否则{
log.debug(session.getUserID()+”不允许复制“+”此页面/资产“+aPath+”。发出“复制”请求);
字典属性=新哈希表();
属性。put(“路径”,aPath);
put(“replicationType”,getReplicationType());
properties.put(“userId”,session.getUserID());
事件=新事件(“com/day/cq/wcm/workflow/req/for/activation”,属性);
this.eventAdmin.sendEvent(事件);
}
}否则{
log.warn(“无法激活页面或资源,因为此工作项的路径为null:+workitem.toString());
}
}捕获(存储异常e){
抛出新的WorkflowException(e);
}捕获(复制异常e){
抛出新的WorkflowException(e);
}最后{
if((participantSession!=null)&&(participantSession.isLive()){
participantSession.logout();
participantSession=null;
}
}
}

在AEM中根本不导出com.adobe.granite.workflow.core.job。这意味着,您不能使用它,因为它对您的代码是不可见的

com.adobe.granite.workflow.corecom.adobe.granite.workflow,version=1.0.0
com.adobe.granite.workflow.collection,version=1.1.0
com.adobe.granite.workflow.collection.util,version=1.0.0
com.adobe.granite.workflow.event,version=1.0.0
com.adobe.granite.workflow.exec,version=1.0.0
com.adobe.granite.workflow.exec.filter,version=1.0.0
com.adobe.granite.workflow.job,version=1.0.0
com.adobe.granite.workflow.launcher,version=1.0.0
com.adobe.granite.workflow.metadata,version=1.0.0
com.adobe.granite.workflow.model,version=1.0.0
com.adobe.granite.workflow.rule,version=1.0.0
com.adobe.granite.workflow.serialization,version=1.0.0
com.adobe.granite.workflow.status,version=1.0.0
Workflow workflow = workItem.getWorkflow();
WorkflowData wfData = workflow.getWorkflowData();
workflowSession.terminateWorkflow(workflow);
Map<String, Object> paramMap = new HashMap<String, Object>();
if (!StringUtils.isEmpty(data.getNextParticipantUid())) {
    paramMap.put("nextParticipant", "admin");
}
workflowSession.startWorkflow(
    workflowSession.getModel(WORKFLOW_MODEL_PATH, wfData, paramMap);