[SOLVED] The name 'logInfo' cannot be resolved to an item or type;

  • Platform information:

    • Hardware: Raspi3
    • OS: openhabian (debian_version: 9.4)
    • Java Runtime Environment: openjdk version “1.8.0_152” (strangely dpkg --get-selections | grep jdk yields no results)
    • openHAB version: 2.3.0-1
  • Issue of the topic: some rules sometimes raise exceptions about “…cannot be resolved to an item or type”. Adding logInfo statements yields that even that is undefined (but only sometimes).
    I do run this in a createTimer(now.plusSeconds(20)) call, maybe that is an issue?

  • Rules file:

    rule "Entkleide Startup"
       when 
           System started 
           or Item Entkleide_Profile_temp_hottt changed
       then 
           createTimer(now.plusSeconds(20)) [|
               /*logInfo("profiler_Entkleide", "aaaaaaa 1")*/
    
           /*if (Entkleide_Profile_temp_lo.state == NULL || */
           /*    Entkleide_Profile_temp_med.state == NULL || */
           /*    Entkleide_Profile_temp_high.state == NULL || */
           /*    Entkleide_Profile_temp_hottt.state == NULL) {*/
    
               /*logInfo("profiler", "lo:      " + Entkleide_Profile_temp_lo.state.toString)*/
               logInfo("profiler_Entkleide", "entkleideeeeeeeeeeeeeeeee")
               logInfo("profiler", "entkleide get_command_Args      " + homematic_profiler_get_command_Args.state.toString)
               try {
                   homematic_profiler_get_command_Args.sendCommand(" --get-all --device 1 ")
               }
               catch(Exception e) {
                   logError("Error", "Some bad stuff happened in my rule: " + e.getMessage)
               }
               finally {
                   // always runs even if there was an error, good place for cleanup
               }
               homematic_profiler_get_command.sendCommand(ON)
               var retry_counter = 0
    
               retry_counter = 0
    
               while((homematic_profiler_get_command_Out.state.toString == "" || 
                      homematic_profiler_get_command_Out.state.toString == "NULL") && 
                      retry_counter <= 3){
                   logInfo("profiler_Entkleide", "W:Entkleide:WAIT:  " + retry_counter.toString)
                   logInfo("profiler_Entkleide", "W:Entkleide:OUT: " + homematic_profiler_get_command_Out.state.toString)
                   logInfo("profiler_Entkleide", "W:Entkleide:ARGS:" + homematic_profiler_get_command_Args.state.toString)
                   homematic_profiler_get_command.sendCommand(ON)
                   Thread::sleep(1500)
                   retry_counter += 1
               }
               Entkleide_Profile_temp_lo.postUpdate   (transform("JSONPATH", "$.t_lo", homematic_profiler_get_command_Out.state.toString))
               Entkleide_Profile_temp_med.postUpdate  (transform("JSONPATH", "$.t_med", homematic_profiler_get_command_Out.state.toString))
               Entkleide_Profile_temp_high.postUpdate (transform("JSONPATH", "$.t_high", homematic_profiler_get_command_Out.state.toString))
               Entkleide_Profile_temp_hottt.postUpdate(transform("JSONPATH", "$.t_hottt", homematic_profiler_get_command_Out.state.toString))
    
               Entkleide_Profile_Mode_mon.postUpdate(transform("JSONPATH", "$.mon", homematic_profiler_get_command_Out.state.toString))
               Entkleide_Profile_Mode_tue.postUpdate(transform("JSONPATH", "$.tue", homematic_profiler_get_command_Out.state.toString))
               Entkleide_Profile_Mode_wed.postUpdate(transform("JSONPATH", "$.wed", homematic_profiler_get_command_Out.state.toString))
               Entkleide_Profile_Mode_thu.postUpdate(transform("JSONPATH", "$.thu", homematic_profiler_get_command_Out.state.toString))
               Entkleide_Profile_Mode_fri.postUpdate(transform("JSONPATH", "$.fri", homematic_profiler_get_command_Out.state.toString))
               Entkleide_Profile_Mode_sat.postUpdate(transform("JSONPATH", "$.sat", homematic_profiler_get_command_Out.state.toString))
               Entkleide_Profile_Mode_sun.postUpdate(transform("JSONPATH", "$.sun", homematic_profiler_get_command_Out.state.toString))
    
               /*logInfo("profiler_Entkleide", "lo:      " + Entkleide_Profile_temp_lo.state.toString)*/
               /*logInfo("profiler_Entkleide", "mon:     " + Entkleide_Profile_Mode_mon.state.toString)*/
           /*}*/
           ]
    end
    
  • If logs where generated please post these here using code fences:

      2018-10-25 20:25:59.748 [ERROR] [org.quartz.core.JobRunShell         ] - Job DEFAULT.2018-10-25T20:25:49.718+02:00: Pro
        <XFeatureCallImplCustom>.sendCommand(<XStringLiteralImpl>)
        <XFeatureCallImplCustom>.sendCommand(<XFeatureCallImplCustom>)
        var retry_counter
        <null>.retry_counter = <XNumberLiteralImpl>
        org.eclipse.xtext.xbase.impl.XWhileExpressionImpl@d3d215
        <XFeatureCallImplCustom>.postUpdate(<XFeatureCallImplCustom>)
        <XFeatureCallImplCustom>.postUpdate(<XFeatureCallImplCustom>)
        <XFeatureCallImplCustom>.postUpdate(<XFeatureCallImplCustom>)
        <XFeatureCallImplCustom>.postUpdate(<XFeatureCallImplCustom>)
        <XFeatureCallImplCustom>.postUpdate(<XFeatureCallImplCustom>)
        <XFeatureCallImplCustom>.postUpdate(<XFeatureCallImplCustom>)
        <XFeatureCallImplCustom>.postUpdate(<XFeatureCallImplCustom>)
        <XFeatureCallImplCustom>.postUpdate(<XFeatureCallImplCustom>)
        <XFeatureCallImplCustom>.postUpdate(<XFeatureCallImplCustom>)
        <XFeatureCallImplCustom>.postUpdate(<XFeatureCallImplCustom>)
        <XFeatureCallImplCustom>.postUpdate(<XFeatureCallImplCustom>)
      } ] threw an unhandled Exception: 
      java.lang.reflect.UndeclaredThrowableException: null
      	at com.sun.proxy.$Proxy152.apply(Unknown Source) [?:?]
      	at org.eclipse.smarthome.model.script.internal.actions.TimerExecutionJob.execute(TimerExecutionJob.java:49) [137:or
      	at org.quartz.core.JobRunShell.run(JobRunShell.java:202) [107:org.eclipse.smarthome.core.scheduler:0.10.0.oh230]
      	at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573) [107:org.eclipse.smarthome.core.sc
      Caused by: org.eclipse.smarthome.model.script.engine.ScriptExecutionException: The name 'homematic_profiler_get_command
      	at org.eclipse.smarthome.model.script.interpreter.ScriptInterpreter.invokeFeature(ScriptInterpreter.java:133) ~[?:?
      	at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter._doEvaluate(XbaseInterpreter.java:901) ~[?:?]
      	at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter._doEvaluate(XbaseInterpreter.java:864) ~[?:?]
      	at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter.doEvaluate(XbaseInterpreter.java:223) ~[?:?]
      	at org.eclipse.smarthome.model.script.interpreter.ScriptInterpreter.doEvaluate(ScriptInterpreter.java:219) ~[?:?]
      	at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter.internalEvaluate(XbaseInterpreter.java:203) ~[?:?]
      	at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter._doEvaluate(XbaseInterpreter.java:759) ~[?:?]
      	at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter.doEvaluate(XbaseInterpreter.java:219) ~[?:?]
      	at org.eclipse.smarthome.model.script.interpreter.ScriptInterpreter.doEvaluate(ScriptInterpreter.java:219) ~[?:?]
      	at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter.internalEvaluate(XbaseInterpreter.java:203) ~[?:?]
      	at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter._doEvaluate(XbaseInterpreter.java:446) ~[?:?]
      	at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter.doEvaluate(XbaseInterpreter.java:227) ~[?:?]
      	at org.eclipse.smarthome.model.script.interpreter.ScriptInterpreter.doEvaluate(ScriptInterpreter.java:219) ~[?:?]
      	at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter.internalEvaluate(XbaseInterpreter.java:203) ~[?:?]
      	at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter.evaluate(XbaseInterpreter.java:189) ~[?:?]
      	at org.eclipse.xtext.xbase.interpreter.impl.ClosureInvocationHandler.doInvoke(ClosureInvocationHandler.java:46) ~[?
      	at org.eclipse.xtext.xbase.interpreter.impl.AbstractClosureInvocationHandler.invoke(AbstractClosureInvocationHandle
      	... 4 more

Ok; this was apparantly a duplicate of this one:
Rule Error "null"
setting the delays on startup +100s seems to fix the problem.