Notifications
Clear all

load-data: Invalid content type was found starting with element

2 Posts
1 Users
1 Reactions
4,024 Views
0
Topic starter

The following error message occurs when attempting to load data during the Bookstore tutorial using the SDK. What can cause this error message?

Invalid content was found starting with element '{"http://www.mybooks.com/Bookstore":Book}'. One of '{ http://www.onenetwork.com/Platfor m":Error, "http://www.onenetwork.com/Platform":Model}' is expected.
1 Answer
1
Topic starter

This can happen if the Author's Domain in the module-descriptor.xml file does not match the xmlns value of the element in the XML file being loaded.

For example:
If the Author's Domain in the module-descriptor.xml file is mybooks.com, then the Book element in Books.xml should look like the following:

<Book xmlns="http://www.mybooks.com/Bookstore">
Matt Nutsch Topic starter 2020-04-15 14:04:00

There are at least two other reasons why error messages starting with "Invalid content was found" can occur when loading data:

One reason can be that there is a typo in the field name, causing a mismatch between the Data Model's field name and the data file.
For example: "Invalid content was found starting with element '{"http://www.mybooks.com/Bookstore":QuantitySold}'. One of '{"http://www.mybooks.com/Bookstore":QuanitySold, ...

Another reason can be that the fields are in different orders between the Data Model and the data file being loaded.