sendMail does not work correctly anymore after updating Java and openHAB

  • Platform information:
    • Hardware: Intel 64bit
    • OS: Docker container openhab-2.2.0-snaphot-debian
    • Java Runtime Environment: zulu openjdk version “1.8.0_144”
    • openHAB version: 2.2.0
  • Issue of the topic: sendMail does not work anymore! It has worked in an openHAB docker container of wetware/openHAB with openhab version 2.1.0. This container has openjdk version 1.8.0_45. After testing with this image I decided to use the original openHAB/openHAB docker container on debian with openHAB 2.2.0 and zulu openjdk 1.8.0_144 - Now the email notification does not work anymore.

Here is the error from the openhab.log:

16:22:18.805 [ERROR] [untime.internal.engine.RuleEngineImpl] - Rule 'TEST Druck niedrig TEST': An error occurred during the script execution: The name 'sendMail(<XStringLiteralImpl>,<XStringLiteralImpl>,<XStringLiteralImpl>)' cannot be resolved to an item or type.

This is the rule I created for debugging:

rule "TEST Druck niedrig TEST"
when Item EmailStatusDruck received command
    then
	if (EmailStatusDruck.state == "off")
	{
    	logInfo("FILE", "TEST Entering <Druck niedrig> TEST");
		//val message = " TEST TEST TEST TEST TEST \n Druck ist niedrig! \n  TEST TEST TEST TEST TEST";
		sendMail("druck1138@arcor.de", "Test Email", message);
		
        sendMail("druck1138@arcor.de", "BLA", "BLA BLA");

		EmailStatusDruck.postUpdate("on");

    	logInfo("FILE", "TEST EmailStatusDruck ist jetzt: TEST" + EmailStatusDruck.state);
		
	}
end

Neither the sendMail with the customized message nor the short “BLA” version works :frowning:

I have checked on the karaf console that the mail action settings are correct.

Is there any other way to submit an email to check if the problem is due to sending errors for the email or if it is an issue with sendMail.
I suspect the reason in the different Java version but I don’t know how to prove that.

Thank you for any hint or idea how to solve this …

Cheers
Justus

Stupid me !!!

I used a new addons.cfg and missed to add ‘mail’ in the actions section:

...

# A comma-separated list of actions to install (e.g. "mail,pushover")
action = mail

...

Now the email is sent by my rule as expected!!!

!!! Problem solved !!!