SerializationException caused by PMIButton in HashMap during open a window (Ignition 8.0.10)

Hello everyone,

I'm experiencing a serialization error in one of my projects and I'm trying to understand the root cause.

Error invoking [HashMap]{PMIButton: Button=[com.inductiveautomation.factorypmi.application.binding.action.ActionAdapter@30768c29]}.put(PMIButton: Button)

SerializationException: Error invoking [HashMap]{PMIButton: Button=[com.inductiveautomation.factorypmi.application.binding.action.ActionAdapter@30768c29]}.put(PMIButton: Button)
caused by IllegalArgumentException

Ignition v8.0.10 (b2020031912)
Java: Azul Systems, Inc. 11.0.6

The exception appears to be related to a PMIButton component and an associated ActionAdapter object being serialized inside a HashMap.

It happens when I try to open a window. I can't control any of the buttons inside because I can't see them. If I download the project, everything works.

At the moment I only have the exception shown above, but I can provide additional stack trace details if needed.

Any suggestions or pointers would be greatly appreciated.

Thanks!

v8.0.10 is incredibly old and many hundreds (thousands?) of bugs have since been fixed. If you cannot upgrade to current, at least upgrade to the last of the 8.0.x series.

In the meantime, instead of opening the window, shift-right-click on the window in the designer tree and choose to copy the XML. Put into your favorite external code editor and study the cryptic format. You may be able to surgically alter it to avoid this.

The full stacktrace might help either identify the bug if it's already fixed or at least guide you towards what's wrong.

This is the error that appears in the console when I try to open the window :

13:02:59.337 \[AWT-EventQueue-0\] ERROR com.inductiveautomation.ignition.client.util.gui.ErrorUtil -- null
com.inductiveautomation.ignition.common.xmlserialization.SerializationException: Error invoking \[HashMap\]{PMIButton: Button=\[com.inductiveautomation.factorypmi.application.binding.action.ActionAdapter@31912c64\]}.put(PMIButton: Button)
at com.inductiveautomation.ignition.common.xmlserialization.deserialization.handlers.ObjectDeserializationHandler.endSubElement(ObjectDeserializationHandler.java:82)
at com.inductiveautomation.ignition.common.xmlserialization.deserialization.XMLDeserializer$ParseContext.onElementEnd(XMLDeserializer.java:934)
at com.inductiveautomation.ignition.common.xmlserialization.deserialization.XMLParser.endElement(XMLParser.java:96)
at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(Unknown Source)
at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source)
at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at java.xml/com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
at java.xml/com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at com.inductiveautomation.ignition.common.xmlserialization.deserialization.XMLDeserializer.deserializeXML(XMLDeserializer.java:404)
at com.inductiveautomation.ignition.common.xmlserialization.deserialization.XMLDeserializer.deserialize(XMLDeserializer.java:281)
at com.inductiveautomation.factorypmi.application.model.WindowCache.\_deserializeWindow(WindowCache.java:387)
at com.inductiveautomation.factorypmi.application.model.WindowCache.\_loadWindow(WindowCache.java:330)
at com.inductiveautomation.factorypmi.application.model.WindowCache.openWindow(WindowCache.java:304)
at com.inductiveautomation.factorypmi.designer.workspace.WindowWorkspace$DesigntimeWindowOpener.openWindow(WindowWorkspace.java:3867)
at com.inductiveautomation.factorypmi.designer.workspace.WindowWorkspace.openWindow(WindowWorkspace.java:1528)
at com.inductiveautomation.factorypmi.designer.model.navtree.WindowNode.open(WindowNode.java:260)
at com.inductiveautomation.ignition.designer.navtree.model.AbstractResourceNavTreeNode.onDoubleClick(AbstractResourceNavTreeNode.java:428)
at java.desktop/java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
at java.base/java.security.AccessController.doPrivileged(Unknown Source)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.desktop/java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.lang.IllegalArgumentException: null
at java.base/jdk.internal.reflect.GeneratedMethodAccessor11.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at com.inductiveautomation.ignition.common.xmlserialization.deserialization.handlers.ObjectDeserializationHandler.endSubElement(ObjectDeserializationHandler.java:69)
... 34 common frames omitted
13:02:59.404 \[AWT-EventQueue-0\] ERROR Vision.InteractionController -- Invalid Action Adapter found on Button 1. Removing.
Exception in thread "AWT-EventQueue-0" java.lang.ArrayStoreException: java.lang.String
at java.base/java.util.AbstractCollection.toArray(Unknown Source)
at com.inductiveautomation.factorypmi.application.binding.util.DynamicPropertyUtil.getProperties(DynamicPropertyUtil.java:52)
at com.inductiveautomation.vision.api.client.components.model.AbstractVisionPanel.getProperties(AbstractVisionPanel.java:180)
at com.inductiveautomation.factorypmi.application.components.util.ComponentVisitor$UDTInitVisitor.initialize(ComponentVisitor.java:122)
at com.inductiveautomation.factorypmi.application.components.util.ComponentVisitor$UDTInitVisitor.visit(ComponentVisitor.java:116)
at com.inductiveautomation.factorypmi.application.components.util.ComponentVisitor.walk(ComponentVisitor.java:82)
at com.inductiveautomation.factorypmi.application.components.util.ComponentVisitor.walk(ComponentVisitor.java:92)
at com.inductiveautomation.factorypmi.application.components.util.ComponentVisitor.walk(ComponentVisitor.java:73)
at com.inductiveautomation.factorypmi.application.FPMIWindow.initializeUIRoot(FPMIWindow.java:336)
at com.inductiveautomation.factorypmi.application.FPMIWindow.initialize(FPMIWindow.java:284)
at com.inductiveautomation.factorypmi.designer.workspace.WindowWorkspace$DesigntimeWindowOpener.openWindow(WindowWorkspace.java:3874)
at com.inductiveautomation.factorypmi.designer.workspace.WindowWorkspace.openWindow(WindowWorkspace.java:1528)
at com.inductiveautomation.factorypmi.designer.model.navtree.WindowNode.open(WindowNode.java:260)
at com.inductiveautomation.ignition.designer.navtree.model.AbstractResourceNavTreeNode.onDoubleClick(AbstractResourceNavTreeNode.java:428)
at java.desktop/java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
at java.base/java.security.AccessController.doPrivileged(Unknown Source)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.desktop/java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.run(Unknown Source)

This first error:

ERROR com.inductiveautomation.ignition.client.util.gui.ErrorUtil -- null
com.inductiveautomation.ignition.common.xmlserialization.SerializationException: Error invoking \[HashMap\]{PMIButton: Button=\[com.inductiveautomation.factorypmi.application.binding.action.ActionAdapter@31912c64\]}.put(PMIButton: Button)
at com.inductiveautomation.ignition.common.xmlserialization.deserialization.handlers.ObjectDeserializationHandler.endSubElement(ObjectDeserializationHandler.java:82)
at com.inductiveautomation.ignition.common.xmlserialization.deserialization.XMLDeserializer$ParseContext.onElementEnd(XMLDeserializer.java:934)
at com.inductiveautomation.ignition.common.xmlserialization.deserialization.XMLParser.endElement(XMLParser.java:96)

Caused by: java.lang.IllegalArgumentException: null
at java.base/jdk.internal.reflect.GeneratedMethodAccessor11.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)

Is saying that we during deserialization of the window, we're creating a HashMap object, which at the time of logging contains a single mapping, from button to an ActionAdapter (binding) instance (that's this part: {PMIButton: Button=\[com.inductiveautomation.factorypmi.application.binding.action.ActionAdapter@31912c64\]}).
We're calling the put method on it, which is just the general 'add something to a map' method; specifically, we're trying to add another (the same?) button to it.
When we do that, Java's reflective invocation machinery is giving us the IllegalArgumentException. Per its own Javadoc:

IllegalArgumentException – if the method is an instance method and the specified object argument is not an instance of the class or interface declaring the underlying method (or of a subclass or implementor thereof); if the number of actual and formal parameters differ; if an unwrapping conversion for primitive arguments fails; or if, after possible unwrapping, a parameter value cannot be converted to the corresponding formal parameter type by a method invocation conversion

Which doesn't really help much.

The second error:

13:02:59.404 \[AWT-EventQueue-0\] ERROR Vision.InteractionController -- Invalid Action Adapter found on Button 1. Removing.
Exception in thread "AWT-EventQueue-0" java.lang.ArrayStoreException: java.lang.String
at java.base/java.util.AbstractCollection.toArray(Unknown Source)
at com.inductiveautomation.factorypmi.application.binding.util.DynamicPropertyUtil.getProperties(DynamicPropertyUtil.java:52)
at com.inductiveautomation.vision.api.client.components.model.AbstractVisionPanel.getProperties(AbstractVisionPanel.java:180)
at com.inductiveautomation.factorypmi.application.components.util.ComponentVisitor$UDTInitVisitor.initialize(ComponentVisitor.java:122)
at com.inductiveautomation.factorypmi.application.components.util.ComponentVisitor$UDTInitVisitor.visit(ComponentVisitor.java:116)

Indicates that in Button 1's custom properties map, somehow you've got a plain string instead of a proper DynamicPropertyDescriptor. Doesn't match any bug in our internal tracker, so either you've done something novel with scripting or you've managed something we've never come across before.


I would do what Phil said - update to at least the latest 8.0, prepare to upgrade to 8.1 or 8.3 as soon as possible, and be prepared to lose whatever was on this window.