[Bug-13619] View crashing - 'Unable to deserialize resource'

Today I spent hours remaking a view because something was crashing it. The bad thing is that once it crashed, I couldn’t open it again, regardless of saving it, restarting, etc. Once it’s saved, it won’t parse the file again. I found out that it crashes when I made some parameters as output or bidirectional. The parameters that were crashing had spaces, so I’m assuming this is the main cause.

This is easily reproducible.
1 - Create a view
2 - Add a parameter that has a space in it
3 - Make it output or bidirectional.
4 - Save it. It’s gone.

image

Details:

JsonSyntaxException: java.lang.IllegalStateException: Duplicate key params.This name (attempted merging values com.inductiveautomation.perspective.common.config.PropertyConfig@348c0176 and com.inductiveautomation.perspective.common.config.PropertyConfig@6a05ffe5)
caused by IllegalStateException: Duplicate key params.This name (attempted merging values com.inductiveautomation.perspective.common.config.PropertyConfig@348c0176 and com.inductiveautomation.perspective.common.config.PropertyConfig@6a05ffe5)

Ignition v8.0.0 (b2019040718)
Java: Azul Systems, Inc. 11.0.2

You’re absolutely right - an outgoing or bi-directional parameter with a space in the namewill break a View.

If you need to repair the View, you can directly modify the view.json file on the Gateway and remove the offending space from the key. You’ll need to restart your Designer after doing so.

2 Likes

This issue was fixed in the 8.0.3 Nightly build that was uploaded yesterday (7/15).

1 Like

I had a view break after updating to the version you mentioned above. I get the error “Unable to deserialize resource ViewName”.

I think it may have something to do with the view containing a carousel component. Below is the full error:

> com.inductiveautomation.ignition.common.gson.JsonSyntaxException: java.lang.IllegalStateException: Duplicate key props.views.viewParams.perspectiveNdx (attempted merging values com.inductiveautomation.perspective.common.config.PropertyConfig@b02c8d14 and com.inductiveautomation.perspective.common.config.PropertyConfig@b02c8d14)
> 	at com.inductiveautomation.ignition.common.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:226)
> 	at com.inductiveautomation.ignition.common.gson.internal.bind.TreeTypeAdapter.read(TreeTypeAdapter.java:63)
> 	at com.inductiveautomation.ignition.common.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:41)
> 	at com.inductiveautomation.ignition.common.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:82)
> 	at com.inductiveautomation.ignition.common.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:61)
> 	at com.inductiveautomation.ignition.common.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:131)
> 	at com.inductiveautomation.ignition.common.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:222)
> 	at com.inductiveautomation.ignition.common.gson.internal.bind.TreeTypeAdapter.read(TreeTypeAdapter.java:63)
> 	at com.inductiveautomation.ignition.common.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:131)
> 	at com.inductiveautomation.ignition.common.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:222)
> 	at com.inductiveautomation.ignition.common.gson.internal.bind.TreeTypeAdapter.read(TreeTypeAdapter.java:63)
> 	at com.inductiveautomation.ignition.common.gson.Gson.fromJson(Gson.java:927)
> 	at com.inductiveautomation.ignition.common.gson.Gson.fromJson(Gson.java:865)
> 	at com.inductiveautomation.perspective.common.config.ViewConfig.fromProjectResource(ViewConfig.java:98)
> 	at com.inductiveautomation.perspective.designer.workspace.ViewResourceEditor.deserialize(ViewResourceEditor.java:186)
> 	at com.inductiveautomation.perspective.designer.workspace.ViewResourceEditor.deserialize(ViewResourceEditor.java:59)
> 	at com.inductiveautomation.ignition.designer.tabbedworkspace.ResourceEditor.loadResource(ResourceEditor.java:56)
> 	at com.inductiveautomation.ignition.designer.tabbedworkspace.ResourceEditor.lambda$new$0(ResourceEditor.java:37)
> 	at java.base/java.util.Optional.ifPresent(Unknown Source)
> 	at com.inductiveautomation.ignition.designer.tabbedworkspace.ResourceEditor.<init>(ResourceEditor.java:35)
> 	at com.inductiveautomation.perspective.designer.workspace.ViewResourceEditor.<init>(ViewResourceEditor.java:101)
> 	at com.inductiveautomation.perspective.designer.workspace.ViewWorkspace.newResourceEditor(ViewWorkspace.java:304)
> 	at com.inductiveautomation.ignition.designer.tabbedworkspace.TabbedResourceWorkspace.open(TabbedResourceWorkspace.java:224)
> 	at com.inductiveautomation.ignition.designer.tabbedworkspace.ResourceNode.open(ResourceNode.java:125)
> 	at com.inductiveautomation.ignition.designer.navtree.model.AbstractResourceNavTreeNode.onDoubleClick(AbstractResourceNavTreeNode.java:267)
> 	at com.inductiveautomation.ignition.designer.navtree.NavTreePanel$MouseListener.lambda$mousePressed$0(NavTreePanel.java:655)
> 	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(Native Method)
> 	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.IllegalStateException: Duplicate key props.views.viewParams.perspectiveNdx (attempted merging values com.inductiveautomation.perspective.common.config.PropertyConfig@b02c8d14 and com.inductiveautomation.perspective.common.config.PropertyConfig@b02c8d14)
> 	at java.base/java.util.stream.Collectors.duplicateKeyException(Unknown Source)
> 	at java.base/java.util.stream.Collectors.lambda$uniqKeysMapAccumulator$1(Unknown Source)
> 	at java.base/java.util.stream.ReduceOps$3ReducingSink.accept(Unknown Source)
> 	at java.base/java.util.Iterator.forEachRemaining(Unknown Source)
> 	at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Unknown Source)
> 	at java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source)
> 	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
> 	at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown Source)
> 	at java.base/java.util.stream.AbstractPipeline.evaluate(Unknown Source)
> 	at java.base/java.util.stream.ReferencePipeline.collect(Unknown Source)
> 	at com.inductiveautomation.perspective.common.config.PropertyConfigCollection$GsonAdapter.deserialize(PropertyConfigCollection.java:82)
> 	at com.inductiveautomation.perspective.common.config.PropertyConfigCollection$GsonAdapter.deserialize(PropertyConfigCollection.java:74)
> 	at com.inductiveautomation.ignition.common.gson.internal.bind.TreeTypeAdapter.read(TreeTypeAdapter.java:69)
> 	at com.inductiveautomation.ignition.common.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:131)
> 	at com.inductiveautomation.ignition.common.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read

(ReflectiveTypeAdapterFactory.java:222)view.json (18.7 KB)

That issue is fixed in the latest nightly build, and in the 8.0.3 RC that should be out within a few days.

1 Like

It seems like I can no longer add bindings to viewParams within a subview of a carousel, is this by design?

https:/uploads/iatesting/original/2X/f/f29d767f4ac3333a8078cbb9f170c6c41a944f5c.mp4