Webcore code error

@nh.schottfam
I have been chasing the delay error in the logs on my virtual switches for a while. It doesn't seem to affect anything but I don't like log errors :wink:
ā•‘ Piston waited for semaphore 61ms

I have updated to your new code a few days ago as I was getting this message:
ā•‘ WARNING: Results may be unreliable because the parent app's version(v0.3.113.20211005_HE) is newer than the child app's version(v0.3.113.20210703_HE). Please update both apps to the same version.

I was fiddling with one of these pistons and changed one line to "Rises Above" trigger instead of an "Is Greater Than" condition.

Now I get this Webcore scary error.
An error occurred while executing the event: org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object '0' with class 'java.lang.Integer' to class 'java.util.List'

And this big spew in the logs :slight_smile: app:552021-10-24 14:16:18.094 errorwebCoRE exception: org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object '0' with class 'java.lang.Integer' to class 'java.util.List' on line 4953 org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object '0' with class 'java.lang.Integer' to class 'java.util.List' at user_app_ady624_webCoRE_Piston_74.evaluateConditions(user_app_ady624_webCoRE_Piston_74.groovy:4953) at user_app_ady624_webCoRE_Piston_74.evaluateCondition(user_app_ady624_webCoRE_Piston_74.groovy:5139) at user_app_ady624_webCoRE_Piston_74.evaluateConditions(user_app_ady624_webCoRE_Piston_74.groovy:4931) at user_app_ady624_webCoRE_Piston_74.executeStatement(user_app_ady624_webCoRE_Piston_74.groovy:2603) at user_app_ady624_webCoRE_Piston_74.executeStatements(user_app_ady624_webCoRE_Piston_74.groovy:2530) at user_app_ady624_webCoRE_Piston_74.executeStatements(user_app_ady624_webCoRE_Piston_74.groovy) at user_app_ady624_webCoRE_Piston_74.executeEvent(user_app_ady624_webCoRE_Piston_74.groovy:2224) at user_app_ady624_webCoRE_Piston_74.subscribeAll(user_app_ady624_webCoRE_Piston_74.groovy:6185) at user_app_ady624_webCoRE_Piston_74.getRunTimeData(user_app_ady624_webCoRE_Piston_74.groovy:1660) at user_app_ady624_webCoRE_Piston_74.resume(user_app_ady624_webCoRE_Piston_74.groovy:1055) at user_app_ady624_webCoRE_Piston_74.setup(user_app_ady624_webCoRE_Piston_74.groovy:810) at user_app_ady624_webCoRE_73.api_intf_dashboard_piston_set_save(user_app_ady624_webCoRE_73.groovy:1453) at user_app_ady624_webCoRE_73.api_intf_dashboard_piston_set_end(user_app_ady624_webCoRE_73.groovy:1567)

app:552021-10-24 14:16:18.023 errorā–‘ā•‘ An error occurred while executing the event:org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object '0' with class 'java.lang.Integer' to class 'java.util.List'

Help me Obi Wan.
PS I put the code back to the origianl and I got the same dump.

Piston example is below

So make sure you are on latest webcore (easier for me to debug and match line numbers.

It is a good idea that you are on recent HE firmware....

Then try again, and post result (when posting logs, many times screen capture the logs is easier to read.

1 Like

I want to find the the exception error...

Also in general, nesting changes statements means sometimes they get checked and other times they don't. This is not good as webcore is then not always checking them.

Usually this means you want these to always run. The structure becomes
if xxx changes set variable aaa=true
if yyy changes set variable bbb = true

and you ensure these statements run every time the piston runs (so don't nest them into things that may not run every time). (so you may not want the 'only when' blocking running when using changes in the mainline.)

if aaa then...

Also note, two things cannot change at the same time...ie typically each change is an event, and not at the same time. So your logic should not depend on two things changing at the same time, as it 'will not happen' that way.

Folks in the webcore forum can help with these logic issues. again I want to see the details on the exception on current release...

Yes, I know what I was doing was "bad form", thanks.
I just didn't expect the errors while I was playing around.

I am current on everything.
I'll put the code back to the bad practice trigger lines and see if I get the same logs.
I'll do a screen capture at that point if it's easier for you to read.

This issue is fixed in webcore

Please HPM repair to get the latest.

Let me know if you have another issue.