Error while importing an Email Template in Email Connector 6.2.2

0
I have created the Email template in the localhost environment and wanted to test it on my live testing instance. When importing the template an error occurs. I have updated the MxModel and checked if there were any duplicated entities, but there aren't. So I tried to import it again in the localhost app to see the if there was a problem with the model, but the exact error message popped up and here it is: com.mendix.webui.WebUIException: Exception while executing runtime operation at com.mendix.webui.actions.client.RuntimeOperationAction.$anonfun$apply$3(RuntimeOperationAction.scala:60) Caused by: com.mendix.modules.microflowengine.MicroflowException: com.mendix.systemwideinterfaces.MendixRuntimeException: Found more than one MendixObject for xpathquery: //MxModelReflection.MxObjectReference[Module=$var1 and Name=$var2] and arguments: System, changedBy    at Email_Connector.ACT_EmailTemplate_Import (Import with mapping : 'Import from XML') Advanced stacktrace:    at com.mendix.modules.microflowengine.MicroflowUtil$.processException(MicroflowUtil.scala:73) Caused by: com.mendix.systemwideinterfaces.MendixRuntimeException: com.mendix.systemwideinterfaces.MendixRuntimeException: Found more than one MendixObject for xpathquery: //MxModelReflection.MxObjectReference[Module=$var1 and Name=$var2] and arguments: System, changedBy    at com.mendix.integration.importer.xml.XmlImporter.parseXml(XmlImporter.scala:78) Caused by: com.mendix.systemwideinterfaces.MendixRuntimeException: Found more than one MendixObject for xpathquery: //MxModelReflection.MxObjectReference[Module=$var1 and Name=$var2] and arguments: System, changedBy    at com.mendix.integration.importer.handlers.ObjectFinder.findInDatabaseInternal(ObjectFinder.scala:80)    at com.mendix.integration.importer.handlers.ObjectFinder.findInDatabase(ObjectFinder.scala:62)    at com.mendix.integration.importer.handlers.ObjectFinder.$anonfun$find$2(ObjectFinder.scala:27)    at scala.Option.orElse(Option.scala:477)    at com.mendix.integration.importer.handlers.ObjectFinder.$anonfun$find$1(ObjectFinder.scala:27)    at scala.Option.orElse(Option.scala:477)    at com.mendix.integration.importer.handlers.ObjectFinder.find(ObjectFinder.scala:26)    at com.mendix.integration.importer.handlers.ObjectMappingHandler.findObject(ObjectMappingHandler.scala:292)    at com.mendix.integration.importer.handlers.ObjectMappingHandler.getObjectViaDefaultAction(ObjectMappingHandler.scala:255)    at com.mendix.integration.importer.handlers.ObjectMappingHandler.getObjectImportInfo(ObjectMappingHandler.scala:117)    at com.mendix.integration.importer.handlers.ObjectMappingHandler.createObjectInfo(ObjectMappingHandler.scala:138)    at com.mendix.integration.importer.handlers.ObjectMappingHandler.$anonfun$endObjectElement$1(ObjectMappingHandler.scala:94)    at scala.Option.map(Option.scala:242)    at com.mendix.integration.importer.handlers.ObjectMappingHandler.endObjectElement(ObjectMappingHandler.scala:89)    at com.mendix.integration.importer.handlers.StreamingHandler.$anonfun$handleElement$1(StreamingHandler.scala:82)    at com.mendix.integration.importer.handlers.StreamingHandler.$anonfun$handleElement$1$adapted(StreamingHandler.scala:80)    at scala.Option.foreach(Option.scala:437)    at com.mendix.integration.importer.handlers.StreamingHandler.handleElement(StreamingHandler.scala:80)    at com.mendix.integration.importer.handlers.StreamingHandler.endObject(StreamingHandler.scala:70)    at com.mendix.integration.importer.xml.XmlStreamingHandler.endElement(XmlStreamingHandler.scala:80)    at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:618)    at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1728)    at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2899)    at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:605)    at java.xml/com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:114)    at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:542)    at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:889)    at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:825)    at java.xml/com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)    at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1224)    at java.xml/com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:637)    at com.mendix.integration.importer.xml.XmlImporter.$anonfun$parseXml$1(XmlImporter.scala:59)    at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)    at scala.util.Try$.apply(Try.scala:217)    at com.mendix.integration.importer.xml.XmlImporter.parseXml(XmlImporter.scala:59)    at com.mendix.integration.importer.xml.XmlImporter.parse$1(XmlImporter.scala:40)    at com.mendix.integration.importer.xml.XmlImporter.$anonfun$importStream$1(XmlImporter.scala:41)    at com.mendix.integration.util.ContextUtil$RichContext$.withTransaction$extension(ContextUtil.scala:11)    at com.mendix.integration.importer.xml.XmlImporter.importStream(XmlImporter.scala:41)    at com.mendix.integration.internal.InternalIntegration.doImportStream(InternalIntegration.scala:109)    at com.mendix.integration.internal.InternalIntegration.doImportStream$(InternalIntegration.scala:101)    at com.mendix.integration.internal.InternalIntegrationImpl.doImportStream(InternalIntegrationImpl.scala:40)    at com.mendix.integration.actions.ImportMappingResult$.apply(ImportMappingResult.scala:63)    at com.mendix.integration.actions.ImportMappingResult$.$anonfun$apply$2(ImportMappingResult.scala:32)    at scala.util.Using$.resource(Using.scala:296)    at com.mendix.integration.actions.ImportMappingResult$.apply(ImportMappingResult.scala:31)    at com.mendix.integration.actions.microflow.ImportAction.execute(ImportAction.scala:41)    at com.mendix.integration.actions.microflow.ImportAction.execute(ImportAction.scala:23)    at com.mendix.modules.microflowengine.microflow.impl.MicroflowObject.$anonfun$execute$1(MicroflowObject.scala:29)    at scala.Option.flatMap(Option.scala:283)    at com.mendix.modules.microflowengine.microflow.impl.MicroflowObject.execute(MicroflowObject.scala:26)    at com.mendix.modules.microflowengine.microflow.impl.MicroflowImpl.executeAfterBreakingIfNecessary(MicroflowImpl.scala:201)    at com.mendix.modules.microflowengine.microflow.impl.MicroflowImpl.executeMicroflow(MicroflowImpl.scala:134)    at com.mendix.modules.microflowengine.microflow.impl.MicroflowImpl.$anonfun$executeAction$1(MicroflowImpl.scala:114)    at com.mendix.modules.opentelemetry.OpenTelemetryUtil$.$anonfun$withSpan$1(OpenTelemetryUtil.scala:18)    at com.mendix.modules.opentelemetry.OpenTelemetryUtil$.$anonfun$usingSpanWithCustomStatus$2(OpenTelemetryUtil.scala:37)    at scala.util.Using$.apply(Using.scala:296)    at com.mendix.modules.opentelemetry.OpenTelemetryUtil$.usingSpanWithCustomStatus(OpenTelemetryUtil.scala:36)    at com.mendix.modules.opentelemetry.OpenTelemetryUtil$.usingSpanWithCustomStatus(OpenTelemetryUtil.scala:53)    at com.mendix.modules.opentelemetry.OpenTelemetryUtil$.withSpanWithCustomStatus(OpenTelemetryUtil.scala:15)    at com.mendix.modules.opentelemetry.OpenTelemetryUtil$.withSpan(OpenTelemetryUtil.scala:18)    at com.mendix.modules.microflowengine.microflow.impl.MicroflowImpl.executeAction(MicroflowImpl.scala:112)    at com.mendix.systemwideinterfaces.core.UserAction.execute(UserAction.java:73)    at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.doCall(CoreActionHandlerImpl.scala:73)    at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.call(CoreActionHandlerImpl.scala:49)    at com.mendix.core.actionmanagement.internal.InternalCoreAction.call(InternalCoreAction.java:81)    at com.mendix.basis.actionmanagement.ActionManager.$anonfun$executeSync$2(ActionManager.scala:123)    at com.mendix.util.classloading.Runner$.withContextClassLoader(Runner.scala:20)    at com.mendix.basis.actionmanagement.ActionManager.executeSync(ActionManager.scala:123)    at com.mendix.basis.actionmanagement.MicroflowCallBuilderImpl.execute(MicroflowCallBuilderImpl.scala:63)    at com.mendix.webui.actions.client.MicroflowRuntimeOperationExecutor.runMicroflow(MicroflowRuntimeOperationExecutor.scala:103)    at com.mendix.webui.actions.client.MicroflowRuntimeOperationExecutor.$anonfun$doApply$6(MicroflowRuntimeOperationExecutor.scala:76)    at com.mendix.webui.actions.client.RegularClientAction$Helpers$.$anonfun$liftEither$1(RegularClientAction.scala:30)    at com.mendix.webui.actions.client.RegularClientAction$Helpers$StateHandler.$anonfun$apply$1(RegularClientAction.scala:72)    at com.mendix.webui.requesthandling.helpers.StateHandling.withState(StateHandling.scala:46)    at com.mendix.webui.requesthandling.helpers.StateHandling.withState$(StateHandling.scala:43)    at com.mendix.webui.actions.client.RegularClientAction$Helpers$StateHandler.withState(RegularClientAction.scala:66)    at com.mendix.webui.actions.client.RegularClientAction$Helpers$StateHandler.apply(RegularClientAction.scala:70)    at com.mendix.webui.actions.client.RegularClientAction$Helpers$StateHandler.apply(RegularClientAction.scala:66)    at com.mendix.webui.actions.client.MicroflowRuntimeOperationExecutor.doApply(MicroflowRuntimeOperationExecutor.scala:77)    at com.mendix.webui.actions.client.MicroflowRuntimeOperationExecutor.apply(MicroflowRuntimeOperationExecutor.scala:47)    at com.mendix.webui.actions.client.RuntimeOperationAction.runOperation(RuntimeOperationAction.scala:81)    at com.mendix.webui.actions.client.RuntimeOperationAction.$anonfun$apply$3(RuntimeOperationAction.scala:57)    at com.mendix.modules.opentelemetry.OpenTelemetryUtil$.$anonfun$withSpan$1(OpenTelemetryUtil.scala:18)    at com.mendix.modules.opentelemetry.OpenTelemetryUtil$.$anonfun$usingSpanWithCustomStatus$2(OpenTelemetryUtil.scala:37)    at scala.util.Using$.apply(Using.scala:296)    at com.mendix.modules.opentelemetry.OpenTelemetryUtil$.usingSpanWithCustomStatus(OpenTelemetryUtil.scala:36)    at com.mendix.modules.opentelemetry.OpenTelemetryUtil$.usingSpanWithCustomStatus(OpenTelemetryUtil.scala:53)    at com.mendix.modules.opentelemetry.OpenTelemetryUtil$.withSpanWithCustomStatus(OpenTelemetryUtil.scala:15)    at com.mendix.modules.opentelemetry.OpenTelemetryUtil$.withSpan(OpenTelemetryUtil.scala:18)    at com.mendix.webui.actions.client.RuntimeOperationAction.apply(RuntimeOperationAction.scala:54)    at com.mendix.webui.actions.client.RuntimeOperationAction.apply(RuntimeOperationAction.scala:26)    at com.mendix.webui.actions.client.RegularClientAction$Helpers$.$anonfun$liftEither$1(RegularClientAction.scala:30)    at com.mendix.webui.actions.client.RegularClientAction.$anonfun$execute$3(RegularClientAction.scala:121)    at scala.util.Try$.apply(Try.scala:217)    at com.mendix.webui.actions.client.RegularClientAction.$anonfun$execute$2(RegularClientAction.scala:121)    at com.mendix.webui.actions.client.RegularClientAction.$anonfun$execute$2$adapted(RegularClientAction.scala:119)    at com.mendix.webui.requesthandling.helpers.ContextHandling.$anonfun$inContext$6(ContextHandling.scala:59)    at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)    at com.mendix.basis.actionmanagement.ActionMonitoring$.$anonfun$monitor$1(ActionMonitoring.scala:52)    at com.mendix.util.classloading.Runner$.withContextClassLoader(Runner.scala:20)    at com.mendix.basis.actionmanagement.ActionMonitoring$.monitor(ActionMonitoring.scala:52)    at com.mendix.webui.requesthandling.helpers.ContextHandling.inContext(ContextHandling.scala:59)    at com.mendix.webui.requesthandling.helpers.ContextHandling.inContext$(ContextHandling.scala:33)    at com.mendix.webui.actions.client.RegularClientAction.inContext(RegularClientAction.scala:95)    at com.mendix.webui.requesthandling.helpers.ContextHandling.inContext(ContextHandling.scala:30)    at com.mendix.webui.requesthandling.helpers.ContextHandling.inContext$(ContextHandling.scala:22)    at com.mendix.webui.actions.client.RegularClientAction.inContext(RegularClientAction.scala:95)    at com.mendix.webui.actions.client.RegularClientAction.$anonfun$execute$1(RegularClientAction.scala:119)    at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)    at com.mendix.webui.requesthandling.helpers.ProfileHandling.profileRequest(ProfileHandling.scala:14)    at com.mendix.webui.requesthandling.helpers.ProfileHandling.profileRequest$(ProfileHandling.scala:10)    at com.mendix.webui.actions.client.RegularClientAction.profileRequest(RegularClientAction.scala:95)    at com.mendix.webui.actions.client.RegularClientAction.execute(RegularClientAction.scala:116)    at com.mendix.webui.requesthandling.ClientRequestHandler.handleAction(ClientRequestHandler.scala:101)    at com.mendix.webui.requesthandling.ClientRequestHandler.processRequest(ClientRequestHandler.scala:72)    at com.mendix.externalinterface.connector.RequestHandler.doProcessRequest(RequestHandler.java:37)    at com.mendix.external.connector.MxRuntimeConnector.$anonfun$doProcessRequest$2(MxRuntimeConnector.scala:68)    at com.mendix.external.connector.MxRuntimeConnector.$anonfun$doProcessRequest$2$adapted(MxRuntimeConnector.scala:68)    at com.mendix.util.classloading.Runner$.withContextClassLoader(Runner.scala:20)    at com.mendix.external.connector.MxRuntimeConnector.doProcessRequest(MxRuntimeConnector.scala:68)    at com.mendix.external.connector.MxRuntimeConnector.$anonfun$processRequest$1(MxRuntimeConnector.scala:34)    at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)    at com.mendix.modules.opentelemetry.OpenTelemetryUtil$.$anonfun$withCurrentContextFrom$1(OpenTelemetryUtil.scala:25)    at scala.util.Using$.resource(Using.scala:296)    at com.mendix.modules.opentelemetry.OpenTelemetryUtil$.withCurrentContextFrom(OpenTelemetryUtil.scala:24)    at com.mendix.external.connector.MxRuntimeConnector.processRequest(MxRuntimeConnector.scala:34)    at com.mendix.basis.impl.MxRuntimeImpl.processRequest(MxRuntimeImpl.scala:1084)    at com.mendix.m2ee.appcontainer.server.handler.RuntimeServlet.service(RuntimeServlet.scala:40)    at javax.servlet.http.HttpServlet.service(HttpServlet.java:590)    at org.eclipse.jetty.ee8.servlet.ServletHolder.handle(ServletHolder.java:640)    at org.eclipse.jetty.ee8.servlet.ServletHandler$ChainEnd.doFilter(ServletHandler.java:1374)    at org.eclipse.jetty.ee8.websocket.servlet.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:175)    at org.eclipse.jetty.ee8.servlet.FilterHolder.doFilter(FilterHolder.java:171)    at org.eclipse.jetty.ee8.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1348)    at org.eclipse.jetty.ee8.servlet.ServletHandler.doHandle(ServletHandler.java:454)    at org.eclipse.jetty.ee8.nested.ScopedHandler.nextHandle(ScopedHandler.java:181)    at org.eclipse.jetty.ee8.nested.SessionHandler.doHandle(SessionHandler.java:519)    at org.eclipse.jetty.ee8.nested.ScopedHandler.nextHandle(ScopedHandler.java:181)    at org.eclipse.jetty.ee8.nested.ContextHandler.doHandle(ContextHandler.java:885)    at org.eclipse.jetty.ee8.nested.ScopedHandler.nextScope(ScopedHandler.java:152)    at org.eclipse.jetty.ee8.servlet.ServletHandler.doScope(ServletHandler.java:423)    at org.eclipse.jetty.ee8.nested.ScopedHandler.nextScope(ScopedHandler.java:150)    at org.eclipse.jetty.ee8.nested.SessionHandler.doScope(SessionHandler.java:503)    at org.eclipse.jetty.ee8.nested.ScopedHandler.nextScope(ScopedHandler.java:150)    at org.eclipse.jetty.ee8.nested.ContextHandler.doScope(ContextHandler.java:830)    at org.eclipse.jetty.ee8.nested.ScopedHandler.handle(ScopedHandler.java:117)    at org.eclipse.jetty.ee8.nested.ContextHandler.handle(ContextHandler.java:1443)    at org.eclipse.jetty.ee8.nested.HttpChannel$RequestDispatchable.dispatch(HttpChannel.java:1289)    at org.eclipse.jetty.ee8.nested.HttpChannel.dispatch(HttpChannel.java:616)    at org.eclipse.jetty.ee8.nested.HttpChannel.handle(HttpChannel.java:459)    at org.eclipse.jetty.ee8.nested.ContextHandler$CoreContextHandler$CoreToNestedHandler.handle(ContextHandler.java:2450)    at org.eclipse.jetty.server.handler.ContextHandler.handle(ContextHandler.java:1064)    at org.eclipse.jetty.server.Server.handle(Server.java:182)    at org.eclipse.jetty.server.internal.HttpChannelState$HandlerInvoker.run(HttpChannelState.java:662)    at org.eclipse.jetty.server.internal.HttpConnection.onFillable(HttpConnection.java:416)    at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:322)    at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:99)    at org.eclipse.jetty.io.SelectableChannelEndPoint$1.run(SelectableChannelEndPoint.java:53)    at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.runTask(AdaptiveExecutionStrategy.java:480)    at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.consumeTask(AdaptiveExecutionStrategy.java:443)    at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.tryProduce(AdaptiveExecutionStrategy.java:293)    at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.run(AdaptiveExecutionStrategy.java:201)    at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:311)    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:979)    at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.doRunJob(QueuedThreadPool.java:1209)    at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1164)    at java.base/java.lang.Thread.run(Thread.java:1583)   Did anyone encounter the same problem? I have reported a bug when importing a template, that instead of finding the MxObject by key it was creating new ones, which was causing duplicates. But with version 6.2.2 of the Email Connector module it was fixed (maybe even before that). So that couldn't be the issue, could it?
asked
3 answers
2

Please try below.

1.

Go to the MxModelReflection module.

   - Use the MxObjectReference_Overview page to check for duplicates.

   - Delete any duplicate entries manually.

2.

Run the MxModelReflection.Microflow_RefreshModel microflow.

   - This will regenerate the model metadata and clean up inconsistencies.

 

3.In microflow,Use retrieve first instead of retrieve list if only one object is expected. 

answered
0

Hi Jill, yes, this error is related to duplicate MxModelReflection MxObjectReference entries, even if they are not visible directly in your domain model or app UI.

 

Fix:

  1. Go to MxModelReflection → MxModelOverview page.

  2. Click "Select All" and then "Refresh" to regenerate the model.

  3. Retry importing the email template.

This will remove duplicates and ensure the template import works as expected.

Even though the issue was addressed in Email Connector 6.2.2, the fix only works if MxModelReflection is up to date.

 

I hope this one helps you! :)

answered
0

There seems to be a problem with the Import Mapping of the Template xml.

It sees System.changedBy as duplicates of MxReference although it references different objects. Maybe the key attribute is selected falsely.

System.changedBy_duplicates.png

answered