Ephemeris bank holidays not recognized in rule

I’m trying to make for testing purposes a simple script that will return in the log the holiday according to date from a custom Holidays XML file.
every time I run the script all I get in the log is:

[clipse.smarthome.model.script.events] - holiday is null

here is my script:

rule "ephemeris test"
    Item mqtt_topic_e4df1f67_click received update
    if (mqtt_topic_e4df1f67_click.state == 'long')
        logWarn("events", "holiday is " + Ephemeris.getBankHolidayName(2020-05-01,'/etc/openhab2/services/Holidays_il.xml'))
        logWarn("events", "is time " + now)

and here is my custom holiday file:

    <?xml version="1.0" encoding="UTF-8"?>
    <tns:Configuration hierarchy="il" description="Israel"
    	xmlns:tns="http://www.example.org/Holiday" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    		<tns:HebrewHolidayType type="ROSH_HASHANAH"/>
    		<tns:HebrewHolidayType type="PESACH"/>
    		<tns:Fixed month="MAY" day="1" descriptionPropertiesKey="test"/>

I also Tried changing the Ephemeris statement to:

Ephemeris.isBankHoliday (0,'/etc/openhab2/services/Holidays_il.xml')

But in that case I get the following error:

[ntime.internal.engine.RuleEngineImpl] - Rule 'ephemeris test': Cannot instantiate configuration from URL 'null'.

As you see I configured two holidays the system should automatically recognize (accroding to the Holiday.xsd here: https://github.com/svendiedrichsen/jollyday/blob/master/src/main/xsd/Holiday.xsd) and one holiday with a fixed date and I cant make the rule recognize any of them.
The Ephemeris day sets are working normally.
Any help would be appreciated.

2020-05-01 is essentially meaningless. It’s not a number, it’s not a String, and it’s not a ZonedDateTime, the latter of which is what getBankHoliday actually needs.

As documented in the docs:

getNextBankHoliday(<offset>, <file>) name of the next bank holiday after <offset> days from today defined in <file> . :warning: This action is broken in OH 2.5.x. Use getNextBankHoliday(<datetime>, <file>) instead by replacing <datetime> with ZonedDateTime.now().plusDays(<offset>)

Bold added by me.

So at the very top of your .rules file

import java.time.ZonedDateTime

To check for an offset, like the docs say use

 Ephemeris.isBankHoliday(ZonedDateTime.now(), '/etc/openhab2/services/Holidays_il.xml')

To check for a specific date there are a number of approaches including:

Ephemeris.isBankHoliday(ZonedDateTime.now().withMonth(5).withDay(1), '/etc/openhab2/services/Holidays_il.xml')

I just tried that and I get back a false response (in the log) instead of true (I have added today as a bank holiday).
I did the following:

logWarn("events", "holiday is " + Ephemeris.isBankHoliday(ZonedDateTime.now().plusDays(0), '/etc/openhab2/services/Holidays_il.xml'))

And got:

[clipse.smarthome.model.script.events] - holiday is false

Also when I try to do the following:

I get the following error:

[ntime.internal.engine.RuleEngineImpl] - Rule 'ephemeris test': 'withDay' is not a member of 'java.time.ZonedDateTime'; line 23, column 67, length 43

Ok, I figured that one out, it’s supposed to be withDayOfMonth(1).
However the original problem of not recognizing the custom holidays file still occurs, I still get holiday is false in the log.

I don’t know if this related to my problem but I just tried another xml file which I downloaded directly from here:

when I modify my rule to try and read from this file I get the following error:

[ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'ephemeris test': null

It seems that the issue was is that I was trying to read the file from the wrong directory, it’s supposed to be /srv/openhab2-conf/services/Holidays_il.xml instead of what I’ve been using.