Update Zulu11 to Zulu17 JS Transformation Problems

Hi, i have problem after updating from Zulu11 to Zulu17 and OH 3.4.4 (Ubuntu 22.04) (in preparation for OH4). my JavaScript Transformations doesnt work anymore.

I have item descriptions with JS Transformations like this:

Number iChannel_0_RemQuantity "Rem. Quantity [JS(UlToMl.js):%s]"

in transform folder the UlToMl.js:

(function(inputValue) {
  var ml = inputValue / 1000
  ml = Math.round(ml * 100) / 100
  var res = ml + " ml" 
  return res

after updating vom zulu11 to zulu17 (removed all zulu11 packages and installed zulu17) i got the following log entry (still OH 3.4.4):

2023-09-04 20:43:33.830 [ERROR] [internal.JSONResponseExceptionMapper] - Unexpected exception occurred while processing REST request.
java.lang.NullPointerException: Cannot invoke “javax.script.Compilable.compile(java.io.Reader)” because “engine” is null
at org.openhab.transform.javascript.internal.JavaScriptEngineManager.getCompiledScriptByFilename(JavaScriptEngineManager.java:77) ~[?:?]
at org.openhab.transform.javascript.internal.JavaScriptTransformationService.transform(JavaScriptTransformationService.java:119) ~[?:?]
at org.openhab.core.transform.TransformationHelper.transform(TransformationHelper.java:125) ~[?:?]
at org.openhab.core.transform.TransformationHelper.transform(TransformationHelper.java:100) ~[?:?]
at org.openhab.core.io.rest.core.item.EnrichedItemDTOMapper.considerTransformation(EnrichedItemDTOMapper.java:148) ~[?:?]
at org.openhab.core.io.rest.core.item.EnrichedItemDTOMapper.map(EnrichedItemDTOMapper.java:81) ~[?:?]

any advices?

regards Bobby

Have you already upgraded to openhab 4 ?

No, not so far. I want to correct existing errors first, before I get more problems with the update.

OH 3.4 does not fully support Java 17. Some of the JavaScript related issues were only fixed in OH 4. That’s why all the OH 3.4 documentation also instructs users to use Java 11 with it.

ok, i have updated to OH 4.0.2 … now the JS Transformations work again :slight_smile:

1 Like