Getting this error - "Invalid DataShape  assigned to DataTable XYZ" in Application Logs and i can see other logs also but they are not relevant to it.
I checked in thingworx Composer as well and can see that the correct the data shape is assigned to it. Please suggest what could be the reason.
Following article has details on same error when a new DataTable is created via Service.
Try using the RestartThing Service of the DataTable entry if it resolves the issue.
Also, try restarting your Tomcat to rule out Ghost Entity issue.
I have no idea on which service call, this error is coming. I think some File Transfer is happening. I too need to find out the actual reason for this error.
Hi Ayushi Gupta,
Can you please share the more entries of the logs (Both Application and Script logs) when this error occurs.
I cannot share the logs because they are confidential. But i found that at 05:01:34 a data table is being created and at 05:01:39 some file transfer is happening which updates this table. So can you tell me that data table creation takes some time for enabling data table thing or it is being created and is ready to be used as soon as we create it programatically ?
Hi Ayushi Gupta,
When a new entity is created (like a Thing) it will be loaded into the JVM memory immediately, but is not committed to disk until a transaction (service) successfully completes. For this reason ALL code in a service must be in a try/catch block to handle exceptions. In order to rollback the create call the catch must call a delete for any entity created.
Please refer to following link for details on Creating a Thing in Service Script.
We should also check in try/catch block if the Thing created is available for use to avoid such issues.
I hope it helps.