Error ExcelImporter - How to check if MxModelReflection and selected DB is synchronized?

0
Hi all, I have setup the excel importer module. I have set up a very simple template to import data. Importing the excel, throws the error message below. First step is to check, if MxModelReflection and selected DB is synchronized. How can I solve this? Many thx in advance :) The mapping from XML to Domain throwed an error. Be sure the MxModelReflection and selected DB is synchronized. LastErrorMessage: Invalid byte 2 of 2-byte UTF-8 sequence.. LastErrorStackTraceorg.apache.xerces.impl.io.MalformedByteSequenceException: Invalid byte 2 of 2-byte UTF-8 sequence. at com.mendix.integration.xmlimporter.XmlImporter.processSAXException(XmlImporter.java:170) Caused by: Invalid byte 2 of 2-byte UTF-8 sequence. at org.apache.xerces.impl.io.UTF8Reader.invalidByte(Unknown Source) at org.apache.xerces.impl.io.UTF8Reader.read(Unknown Source) at org.apache.xerces.impl.XMLEntityScanner.load(Unknown Source) at org.apache.xerces.impl.XMLEntityScanner.skipString(Unknown Source) at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) at com.mendix.integration.xmlimporter.XmlImporter.importXmlStream(XmlImporter.java:87) at com.mendix.integration.xmlimporter.XmlImporter.importXmlStream(XmlImporter.java:54) at com.mendix.integration.internal.InternalIntegrationImpl.importXmlStream(InternalIntegrationImpl.scala:265) at com.mendix.integration.actions.microflow.ImportXMLAction.execute(ImportXMLAction.scala:33) at com.mendix.modules.microflowengine.microflow.impl.MicroflowObject.execute(MicroflowObject.java:47) at com.mendix.modules.microflowengine.microflow.impl.MicroflowImpl.executeAfterBreakingIfNecessary(MicroflowImpl.java:192) at com.mendix.modules.microflowengine.microflow.impl.MicroflowImpl.executeAction(MicroflowImpl.java:149) at com.mendix.systemwideinterfaces.core.UserAction.execute(UserAction.java:49) at com.mendix.core.actionmanagement.CoreAction.doCall(CoreAction.java:260) at com.mendix.core.actionmanagement.CoreAction.call(CoreAction.java:248) at com.mendix.core.actionmanagement.ActionManager$1.execute(ActionManager.java:188) at com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:32) at com.mendix.core.actionmanagement.ActionManager.executeSync(ActionManager.java:194) at com.mendix.core.component.InternalCore.execute(InternalCore.java:386) at com.mendix.webui.actions.client.ExecuteAction.execute(ExecuteAction.java:135) at com.mendix.webui.requesthandling.ClientRequestHandler$$anonfun$handleRequest$1.apply$mcV$sp(ClientRequestHandler.scala:322) at com.mendix.webui.requesthandling.ClientRequestHandler$$anonfun$handleRequest$1.apply(ClientRequestHandler.scala:315) at com.mendix.webui.requesthandling.ClientRequestHandler$$anonfun$handleRequest$1.apply(ClientRequestHandler.scala:315) at com.mendix.core.session.Worker$$anonfun$receive$3$$anonfun$2$$anon$1.execute(ActionDispatching.scala:145) at com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:32) at com.mendix.core.session.Worker$$anonfun$receive$3$$anonfun$2.apply(ActionDispatching.scala:147) at scala.util.Try$.apply(Try.scala:191) at com.mendix.core.session.Worker$$anonfun$receive$3.applyOrElse(ActionDispatching.scala:141) at akka.actor.Actor$class.aroundReceive(Actor.scala:465) at com.mendix.core.session.Worker.aroundReceive(ActionDispatching.scala:137) at akka.actor.ActorCell.receiveMessage(ActorCell.scala:516) at akka.actor.ActorCell.invoke(ActorCell.scala:487) at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:238) at akka.dispatch.Mailbox.run(Mailbox.scala:220) at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:393) at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260) at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339) at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979) at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
asked
6 answers
0

Tim,

Just resync the model reflection and try the import again. Make sure the correct modules are set for syncing.

answered
0

You could implement such a validation in a Java action:

  • Use Core.GetMicroflowNames()
  • Iterate over this set of strings
  • For each string, retrieve the object from the MxModelReflection module
    • alternatively, you could exclude modules by parsing the microflow name
  • if there is an object for every microflow, your DB and model are in sync and you can return true
answered
0

Also have a look at the ASuCheckModelAndTemplates After Startup microflow in the _USEME folder. This microflow syncs the domain model every time you start the application and performs a check between the configured templates and the current domain model. Any non existing columns are automatically set to ignored.

answered
0

I remember putting in a feature request for an api call that would return the database schema version. This is actually stored in a metadata table and would be perfect to know if you ened to sync MxModelReflection automatically on startup. No idea what happened to it.

What we do is sync on startup everytime when running on a server, but not on a development machine, as it takes pretty long to do.

answered
0

Sorry I don't know the rules of the forum but did any of these answers work for you Tim? I have the same problem.

answered
0

I am only studying Mendix for a week now, and I am not even a programmer, and may be that's why it took be several hours to find out the answer to this question. I believe above it remains unanswered, so here is what I found when running in this error importing my first Excel files with the Excel Importer: 'Invalid byte 2 of 2-byte UTF-8 sequence'. Normally you get this message when your file isn't UTF-8 or has an invalid special character. But here it is something else: In the Import_Overview page you should not use the tab Import Template, but Import File. Sounds logical, or what? However, I am not the only one who made the mistake, I am sure of that, because there are several questions about this error on this forum. You can find the answer on the forum as well, but almost hidden under this question: Excel importer - Error, need help debugging.

answered