简体   繁体   中英

Migrated Workflow models and scripts for 6.3 to 6.5 AEM upgrade, Scripts are not getting picked up

I migrated my aem instance from 6.3 to 6.5 and the model got migrated and are working well. But the workflow with scripts are not working because it is not able to pick up the script from the location (checked both before/after migrating scripts to new locations it was through same error). The OOTB scripts are also not getting picked for usage.

Error: DEBUG org.apache.sling.jcr.resource.internal.helper.jcr.JcrItemResourceFactory createResource: No JCR Item exists at path '/apps/workflow/scripts/mine.ecma' DEBUG org.apache.sling.resourceresolver.impl.helper.ResourceResolverControl Resource null /apps/workflow/scripts/mine.ecma DEBUG org.apache.sling.resourceresolver.impl.ResourceResolverImpl getResourceInternal: Cannot resolve path '/apps/workflow/scripts/mine.ecma' to a resource ERROR com.adobe.granite.workflow.core.rule.ScriptingRuleEngine Could not find script resource /apps/workflow/scripts/mine.ecma. Workflow Scripts may need to be located in /libs or /apps to be executed ERROR com.adobe.granite.workflow.core.rule.RuleEngineAdminImpl Cannot evaluate rule: /apps/workflow/scripts/mine.ecma com.adobe.granite.workflow.WorkflowException: Unable to find script resource /apps/workflow/scripts/mine.ecma, make sure scripts are located in /libs or /apps at com.adobe.granite.workflow.core.rule.ScriptingRuleEngine.evaluate(ScriptingRuleEngine.jav a:112) [com.adobe.granite.workflow.core:2.0.240] at com.adobe.granite.workflow.core.rule.RuleEngineAdminImpl.evaluate(RuleEngineAdminImpl.jav a:53) [com.adobe.granite.workflow.core:2.0.240] at com.adobe.granite.workflow.core.WorkflowSessionImpl.evaluate(WorkflowSessionImpl.java:136 9) [com.adobe.granite.workflow.core:2.0.240] at com.adobe.granite.workflow.core.jcr.WorkItemManager.resolveTransition(WorkItemManager.jav a:963) [com.adobe.granite.workflow.core:2.0.240] at com.adobe.granite.workflow.core.jcr.WorkItemManager.resolveTransition(WorkItemManage r.jav a:991) [com.adobe.granite.workflow.core:2.0.240] at com.adobe.granite.workflow.core.jcr.WorkItemManager.getRoutes(WorkItemManager.java:676) [com.adobe.granite.workflow.core:2.0.240] at com.adobe.granite.workflow.core.WorkflowSessionImpl.getRoutes(WorkflowSessionImpl.java:99 3) [com.adobe.granite.workflow.core:2.0.240] at com.adobe.granite.workflow.core.job.JobHandler.getNextRouteToProcess(JobHandler.java:517) [com.adobe.granite.workflow.core:2.0.240] at com.adobe.granite.workflow.core.job.JobHandler.process(JobHandler.java:328) [com.adobe.granite.workflow.core:2.0.240] at org.apache.sling.event.impl.jobs.JobConsumerManager$JobConsumerWrapper.process(JobConsume rManager.java:502) [org.apache.sling.event:4.2.12] at org.apache.sling.event.impl.jobs.queues.JobQueueImpl.startJob(JobQueueImpl.java:293) [org.apache.sling.event:4.2.12] at org.apache.sling.event.impl.jobs.queues.JobQueueImpl.access$100(JobQueueImpl.java:60) [org.apache.sling.event:4.2.12] at org.apache.sling.event.impl.jo bs.queues.JobQueueImpl$1.run(JobQueueImpl.java:229) [org.apache.sling.event:4.2.12] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)

Any help would be appreciated.

I was running into a similar issue. I was getting:

can't find method org.apache.sling.scripting.core.impl.InternalScriptHelper.getService(object). (/etc/workflow/scripts/..../*.ecma

I looked at the code and found that there was an error where we were getting resourceresolver and it seems it has changed, so instead of

var resolver = sling.getService(Packages.org.apache.sling.jcr.resource.JcrResourceResolverFactory).getResourceResolver(session);

used this and error was gone

var resolver = sling.getRequest().getResource().getResourceResolver();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM