Paintable Canvas Component

I have had a situation where I was unable to save the project when the paintable canvas component I was working on is still selected (meaning, the resize handles are still visible). When I do a “save”, it returns an error and discards all of my prior changes. I’ve found that if I focus on something else, it works fine.

Here is the text from the most recent message:

com.inductiveautomation.factorypmi.common.xmlserialization.SerializationException: Error during serialization for property ‘propertyAdapters’ on object ‘[FPMIWindow]Pump’
at com.inductiveautomation.factorypmi.common.xmlserialization.serialization.DefaultObjectSerializationDelegate.serializeProperties(DefaultObjectSerializationDelegate.java:278)
at com.inductiveautomation.factorypmi.common.xmlserialization.serialization.delegates.WindowDelegate.serializeProperties(WindowDelegate.java:37)
at com.inductiveautomation.factorypmi.common.xmlserialization.serialization.delegates.WindowDelegate.serialize(WindowDelegate.java:29)
at com.inductiveautomation.factorypmi.common.xmlserialization.serialization.XMLSerializationContext.serialize(XMLSerializationContext.java:123)
at com.inductiveautomation.factorypmi.common.xmlserialization.serialization.XMLSerializer.serialize(XMLSerializer.java:262)
at com.inductiveautomation.factorypmi.designer.model.ObjectHolder.saveWindow(ObjectHolder.java:1797)
at com.inductiveautomation.factorypmi.designer.model.ObjectHolder.windowClosed(ObjectHolder.java:1402)
at com.inductiveautomation.factorypmi.application.FPMIApp.fireWindowEvent(FPMIApp.java:960)
at com.inductiveautomation.factorypmi.application.FPMIApp$InternalFrameEventRelay.internalFrameClosed(FPMIApp.java:1015)
at javax.swing.JInternalFrame.fireInternalFrameEvent(Unknown Source)
at javax.swing.JInternalFrame.dispose(Unknown Source)
at javax.swing.JInternalFrame.doDefaultCloseAction(Unknown Source)
at com.inductiveautomation.factorypmi.designer.model.ObjectHolder.save(ObjectHolder.java:2025)
at com.inductiveautomation.factorypmi.designer.FPMIDesigner$Handler.handleSave(FPMIDesigner.java:1070)
at com.inductiveautomation.factorypmi.designer.FPMIDesigner$Handler.actionPerformed(FPMIDesigner.java:826)
at com.inductiveautomation.factorypmi.designer.util.swing.action.DelegateAction.actionPerformed(DelegateAction.java:79)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.AbstractButton.doClick(Unknown Source)
at javax.swing.AbstractButton.doClick(Unknown Source)
at javax.swing.plaf.basic.BasicMenuItemUI$Actions.actionPerformed(Unknown Source)
at javax.swing.SwingUtilities.notifyAction(Unknown Source)
at javax.swing.JComponent.processKeyBinding(Unknown Source)
at javax.swing.JMenuBar.processBindingForKeyStrokeRecursive(Unknown Source)
at javax.swing.JMenuBar.processBindingForKeyStrokeRecursive(Unknown Source)
at javax.swing.JMenuBar.processBindingForKeyStrokeRecursive(Unknown Source)
at javax.swing.JMenuBar.processKeyBinding(Unknown Source)
at javax.swing.KeyboardManager.fireBinding(Unknown Source)
at javax.swing.KeyboardManager.fireKeyboardAction(Unknown Source)
at javax.swing.JComponent.processKeyBindingsForAllComponents(Unknown Source)
at javax.swing.JComponent.processKeyBindings(Unknown Source)
at javax.swing.JComponent.processKeyEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(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)
Caused by: com.inductiveautomation.factorypmi.common.xmlserialization.SerializationException: Error during serialization for property ‘component’ on object ‘[PropertyKey]Root Container.background’
at com.inductiveautomation.factorypmi.common.xmlserialization.serialization.DefaultObjectSerializationDelegate.serializeProperties(DefaultObjectSerializationDelegate.java:278)
at com.inductiveautomation.factorypmi.common.xmlserialization.serialization.DefaultObjectSerializationDelegate.serialize(DefaultObjectSerializationDelegate.java:299)
at com.inductiveautomation.factorypmi.common.xmlserialization.serialization.XMLSerializationContext.serialize(XMLSerializationContext.java:123)
at com.inductiveautomation.factorypmi.common.xmlserialization.serialization.DefaultObjectSerializationDelegate.writeCall(DefaultObjectSerializationDelegate.java:202)
at com.inductiveautomation.factorypmi.common.xmlserialization.serialization.DefaultObjectSerializationDelegate.writeCall(DefaultObjectSerializationDelegate.java:191)
at com.inductiveautomation.factorypmi.common.xmlserialization.serialization.delegates.MapDelegate.serializeElements(MapDelegate.java:42)
at com.inductiveautomation.factorypmi.common.xmlserialization.serialization.delegates.MapDelegate.serialize(MapDelegate.java:32)
at com.inductiveautomation.factorypmi.common.xmlserialization.serialization.XMLSerializationContext.serialize(XMLSerializationContext.java:123)
at com.inductiveautomation.factorypmi.common.xmlserialization.serialization.DefaultObjectSerializationDelegate.writeCall(DefaultObjectSerializationDelegate.java:202)
at com.inductiveautomation.factorypmi.common.xmlserialization.serialization.DefaultObjectSerializationDelegate.writeCall(DefaultObjectSerializationDelegate.java:191)
at com.inductiveautomation.factorypmi.common.xmlserialization.serialization.DefaultObjectSerializationDelegate.doProperty(DefaultObjectSerializationDelegate.java:249)
at com.inductiveautomation.factorypmi.common.xmlserialization.serialization.DefaultObjectSerializationDelegate.serializeProperties(DefaultObjectSerializationDelegate.java:276)
… 54 more
Caused by: com.inductiveautomation.factorypmi.common.xmlserialization.SerializationException: Error during serialization for property ‘border’ on object ‘[PMINumericTextField]PMINumericTextField[Numeric Text Field]’
at com.inductiveautomation.factorypmi.common.xmlserialization.serialization.DefaultObjectSerializationDelegate.serializeProperties(DefaultObjectSerializationDelegate.java:278)
at com.inductiveautomation.factorypmi.common.xmlserialization.serialization.delegates.DefaultComponentDelegate.serializeProperties(DefaultComponentDelegate.java:79)
at com.inductiveautomation.factorypmi.common.xmlserialization.serialization.DefaultObjectSerializationDelegate.serialize(DefaultObjectSerializationDelegate.java:299)
at com.inductiveautomation.factorypmi.common.xmlserialization.serialization.XMLSerializationContext.serialize(XMLSerializationContext.java:123)
at com.inductiveautomation.factorypmi.common.xmlserialization.serialization.DefaultObjectSerializationDelegate.writeCall(DefaultObjectSerializationDelegate.java:202)
at com.inductiveautomation.factorypmi.common.xmlserialization.serialization.delegates.BasicContainerDelegate.serializeProperties(BasicContainerDelegate.java:101)
at com.inductiveautomation.factorypmi.common.xmlserialization.serialization.delegates.BasicContainerDelegate.serialize(BasicContainerDelegate.java:35)
at com.inductiveautomation.factorypmi.common.xmlserialization.serialization.XMLSerializationContext.serialize(XMLSerializationContext.java:123)
at com.inductiveautomation.factorypmi.common.xmlserialization.serialization.DefaultObjectSerializationDelegate.writeCall(DefaultObjectSerializationDelegate.java:202)
at com.inductiveautomation.factorypmi.common.xmlserialization.serialization.DefaultObjectSerializationDelegate.writeCall(DefaultObjectSerializationDelegate.java:191)
at com.inductiveautomation.factorypmi.common.xmlserialization.serialization.DefaultObjectSerializationDelegate.doProperty(DefaultObjectSerializationDelegate.java:249)
at com.inductiveautomation.factorypmi.common.xmlserialization.serialization.DefaultObjectSerializationDelegate.serializeProperties(DefaultObjectSerializationDelegate.java:276)
… 65 more
Caused by: com.inductiveautomation.factorypmi.common.xmlserialization.SerializationException: Unable to create clean copy of class com.incors.plaf.alloy.da
at com.inductiveautomation.factorypmi.common.xmlserialization.serialization.XMLSerializer.getCleanCopy(XMLSerializer.java:372)
at com.inductiveautomation.factorypmi.common.xmlserialization.serialization.XMLSerializationContext.getCleanCopy(XMLSerializationContext.java:144)
at com.inductiveautomation.factorypmi.common.xmlserialization.serialization.DefaultObjectSerializationDelegate.serializeProperties(DefaultObjectSerializationDelegate.java:267)
at com.inductiveautomation.factorypmi.common.xmlserialization.serialization.DefaultObjectSerializationDelegate.serialize(DefaultObjectSerializationDelegate.java:299)
at com.inductiveautomation.factorypmi.common.xmlserialization.serialization.XMLSerializationContext.serialize(XMLSerializationContext.java:123)
at com.inductiveautomation.factorypmi.common.xmlserialization.serialization.DefaultObjectSerializationDelegate.writeConstructor(DefaultObjectSerializationDelegate.java:345)
at com.inductiveautomation.factorypmi.common.xmlserialization.serialization.DefaultObjectSerializationDelegate.serializeConstructor(DefaultObjectSerializationDelegate.java:336)
at com.inductiveautomation.factorypmi.common.xmlserialization.serialization.DefaultObjectSerializationDelegate.serialize(DefaultObjectSerializationDelegate.java:295)
at com.inductiveautomation.factorypmi.common.xmlserialization.serialization.XMLSerializationContext.serialize(XMLSerializationContext.java:123)
at com.inductiveautomation.factorypmi.common.xmlserialization.serialization.DefaultObjectSerializationDelegate.writeCall(DefaultObjectSerializationDelegate.java:202)
at com.inductiveautomation.factorypmi.common.xmlserialization.serialization.DefaultObjectSerializationDelegate.writeCall(DefaultObjectSerializationDelegate.java:191)
at com.inductiveautomation.factorypmi.common.xmlserialization.serialization.DefaultObjectSerializationDelegate.doProperty(DefaultObjectSerializationDelegate.java:249)
at com.inductiveautomation.factorypmi.common.xmlserialization.serialization.DefaultObjectSerializationDelegate.serializeProperties(DefaultObjectSerializationDelegate.java:276)
… 76 more

I think that this was fixed in version 3.2.4 See changelog entry:

	o Fixed: Bug involving serialization of component borders that had to do with focus coming out of preview mode.

Freakin’ hey, I’m having a bad day today. I haven’t had a problem with this since last year when I posted this, and now it’s happening again. I just recently updated to V3.3.3. Is it possible that the fix was dropped in that version?

edit: The error doesn’t seem to have anything to do with the Paint Component this time, but I can’t tell what’s causing it. Can you tell?

com.inductiveautomation.factorypmi.common.xmlserialization.SerializationException: Error during serialization for property 'propertyAdapters' on object '[FPMIWindow]View Module (closed)'
	at com.inductiveautomation.factorypmi.common.xmlserialization.serialization.DefaultObjectSerializationDelegate.serializeProperties(DefaultObjectSerializationDelegate.java:278)
	at com.inductiveautomation.factorypmi.common.xmlserialization.serialization.delegates.WindowDelegate.serializeProperties(WindowDelegate.java:37)
	at com.inductiveautomation.factorypmi.common.xmlserialization.serialization.delegates.WindowDelegate.serialize(WindowDelegate.java:29)
	at com.inductiveautomation.factorypmi.common.xmlserialization.serialization.XMLSerializationContext.serialize(XMLSerializationContext.java:123)
	at com.inductiveautomation.factorypmi.common.xmlserialization.serialization.XMLSerializer.serialize(XMLSerializer.java:274)
	at com.inductiveautomation.factorypmi.designer.model.ObjectHolder.saveWindow(ObjectHolder.java:1787)
	at com.inductiveautomation.factorypmi.designer.model.ObjectHolder.windowClosed(ObjectHolder.java:1405)
	at com.inductiveautomation.factorypmi.application.FPMIApp.fireWindowEvent(FPMIApp.java:993)
	at com.inductiveautomation.factorypmi.application.FPMIApp$InternalFrameEventRelay.internalFrameClosed(FPMIApp.java:1050)
	at javax.swing.JInternalFrame.fireInternalFrameEvent(Unknown Source)
	at javax.swing.JInternalFrame.dispose(Unknown Source)
	at javax.swing.JInternalFrame.doDefaultCloseAction(Unknown Source)
	at com.inductiveautomation.factorypmi.designer.model.ObjectHolder.save(ObjectHolder.java:2015)
	at com.inductiveautomation.factorypmi.designer.FPMIDesigner$Handler.handleSave(FPMIDesigner.java:1139)
	at com.inductiveautomation.factorypmi.designer.FPMIDesigner$Handler.actionPerformed(FPMIDesigner.java:885)
	at com.inductiveautomation.factorypmi.designer.util.swing.action.DelegateAction.actionPerformed(DelegateAction.java:78)
	at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
	at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
	at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
	at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
	at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
	at com.jidesoft.plaf.basic.BasicJideButtonListener.mouseReleased(Unknown Source)
	at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
	at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
	at java.awt.Component.processMouseEvent(Unknown Source)
	at javax.swing.JComponent.processMouseEvent(Unknown Source)
	at java.awt.Component.processEvent(Unknown Source)
	at java.awt.Container.processEvent(Unknown Source)
	at java.awt.Component.dispatchEventImpl(Unknown Source)
	at java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.awt.Component.dispatchEvent(Unknown Source)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
	at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
	at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
	at java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.awt.Window.dispatchEventImpl(Unknown Source)
	at java.awt.Component.dispatchEvent(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)
Caused by: com.inductiveautomation.factorypmi.common.xmlserialization.SerializationException: Error during serialization for property 'component' on object '[PropertyKey]Label 2.text'
	at com.inductiveautomation.factorypmi.common.xmlserialization.serialization.DefaultObjectSerializationDelegate.serializeProperties(DefaultObjectSerializationDelegate.java:278)
	at com.inductiveautomation.factorypmi.common.xmlserialization.serialization.DefaultObjectSerializationDelegate.serialize(DefaultObjectSerializationDelegate.java:299)
	at com.inductiveautomation.factorypmi.common.xmlserialization.serialization.XMLSerializationContext.serialize(XMLSerializationContext.java:123)
	at com.inductiveautomation.factorypmi.common.xmlserialization.serialization.DefaultObjectSerializationDelegate.writeCall(DefaultObjectSerializationDelegate.java:202)
	at com.inductiveautomation.factorypmi.common.xmlserialization.serialization.DefaultObjectSerializationDelegate.writeCall(DefaultObjectSerializationDelegate.java:191)
	at com.inductiveautomation.factorypmi.common.xmlserialization.serialization.delegates.MapDelegate.serializeElements(MapDelegate.java:42)
	at com.inductiveautomation.factorypmi.common.xmlserialization.serialization.delegates.MapDelegate.serialize(MapDelegate.java:32)
	at com.inductiveautomation.factorypmi.common.xmlserialization.serialization.XMLSerializationContext.serialize(XMLSerializationContext.java:123)
	at com.inductiveautomation.factorypmi.common.xmlserialization.serialization.DefaultObjectSerializationDelegate.writeCall(DefaultObjectSerializationDelegate.java:202)
	at com.inductiveautomation.factorypmi.common.xmlserialization.serialization.DefaultObjectSerializationDelegate.writeCall(DefaultObjectSerializationDelegate.java:191)
	at com.inductiveautomation.factorypmi.common.xmlserialization.serialization.DefaultObjectSerializationDelegate.doProperty(DefaultObjectSerializationDelegate.java:249)
	at com.inductiveautomation.factorypmi.common.xmlserialization.serialization.DefaultObjectSerializationDelegate.serializeProperties(DefaultObjectSerializationDelegate.java:276)
	... 43 more
Caused by: com.inductiveautomation.factorypmi.common.xmlserialization.SerializationException: Error during serialization for property 'cursor' on object '[PMILabel]Label 2'
	at com.inductiveautomation.factorypmi.common.xmlserialization.serialization.DefaultObjectSerializationDelegate.serializeProperties(DefaultObjectSerializationDelegate.java:278)
	at com.inductiveautomation.factorypmi.common.xmlserialization.serialization.delegates.DefaultComponentDelegate.serializeProperties(DefaultComponentDelegate.java:80)
	at com.inductiveautomation.factorypmi.common.xmlserialization.serialization.DefaultObjectSerializationDelegate.serialize(DefaultObjectSerializationDelegate.java:299)
	at com.inductiveautomation.factorypmi.common.xmlserialization.serialization.XMLSerializationContext.serialize(XMLSerializationContext.java:123)
	at com.inductiveautomation.factorypmi.common.xmlserialization.serialization.DefaultObjectSerializationDelegate.writeCall(DefaultObjectSerializationDelegate.java:202)
	at com.inductiveautomation.factorypmi.common.xmlserialization.serialization.DefaultObjectSerializationDelegate.writeCall(DefaultObjectSerializationDelegate.java:191)
	at com.inductiveautomation.factorypmi.common.xmlserialization.serialization.DefaultObjectSerializationDelegate.doProperty(DefaultObjectSerializationDelegate.java:249)
	at com.inductiveautomation.factorypmi.common.xmlserialization.serialization.DefaultObjectSerializationDelegate.serializeProperties(DefaultObjectSerializationDelegate.java:276)
	... 54 more
Caused by: com.inductiveautomation.factorypmi.common.xmlserialization.SerializationException: Unable to create clean copy of class sun.awt.windows.WCustomCursor
	at com.inductiveautomation.factorypmi.common.xmlserialization.serialization.XMLSerializer.getCleanCopy(XMLSerializer.java:386)
	at com.inductiveautomation.factorypmi.common.xmlserialization.serialization.XMLSerializationContext.getCleanCopy(XMLSerializationContext.java:144)
	at com.inductiveautomation.factorypmi.common.xmlserialization.serialization.DefaultObjectSerializationDelegate.serializeProperties(DefaultObjectSerializationDelegate.java:267)
	at com.inductiveautomation.factorypmi.common.xmlserialization.serialization.DefaultObjectSerializationDelegate.serialize(DefaultObjectSerializationDelegate.java:299)
	at com.inductiveautomation.factorypmi.common.xmlserialization.serialization.XMLSerializationContext.serialize(XMLSerializationContext.java:123)
	at com.inductiveautomation.factorypmi.common.xmlserialization.serialization.DefaultObjectSerializationDelegate.writeCall(DefaultObjectSerializationDelegate.java:202)
	at com.inductiveautomation.factorypmi.common.xmlserialization.serialization.DefaultObjectSerializationDelegate.writeCall(DefaultObjectSerializationDelegate.java:191)
	at com.inductiveautomation.factorypmi.common.xmlserialization.serialization.DefaultObjectSerializationDelegate.doProperty(DefaultObjectSerializationDelegate.java:249)
	at com.inductiveautomation.factorypmi.common.xmlserialization.serialization.DefaultObjectSerializationDelegate.serializeProperties(DefaultObjectSerializationDelegate.java:276)
	... 61 more

Yeah, its that custom cursor stuff you were playing with. Looks like its a bit dangerous, in that it doesn’t serialize. If you’re going to use that, you’ve got to make sure that the cursor isn’t set when saving the window.

Found this in that stack trace

Unable to create clean copy of class sun.awt.windows.WCustomCursor

Cool, that was surely it. One of my custom cursors was stuck “on” and it snowballed from there because the things I was doing to fix it were constantly rolled back. Thanks.