# Hippo Scheduler

**URL:** <https://community.bloomreach.com/t/hippo-scheduler/1690>\
**Category:** Experience Manager (PaaS/OnPrem)\
**Created:** [January 20, 2020, 3:31pm UTC](https://community.bloomreach.com/t/hippo-scheduler/1690 "2020-01-20T15:31:09Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![maksimyugai](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.bloomreach.com/maksimyugai/32/305_2.png) [@maksimyugai](https://community.bloomreach.com/u/maksimyugai)\
**Post date:** [January 20, 2020, 3:31pm UTC](https://community.bloomreach.com/t/hippo-scheduler/1690/1 "2020-01-20T15:31:09Z")

</div>

Hi, everyone. Can’t understand, why this job doesn’t work? Very simple job. Trying to exec a manual cron job, as described here: [https://documentation.bloomreach.com/12/library/concepts/hippo-services/repository-scheduler.html](https://documentation.bloomreach.com/12/library/concepts/hippo-services/repository-scheduler.html)

What I’m doing wrong?

 ![cron-job](https://canada1.discourse-cdn.com/flex027/uploads/bloomreach1/original/1X/3e4a538923b119eaf6d56bb33c3ac2e8722be38c.png) ![cron-job-2](https://canada1.discourse-cdn.com/flex027/uploads/bloomreach1/original/1X/fa042f78addc5e95de84a804948629c7e1272a30.png) ![cron-job-3](https://canada1.discourse-cdn.com/flex027/uploads/bloomreach1/original/1X/1adb2a35a735ba1bf67d2ab505a6ba9c96c84811.png)

---

<div class="post-metadata">

**Author:** ![maksimyugai](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.bloomreach.com/maksimyugai/32/305_2.png) [@maksimyugai](https://community.bloomreach.com/u/maksimyugai)\
**Post date:** [January 20, 2020, 3:34pm UTC](https://community.bloomreach.com/t/hippo-scheduler/1690/2 "2020-01-20T15:34:00Z")

</div>

This job should be executing every minute. I have already tried this expressions: “\* \* \* \* \* ?”, “0/1 \* \* \* \* ?”. But I think problem is not there.

---

<div class="post-metadata">

**Author:** ![bcanvural](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.bloomreach.com/bcanvural/32/235_2.png) [@bcanvural](https://community.bloomreach.com/u/bcanvural)\
**Post date:** [January 20, 2020, 3:51pm UTC](https://community.bloomreach.com/t/hippo-scheduler/1690/3 "2020-01-20T15:51:45Z")

</div>

Hmm, are you sure no breakpoints are hit? I can see one problematic place: SelectionUtil.getValueListByIdentifier … that one requires a request context to be present (there is none in that job execution context). you are probably hitting NPEs.  
If you set a breakpoint at the very beginning of execute(), does that get triggerred?

---

<div class="post-metadata">

**Author:** ![jeroen.hoffman](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.bloomreach.com/jeroen.hoffman/32/43_2.png) [@jeroen.hoffman](https://community.bloomreach.com/u/jeroen.hoffman)\
**Post date:** [January 20, 2020, 3:56pm UTC](https://community.bloomreach.com/t/hippo-scheduler/1690/4 "2020-01-20T15:56:15Z")

</div>

How about setting hipposched:enabled=true on that node, or two levels up in the HeProxyContainerCheckingJob?

---

<div class="post-metadata">

**Author:** ![maksimyugai](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.bloomreach.com/maksimyugai/32/305_2.png) [@maksimyugai](https://community.bloomreach.com/u/maksimyugai)\
**Post date:** [January 20, 2020, 4:08pm UTC](https://community.bloomreach.com/t/hippo-scheduler/1690/5 "2020-01-20T16:08:04Z")

</div>

No, it doesn’t. Doesn’t triggered. I set breakpoint at the first line of “execute” method. About SelectionUtil I will use RepositoryJobExecutionContext then, but I can’t get there.

 ![cron-job-4](https://canada1.discourse-cdn.com/flex027/uploads/bloomreach1/original/1X/0d14d565682f9c730c994976c528c9e86b9db7d2.png)

---

<div class="post-metadata">

**Author:** ![maksimyugai](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.bloomreach.com/maksimyugai/32/305_2.png) [@maksimyugai](https://community.bloomreach.com/u/maksimyugai)\
**Post date:** [January 20, 2020, 4:10pm UTC](https://community.bloomreach.com/t/hippo-scheduler/1690/6 "2020-01-20T16:10:07Z")

</div>

It’s enabled. You can see it at the picture.

---

<div class="post-metadata">

**Author:** ![saimir.muco](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.bloomreach.com/saimir.muco/32/513_2.png) [@saimir.muco](https://community.bloomreach.com/u/saimir.muco)\
**Post date:** [January 20, 2020, 4:14pm UTC](https://community.bloomreach.com/t/hippo-scheduler/1690/7 "2020-01-20T16:14:36Z")

</div>

Hi,  
the field hipposched:nextFireTime is showing at what time the job will be executed according to the cron expression you have set up. Is that time correct for you?

---

<div class="post-metadata">

**Author:** ![maksimyugai](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.bloomreach.com/maksimyugai/32/305_2.png) [@maksimyugai](https://community.bloomreach.com/u/maksimyugai)\
**Post date:** [January 20, 2020, 4:14pm UTC](https://community.bloomreach.com/t/hippo-scheduler/1690/8 "2020-01-20T16:14:59Z")

</div>

It’s not possible to add property hstsched to another nodes, only to repositoryjob.

---

<div class="post-metadata">

**Author:** ![maksimyugai](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.bloomreach.com/maksimyugai/32/305_2.png) [@maksimyugai](https://community.bloomreach.com/u/maksimyugai)\
**Post date:** [January 20, 2020, 4:17pm UTC](https://community.bloomreach.com/t/hippo-scheduler/1690/9 "2020-01-20T16:17:33Z")

</div>

Hi. Yes it’s correct. GMT +6. This date updated right after updating console page. Don’t know is it right or not.

---

<div class="post-metadata">

**Author:** ![maksimyugai](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.bloomreach.com/maksimyugai/32/305_2.png) [@maksimyugai](https://community.bloomreach.com/u/maksimyugai)\
**Post date:** [January 20, 2020, 4:30pm UTC](https://community.bloomreach.com/t/hippo-scheduler/1690/10 "2020-01-20T16:30:42Z")

</div>

No, wait. This date is changing only after this time is reached. For example, this time “2020-01-20T22:27:08.000+06:00” will be set after this time is reached, after 22:27:08. Here’s really something wrong. Or it’s ok for this?

---

<div class="post-metadata">

**Author:** ![maksimyugai](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.bloomreach.com/maksimyugai/32/305_2.png) [@maksimyugai](https://community.bloomreach.com/u/maksimyugai)\
**Post date:** [January 21, 2020, 7:31am UTC](https://community.bloomreach.com/t/hippo-scheduler/1690/11 "2020-01-21T07:31:33Z")

</div>

Any ideas why it doesn’t work? Maybe it needs to specify as a bean? Or smth else.

---

<div class="post-metadata">

**Author:** ![bcanvural](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.bloomreach.com/bcanvural/32/235_2.png) [@bcanvural](https://community.bloomreach.com/u/bcanvural)\
**Post date:** [January 21, 2020, 8:27am UTC](https://community.bloomreach.com/t/hippo-scheduler/1690/12 "2020-01-21T08:27:05Z")

</div>

I just tried it locally on a v12 project and documentation worked fine for me. My steps were:

Add dependencies to cms pom.xml:

```xml
    <dependency>
      <groupId>org.onehippo.cms7</groupId>
      <artifactId>hippo-services</artifactId>
    </dependency>
    <dependency>
      <groupId>org.onehippo.cms7</groupId>
      <artifactId>hippo-repository-api</artifactId>
    </dependency>

```

Write a dummy job:

```java
package com.bloomreach.jobs;

import org.onehippo.repository.scheduling.RepositoryJob;
import org.onehippo.repository.scheduling.RepositoryJobExecutionContext;

import javax.jcr.RepositoryException;

public class DummyJob implements RepositoryJob {
    @Override
    public void execute(RepositoryJobExecutionContext repositoryJobExecutionContext) throws RepositoryException {
        System.out.println("This gets executed");
    }
}

```

Add the config (requires restart):

```auto
/example:
  jcr:primaryType: hipposched:jobgroup
  /dummyjob:
    jcr:primaryType: hipposched:repositoryjob
    hipposched:attributeNames: [foo]
    hipposched:attributeValues: [bar]
    hipposched:enabled: true
    hipposched:repositoryJobClass: com.bloomreach.jobs.DummyJob
    /hipposched:triggers:
      jcr:primaryType: hipposched:triggers
      /everythirtyseconds:
        jcr:primaryType: hipposched:crontrigger
        jcr:uuid: 040c1d3a-97f1-4811-adc5-725efbeed172
        hipposched:cronExpression: 0/30 0/1 * 1/1 * ? *
        hipposched:nextFireTime: 2020-01-21T09:26:00+01:00

```

screenshot:

 ![Screenshot 2020-01-21 at 09.26.05](https://canada1.discourse-cdn.com/flex027/uploads/bloomreach1/original/1X/1178bdc1da784fadef8e5d07710ddc7af633828b.png)

Did you perhaps skip any of these steps ?

---

<div class="post-metadata">

**Author:** ![maksimyugai](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.bloomreach.com/maksimyugai/32/305_2.png) [@maksimyugai](https://community.bloomreach.com/u/maksimyugai)\
**Post date:** [January 21, 2020, 9:39am UTC](https://community.bloomreach.com/t/hippo-scheduler/1690/13 "2020-01-21T09:39:45Z")

</div>

Can you set job that working every minute and show me your config yaml file.

I have this config which doesn’t work.

 ![hippo-sched-1](https://canada1.discourse-cdn.com/flex027/uploads/bloomreach1/original/1X/6bb68f4685f8732b9bec3c56c8f6d07c9e61d584.png)

---

<div class="post-metadata">

**Author:** ![bcanvural](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.bloomreach.com/bcanvural/32/235_2.png) [@bcanvural](https://community.bloomreach.com/u/bcanvural)\
**Post date:** [January 21, 2020, 9:58am UTC](https://community.bloomreach.com/t/hippo-scheduler/1690/14 "2020-01-21T09:58:16Z")

</div>

```auto
/example:
  jcr:primaryType: hipposched:jobgroup
  /dummyjob:
    jcr:primaryType: hipposched:repositoryjob
    hipposched:attributeNames: [foo]
    hipposched:attributeValues: [bar]
    hipposched:enabled: true
    hipposched:repositoryJobClass: com.bloomreach.jobs.DummyJob
    /hipposched:triggers:
      jcr:primaryType: hipposched:triggers
      /everyminute:
        jcr:primaryType: hipposched:crontrigger
        jcr:uuid: 040c1d3a-97f1-4811-adc5-725efbeed172
        hipposched:cronExpression: 0 * * ? * *
        hipposched:nextFireTime: 2020-01-21T10:58:00+01:00

```

---

<div class="post-metadata">

**Author:** ![maksimyugai](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.bloomreach.com/maksimyugai/32/305_2.png) [@maksimyugai](https://community.bloomreach.com/u/maksimyugai)\
**Post date:** [January 21, 2020, 10:49am UTC](https://community.bloomreach.com/t/hippo-scheduler/1690/15 "2020-01-21T10:49:44Z")

</div>

> [@bcanvural](#):
>
> 0 \* \* ? \* \*

Is this right? (Post must be more than 20 symbols))))

---

<div class="post-metadata">

**Author:** ![maksimyugai](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.bloomreach.com/maksimyugai/32/305_2.png) [@maksimyugai](https://community.bloomreach.com/u/maksimyugai)\
**Post date:** [January 21, 2020, 10:51am UTC](https://community.bloomreach.com/t/hippo-scheduler/1690/16 "2020-01-21T10:51:06Z")

</div>

As I know hippo uses unix notation for cron: [https://crontab.guru/every-1-minute](https://crontab.guru/every-1-minute)

---

<div class="post-metadata">

**Author:** ![bcanvural](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.bloomreach.com/bcanvural/32/235_2.png) [@bcanvural](https://community.bloomreach.com/u/bcanvural)\
**Post date:** [January 21, 2020, 10:55am UTC](https://community.bloomreach.com/t/hippo-scheduler/1690/17 "2020-01-21T10:55:26Z")

</div>

This executed every minute for me. I used this one i think [https://www.freeformatter.com/cron-expression-generator-quartz.html](https://www.freeformatter.com/cron-expression-generator-quartz.html) If you add wrong format you should see errors in the terminal

---

<div class="post-metadata">

**Author:** ![bcanvural](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.bloomreach.com/bcanvural/32/235_2.png) [@bcanvural](https://community.bloomreach.com/u/bcanvural)\
**Post date:** [January 21, 2020, 10:56am UTC](https://community.bloomreach.com/t/hippo-scheduler/1690/18 "2020-01-21T10:56:27Z")

</div>

I tried the one in the link you shared. It gave me errors in the terminal

---

<div class="post-metadata">

**Author:** ![maksimyugai](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.bloomreach.com/maksimyugai/32/305_2.png) [@maksimyugai](https://community.bloomreach.com/u/maksimyugai)\
**Post date:** [January 21, 2020, 11:14am UTC](https://community.bloomreach.com/t/hippo-scheduler/1690/19 "2020-01-21T11:14:23Z")

</div>

Ok. It’s not working for me. But I’m using now Spring scheduler.  
Second question, do you know how I can get ValueList object from session? In my scheduler I don’t have request context. Or how can I convert Node type to HippoBean type?
