[SOLVED] Rule problems after powerON

Hello,
I use Raspi3 openHABian 2.3.0 Build #1218 and one rule-file with some lambdas and rules

import org.eclipse.xtext.xbase.lib.Functions
var Index = newArrayList(-1,-1,-1)
var NextEvent = newArrayList(0,0,0) 

val Functions$Function1 <String, Integer> ToMin = [ s |
...

Sometimes all is working fine

2018-03-07 11:39:30.871 [INFO ] [b.core.service.AbstractActiveService] - Expire Refresh Service has been started
2018-03-07 11:39:45.090 [INFO ] [org.eclipse.smarthome.model.script._] - System started

and sometimes without changes I get this errors

2018-03-07 11:57:29.509 [INFO ] [b.core.service.AbstractActiveService] - Expire Refresh Service has been started
2018-03-07 11:57:47.545 [WARN ] [me.internal.engine.RuleContextHelper] - Variable 'Index' on rule file 'home.rules' cannot be initialized with value 'newArrayList(<XUnaryOperationImplCustom>,<XUnaryOperationImplCustom>,<XUnaryOperationImplCustom>)': The name 'newArrayList' cannot be resolved to an item or type; line 23, column 13, length 22
2018-03-07 11:57:47.556 [WARN ] [me.internal.engine.RuleContextHelper] - Variable 'NextEvent' on rule file 'home.rules' cannot be initialized with value 'newArrayList(<XNumberLiteralImpl>,<XNumberLiteralImpl>,<XNumberLiteralImpl>)': The name 'newArrayList' cannot be resolved to an item or type; line 24, column 17, length 19
2018-03-07 11:57:47.672 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'Me_Radio_SU': The name 'Index' cannot be resolved to an item or type; line 508, column 59, length 5
2018-03-07 11:57:47.673 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'Zs_Gong_Modus': The name 'Gong' cannot be resolved to an item or type; line 519, column 59, length 4
2018-03-07 11:57:47.681 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'Zs_TH_SU': The name 'Index' cannot be resolved to an item or type; line 504, column 59, length 5
2018-03-07 11:57:47.681 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'Zs_IO': The name 'Zs_IO_LU' cannot be resolved to an item or type; line 459, column 3, length 8
2018-03-07 11:57:47.685 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'se_mcp3008': The name 'se_mcp3008_LU' cannot be resolved to an item or type; line 393, column 3, length 13
2018-03-07 11:57:47.686 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'Zs_EG_SU': The name 'Index' cannot be resolved to an item or type; line 506, column 59, length 5
2018-03-07 11:58:11.730 [INFO ] [org.eclipse.smarthome.model.script._] - System started
2018-03-07 11:58:12.389 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule 'jede Minute': cannot invoke method public java.lang.Object java.util.ArrayList.get(int) on null

How can I find the reason or a solution?

1 Like

Try this:

1 Like

Thanks, it helps to find and solve my problem.
It seams to be a timing/performance problem. The Raspi get slow down if I use a USB-HDD and the application increase.
It’s combined with


1 Like

It also looks like you are trying to use a List without the import…

import java.util.List