I am running VScode on Windows 10, with OH2.4.0 running on a rPi3
When I am updating rule files (which do not show any errors and run fine), I get the error below.
I have no clue as to what it means.
Can it be switched off, as it pops up in the bottom of the screen reducing my editor window, which is more of a nuisance than help.
[Error - 10:41:40] Request textDocument/definition failed.
Message: Internal error.
Code: -32603
java.util.concurrent.CompletionException: java.lang.RuntimeException: Cannot create a resource for 'java:/Objects/org.eclipse.smarthome.model.script.actions.LogAction'; a registered resource factory is needed
at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:292)
at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:308)
at java.util.concurrent.CompletableFuture.uniAccept(CompletableFuture.java:647)
at java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:632)
at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:474)
at java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:1977)
at org.eclipse.xtext.ide.server.concurrent.ReadRequest.lambda$run$0(ReadRequest.java:43)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.RuntimeException: Cannot create a resource for 'java:/Objects/org.eclipse.smarthome.model.script.actions.LogAction'; a registered resource factory is needed
[edit] HAd a look at this [SOLVED] Item refreshes state very quickly but cannot see any relationship. It also happens with any rule file.
My rule files parse w/o errors.
logInfo("rule step", "... blah set to {}", blah.state)
or
logInfo("rule step", "... blah set to x")
A rule I use loggingâŠ
rule "Start Irrigation1"
when
// triggers to start this group; either auto (by cron) or manual
Item Irrigation1_Auto changed to ON or
Item Irrigation1_Now changed to ON
then
// only irrigate if allowed is ON
if (Irrigation1_Allowed.state == ON) {
// start up valve 1 of 4
logInfo("Irrigation1.10", "Irrigation1 started...")
// capture current meter (from last session) and store it in last session total
logInfo("Irrigation1.11a", "... PumpStation1_LastSessionTotal set to {}", PumpStation1_LastSessionTotal.state)
PumpStation1_LastSessionTotal.postUpdate(PumpStation1_LastSessionMemory.state)
logInfo("Irrigation1.11b", "... PumpStation1_LastSessionTotal set to {}", PumpStation1_LastSessionTotal.state)
// zero the last session memory and start at zero for this session
logInfo("Irrigation1.11c", "... PumpStation1_LastSessionMemory -> to {}", PumpStation1_LastSessionMemory.state)
PumpStation1_LastSessionMemory.postUpdate(0)
logInfo("Irrigation1.11d", "... PumpStation1_LastSessionMemory -> to {}", PumpStation1_LastSessionMemory.state)
// ----- reset meter to 0 for good...
// reset the controller's meter to 0
publish("mymosquitto", "ArgyleCourt/Property/PumpStation1/Command", "resetMeter")
publish("mymosquitto", "ArgyleCourt/Property/PumpStation1/Meter", "0")
// we now have to update this value as well, because the controller does
// not publish back the forced change to 0
PumpStation1_Meter.postUpdate(0)
// reset the session volume counter to zero
logInfo("Irrigation1.13b", "... PumpStation1_Meter .......... set to 0 -> {}", PumpStation1_Meter.state)
logInfo("Irrigation1.14a", "... PumpStation1 VolumeSession .. set to {}", PumpStation1_MemoriseMeterRead)
PumpStation1_MemoriseMeterRead = (PumpStation1_Meter.state as Number).intValue
logInfo("Irrigation1.14", "... PumpStation1 VolumeSession ... set to 0; is it? -> {}", PumpStation1_MemoriseMeterRead)
// update 'curr'ent valve name; which is #1
Irrigation1_Curr.sendCommand(Irrigation1_1.name)
// now switch valve 1 ON
Irrigation1_1.sendCommand(ON)
logInfo("Irrigation1.15", "..> turning ............................ Irrigation1_1 ON")
} else {
logInfo("Irrigation1.16", "Irrigation1 not started -> not allowed!")
Irrigation1_Reset.postUpdate(ON)
}
end
What Iâm trying to say is this is a VSCode problem, not your running openHAB. VSCode is trying to create or access some log file - Iâll have a guess VSC has tried to execute your rule locally due to some debug setting, and/or itâs trying to access a remote logfile.
I donât know how any of this stuff works. I do not have an âopenHAB serverâ option in the dropdown selector for my debug âoutputâ tab. To the right of that is a âclearâ button, but I guess the message comes back?
I seem to have missed that las post, so i will give a really late answer.
Nope.
VsCode (or at least the openHAB extension) doesnât execute/debug rules.
It also doesnât access log files in the background.
The openHAB server Output Tab is generated from the remote LSP server connection.
If remote LSP is disabled, the corresponding Output tab isnât activated.
So here are the short facts:
The error message is generated from remote lsp server in your openHAB environment.
It then gets delivered via lsp conenction into the remote lsp client module
The remote lsp client itself then adds this message to the openHAB server output.
So the error is somehow thrown while checking the rule via lsp. @wborn you have something with lsp a while ago.
Maybe you have an idea about this error and how we can dig into solving it or whats the server side cause for throwing it.