Greetings, I hope this info keeps someone from pulling their hair out. Too late for me…
Most have seen the 'Cannot coerce value" error, and it’s usually the result of something we’ve done. I’m not sure this falls into that category. I have a bunch of windows that are very similar… same components, same templates, etc. After creating the latest ‘clone’ the following error popped up on a few templates… actually, 22 errors on 3 distinct templates. And these templates are being used on dozens of other screens without error. These errors would only happen a single time when opening the screen, in both the designer and client. After the initial opening, no more errors and the screen performed as expected.
java.lang.ClassCastException: Cannot coerce value 'java.lang.Object@7840452c' into type: class java.lang.Boolean
at com.inductiveautomation.ignition.common.TypeUtilities.coerce(TypeUtilities.java:1292)
at com.inductiveautomation.factorypmi.application.binding.DynamicPropertyDescriptor.setValue(DynamicPropertyDescriptor.java:59)
at com.inductiveautomation.factorypmi.application.binding.util.DynamicPropertyUtil.setPropertyValue(DynamicPropertyUtil.java:260)
at com.inductiveautomation.vision.api.client.components.model.AbstractVisionPanel.setPropertyValue(AbstractVisionPanel.java:164)
at com.inductiveautomation.factorypmi.application.components.template.TemplateHolder.startupTemplate(TemplateHolder.java:396)
at com.inductiveautomation.factorypmi.application.components.template.TemplateHolder.onStartup(TemplateHolder.java:517)
at com.inductiveautomation.vision.api.client.components.model.AbstractVisionPanel.startupComponent(AbstractVisionPanel.java:208)
at com.inductiveautomation.factorypmi.application.components.util.ComponentVisitor$StartupVisitor.visit(ComponentVisitor.java:322)
at com.inductiveautomation.factorypmi.application.components.util.ComponentVisitor.walk(ComponentVisitor.java:91)
at com.inductiveautomation.factorypmi.application.components.util.ComponentVisitor.walk(ComponentVisitor.java:69)
at com.inductiveautomation.factorypmi.application.FPMIWindow.startup(FPMIWindow.java:357)
at com.inductiveautomation.factorypmi.designer.workspace.WindowWorkspace$DesigntimeWindowOpener.openWindow(WindowWorkspace.java:3554)
at com.inductiveautomation.factorypmi.designer.workspace.WindowWorkspace.openWindow(WindowWorkspace.java:1322)
at com.inductiveautomation.factorypmi.designer.model.navtree.WindowNode.onDoubleClick(WindowNode.java:269)
at com.inductiveautomation.ignition.designer.navtree.NavTreePanel$MouseListener$1.run(NavTreePanel.java:719)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$500(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Ignition v7.9.7 (b2018032914)
Java: Oracle Corporation 1.8.0_171
I searched the forum, but nothing was popping up that was similar to “java.lang.Object@”. So I toiled for quite a while trying to find a cause… without success. Ugh…
Finally, I duplicated the screen, deleted the old, and renamed the duplicated screen to the old deleted screen. Now when opening the new screen, the errors went from 22 to 9. (?) Now, only two templates were throwing an error, but further duplication did not resolve the lingering issues. I ultimately had to go to a screen with the same templates, copy/paste them, copy the bindings to them, then delete the ‘bad’ templates. This completely resolved the issue. Funny thing is… these templates were originally copied/pasted from other screens to make the ‘bad’ one.
Perhaps someone can decipher the error message to target the cause, but, I’m not that someone.
As you were…
Steve
Ignition 7.9.7
Java 1.8.0_171-b11