I've an expression in a block group that is set as a string with a default string value.
Value is "NLSTP01"
If I export the group as XML and try to import it after modifications, I get the following error:
org.xml.sax.SAXException: Error near line 19, column 57. Please check the syntax of the file near that location.
java.lang.ClassCastException: Error trying to coerce 'NLSTP01' [String] to a class java.lang.Integer
at com.inductiveautomation.ignition.common.xmlserialization.simple.SimpleXMLReader.endElement(SimpleXMLReader.java:183)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(Unknown Source)
at com.inductiveautomation.ignition.common.xmlserialization.simple.SimpleXMLReader.parseFile(SimpleXMLReader.java:65)
at com.inductiveautomation.factorysql.common.config.legacy.LegacyConfigurationManager.loadFullConfiguration(LegacyConfigurationManager.java:30)
at com.inductiveautomation.factorysql.designer.FSQLDesignerModuleHook$XMLImportProgressTask.run(FSQLDesignerModuleHook.java:1270)
at com.inductiveautomation.ignition.client.util.gui.progress.ClientProgressManager$ClientRunningTask.run(ClientProgressManager.java:544)
at com.inductiveautomation.ignition.common.execution.impl.BasicExecutionEngine$ThrowableCatchingRunnable.run(BasicExecutionEngine.java:526)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassCastException: Error trying to coerce 'NLSTP01' [String] to a class java.lang.Integer
at com.inductiveautomation.ignition.common.TypeUtilities.coerce(TypeUtilities.java:934)
at com.inductiveautomation.ignition.common.TypeUtilities.coerceNullSafe(TypeUtilities.java:714)
at com.inductiveautomation.factorysql.common.config.serialization.elements.ItemElement.setMetaProperty(ItemElement.java:96)
at com.inductiveautomation.factorysql.common.config.serialization.elements.ConfigElement.addChild(ConfigElement.java:66)
at com.inductiveautomation.ignition.common.xmlserialization.simple.SimpleXMLReader.endElement(SimpleXMLReader.java:174)
... 23 more
Ignition v7.6.6 (b2014040112)
Java: Oracle Corporation 1.7.0_60
Based on the log messages, the tag is set to an integer and the value being returned is a string. Basically saying that the two data types don’t match. I would look at those tags in the xml file, make sure that the tag is the correct data type. Also if you would like send the xml file your trying to import to support@inductiveautomation.com - ATTN: James , I would be glad to take a look at it.