# DerivedDataFunction and scheduled publish

**URL:** <https://community.bloomreach.com/t/deriveddatafunction-and-scheduled-publish/2398>\
**Category:** Experience Manager (PaaS/OnPrem)\
**Created:** [February 15, 2021, 3:35pm UTC](https://community.bloomreach.com/t/deriveddatafunction-and-scheduled-publish/2398 "2021-02-15T15:35:32Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![david.sinclair](https://avatars.discourse-cdn.com/v4/letter/d/b5a626/32.png) [@david.sinclair](https://community.bloomreach.com/u/david.sinclair)\
**Post date:** [February 15, 2021, 3:35pm UTC](https://community.bloomreach.com/t/deriveddatafunction-and-scheduled-publish/2398/1 "2021-02-15T15:35:32Z")

</div>

Hi,

We have a derived data function DerivedDataFunction which works as we intend for the most part. The class is defined in the cms module as per the documentation. However we have noticed that when the user schedules a publish an exception is thrown (see below).

This is deployed as in the ‘Clustering’ diagram on this page:

> **[System Architecture - Bloomreach Experience - Open Source CMS](https://documentation.bloomreach.com/14/library/deployment/system-architecture.html)**
>
> Open Source Enterprise Content Management

The exception appears in the log for the delivery server logs. It seems like maybe the scheduled job is running in the delivery tier and cannot find the derived data function? Any ideas what we might be doing wrong here?

Regards,

David

Execution of scheduled workflow operation publish on /content/documents/govscot/publications/transparency-data/2021/02/marketing-spend-2019-2020/index failed  
org.hippoecm.repository.api.WorkflowException: No such function  
at org.onehippo.repository.documentworkflow.task.AbstractDocumentTask.execute(AbstractDocumentTask.java:95) ~[hippo-repository-workflow-5.6.3.jar:5.6.3]  
at org.onehippo.repository.scxml.AbstractWorkflowTaskAction.doExecute(AbstractWorkflowTaskAction.java:64) ~[hippo-repository-workflow-5.6.3.jar:5.6.3]  
at org.onehippo.repository.scxml.AbstractAction.execute(AbstractAction.java:77) ~[hippo-repository-workflow-5.6.3.jar:5.6.3]  
at org.apache.commons.scxml2.model.If.execute(If.java:144) ~[commons-scxml2-2.0-M1.jar:2.0-M1]  
at org.apache.commons.scxml2.semantics.SCXMLSemanticsImpl.executeContent(SCXMLSemanticsImpl.java:925) ~[commons-scxml2-2.0-M1.jar:2.0-M1]  
at org.apache.commons.scxml2.semantics.SCXMLSemanticsImpl.executeTransitionContent(SCXMLSemanticsImpl.java:911) ~[commons-scxml2-2.0-M1.jar:2.0-M1]  
at org.apache.commons.scxml2.semantics.SCXMLSemanticsImpl.microStep(SCXMLSemanticsImpl.java:249) ~[commons-scxml2-2.0-M1.jar:2.0-M1]  
at org.apache.commons.scxml2.semantics.SCXMLSemanticsImpl.nextStep(SCXMLSemanticsImpl.java:176) ~[commons-scxml2-2.0-M1.jar:2.0-M1]  
at org.apache.commons.scxml2.SCXMLExecutor.eventStep(SCXMLExecutor.java:418) ~[commons-scxml2-2.0-M1.jar:2.0-M1]  
at org.apache.commons.scxml2.SCXMLExecutor.triggerEvents(SCXMLExecutor.java:413) ~[commons-scxml2-2.0-M1.jar:2.0-M1]  
at org.apache.commons.scxml2.SCXMLExecutor.triggerEvent(SCXMLExecutor.java:381) ~[commons-scxml2-2.0-M1.jar:2.0-M1]  
at org.onehippo.repository.scxml.SCXMLWorkflowExecutor.triggerAction(SCXMLWorkflowExecutor.java:314) ~[hippo-repository-workflow-5.6.3.jar:5.6.3]  
at org.onehippo.repository.scxml.SCXMLWorkflowExecutor.triggerAction(SCXMLWorkflowExecutor.java:278) ~[hippo-repository-workflow-5.6.3.jar:5.6.3]  
at org.onehippo.repository.documentworkflow.DocumentWorkflowImpl.triggerAction(DocumentWorkflowImpl.java:464) ~[hippo-repository-workflow-5.6.3.jar:5.6.3]  
at org.onehippo.repository.documentworkflow.DocumentWorkflowImpl.publishBranch(DocumentWorkflowImpl.java:433) ~[hippo-repository-workflow-5.6.3.jar:5.6.3]  
at org.onehippo.repository.documentworkflow.DocumentWorkflowImpl.publish(DocumentWorkflowImpl.java:314) ~[hippo-repository-workflow-5.6.3.jar:5.6.3]  
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0\_222]  
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0\_222]  
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0\_222]  
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0\_222]  
at org.hippoecm.repository.impl.WorkflowManagerImpl$WorkflowInvocationHandler.invoke(WorkflowManagerImpl.java:373) ~[hippo-repository-engine-5.6.3.jar:5.6.3]  
at com.sun.proxy.$Proxy122.publish(Unknown Source) ~[?:?]  
at org.onehippo.repository.documentworkflow.task.ScheduleWorkflowTask$WorkflowJob.execute(ScheduleWorkflowTask.java:129) [hippo-repository-workflow-5.6.3.jar:5.6.3]  
at org.hippoecm.repository.quartz.RepositoryJobJob.execute(RepositoryJobJob.java:50) [hippo-repository-engine-5.6.3.jar:5.6.3]  
at org.quartz.core.JobRunShell.run(JobRunShell.java:202) [quartz-2.2.1.jar:?]  
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573) [quartz-2.2.1.jar:?]  
Caused by: javax.jcr.RepositoryException: No such function  
at org.hippoecm.repository.deriveddata.DerivedDataEngine.createFunction(DerivedDataEngine.java:243) ~[hippo-repository-engine-5.6.3.jar:5.6.3]  
at org.hippoecm.repository.deriveddata.DerivedDataEngine.applyFunction(DerivedDataEngine.java:216) ~[hippo-repository-engine-5.6.3.jar:5.6.3]  
at org.hippoecm.repository.deriveddata.DerivedDataEngine.applyFunctions(DerivedDataEngine.java:205) ~[hippo-repository-engine-5.6.3.jar:5.6.3]  
at org.hippoecm.repository.deriveddata.DerivedDataEngine.compute(DerivedDataEngine.java:186) ~[hippo-repository-engine-5.6.3.jar:5.6.3]  
at org.hippoecm.repository.deriveddata.DerivedDataEngine.save(DerivedDataEngine.java:85) ~[hippo-repository-engine-5.6.3.jar:5.6.3]  
at org.hippoecm.repository.deriveddata.DerivedDataEngine.save(DerivedDataEngine.java:65) ~[hippo-repository-engine-5.6.3.jar:5.6.3]  
at org.hippoecm.repository.impl.SessionDecorator.save(SessionDecorator.java:163) ~[hippo-repository-engine-5.6.3.jar:5.6.3]  
at org.onehippo.repository.documentworkflow.task.CopyVariantTask.doExecute(CopyVariantTask.java:103) ~[hippo-repository-workflow-5.6.3.jar:5.6.3]  
at org.onehippo.repository.documentworkflow.task.AbstractDocumentTask.execute(AbstractDocumentTask.java:93) ~[hippo-repository-workflow-5.6.3.jar:5.6.3]  
… 25 more  
Caused by: java.lang.ClassNotFoundException: scot.gov.www.PublicationTypeDerivedData  
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1365) ~[tomcat9-catalina-9.0.31.jar:9.0.31]  
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1188) ~[tomcat9-catalina-9.0.31.jar:9.0.31]  
at java.lang.Class.forName0(Native Method) ~[?:1.8.0\_222]  
at java.lang.Class.forName(Class.java:264) ~[?:1.8.0\_222]  
at org.hippoecm.repository.deriveddata.DerivedDataEngine.createFunction(DerivedDataEngine.java:238) ~[hippo-repository-engine-5.6.3.jar:5.6.3]  
at org.hippoecm.repository.deriveddata.DerivedDataEngine.applyFunction(DerivedDataEngine.java:216) ~[hippo-repository-engine-5.6.3.jar:5.6.3]  
at org.hippoecm.repository.deriveddata.DerivedDataEngine.applyFunctions(DerivedDataEngine.java:205) ~[hippo-repository-engine-5.6.3.jar:5.6.3]  
at org.hippoecm.repository.deriveddata.DerivedDataEngine.compute(DerivedDataEngine.java:186) ~[hippo-repository-engine-5.6.3.jar:5.6.3]  
at org.hippoecm.repository.deriveddata.DerivedDataEngine.save(DerivedDataEngine.java:85) ~[hippo-repository-engine-5.6.3.jar:5.6.3]  
at org.hippoecm.repository.deriveddata.DerivedDataEngine.save(DerivedDataEngine.java:65) ~[hippo-repository-engine-5.6.3.jar:5.6.3]  
at org.hippoecm.repository.impl.SessionDecorator.save(SessionDecorator.java:163) ~[hippo-repository-engine-5.6.3.jar:5.6.3]  
at org.onehippo.repository.documentworkflow.task.CopyVariantTask.doExecute(CopyVariantTask.java:103) ~[hippo-repository-workflow-5.6.3.jar:5.6.3]  
at org.onehippo.repository.documentworkflow.task.AbstractDocumentTask.execute(AbstractDocumentTask.java:93) ~[hippo-repository-workflow-5.6.3.jar:5.6.3]  
… 25 more

---

<div class="post-metadata">

**Author:** ![machak](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.bloomreach.com/machak/32/1298_2.png) [@machak](https://community.bloomreach.com/u/machak)\
**Post date:** [February 15, 2021, 5:37pm UTC](https://community.bloomreach.com/t/deriveddatafunction-and-scheduled-publish/2398/2 "2021-02-15T17:37:09Z")

</div>

Caused by: java.lang.ClassNotFoundException: scot.gov.www.PublicationTypeDerivedData

that class should be part of your repository package (repository war which is deployed with your site artifacts)

---

<div class="post-metadata">

**Author:** ![david.sinclair](https://avatars.discourse-cdn.com/v4/letter/d/b5a626/32.png) [@david.sinclair](https://community.bloomreach.com/u/david.sinclair)\
**Post date:** [February 16, 2021, 9:23am UTC](https://community.bloomreach.com/t/deriveddatafunction-and-scheduled-publish/2398/3 "2021-02-16T09:23:09Z")

</div>

Hi,

Thanks for your response. Can you clarify this for me though - in the docs it says to define your derived data function in the cms module as we have.

> **[Derived Data - Bloomreach Experience - Open Source CMS](https://documentation.bloomreach.com/14/library/concepts/content-repository/derived-data.html)**
>
> Open Source Enterprise Content Management

And my understanding was that in the deployment model I linked to in my question, the delivery server does not have the cms war deployed (only repository/platform and site). You say the class should be in the repository war - do you mean the docs are wrong?

Thanks,

David

---

<div class="post-metadata">

**Author:** ![jasper.floor](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.bloomreach.com/jasper.floor/32/28_2.png) [@jasper.floor](https://community.bloomreach.com/u/jasper.floor)\
**Post date:** [February 16, 2021, 10:33am UTC](https://community.bloomreach.com/t/deriveddatafunction-and-scheduled-publish/2398/4 "2021-02-16T10:33:48Z")

</div>

Derived data isn’t meant to fire on site servers, but scheduled publication shouldn’t be firing there either. What @machak is saying is that adding it to the repository module would solve the not found exception. I don’t think this is a proper fix. The derived data function does belong in the cms module. If you can reproduce this on an archetyp project that would be helpful. Otherwise you can try rasiing an issue in out bug tracker, but I can’t say if and when that will be picked up. Having a reproduction path helps immensely with that process.

---

<div class="post-metadata">

**Author:** ![machak](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.bloomreach.com/machak/32/1298_2.png) [@machak](https://community.bloomreach.com/u/machak)\
**Post date:** [February 16, 2021, 12:22pm UTC](https://community.bloomreach.com/t/deriveddatafunction-and-scheduled-publish/2398/5 "2021-02-16T12:22:40Z")

</div>

> [@jasper.floor](#):
>
> The derived data function does belong in the cms module.

are you sure about this…it is not a daemon module or UI related service.

---

<div class="post-metadata">

**Author:** ![david.sinclair](https://avatars.discourse-cdn.com/v4/letter/d/b5a626/32.png) [@david.sinclair](https://community.bloomreach.com/u/david.sinclair)\
**Post date:** [February 16, 2021, 5:25pm UTC](https://community.bloomreach.com/t/deriveddatafunction-and-scheduled-publish/2398/6 "2021-02-16T17:25:34Z")

</div>

It looks like a bug in the code we use to provision the servers is causing the

```auto
-Dhippo.scheduler.disabled=true

```

mentioned below to be false.

> **[Repository Scheduler - Bloomreach Experience - Open Source CMS](https://documentation.bloomreach.com/14/library/concepts/hippo-services/repository-scheduler.html)**
>
> Open Source Enterprise Content Management
