M2DOC unable to generate image

Hello,
I try to generate a Word document from a Capella Model and I’m now facing issue with image generation.
Thinking I’m doing wrong, I try with the M2Doc given template SA Complete on the Level Crossing Traffic System example and I got this kind of error (same as my document) :
Capella Version : 1.2.1
M2DOC version : 2
4.1 Architecture Blank
{m:for im | self.containedSystemAnalysis.ownedSystem.asImageByRepresentationDescriptionName(‘System Architecture Blank’)}
{m:im.fit(500,400) }
{m:endfor}
And I got this error :
asImageByRepresentationDescriptionName(org.eclipse.emf.ecore .EObject,java.lang.String) with arguments [org.polarsys.capella.core.data.ctx.impl.SystemImpl@d6dce0c (id: 04b21b99-27d1-492a-a49f-fa157f7b7b54, sid: null) (name: Control system) (visibleInDoc: true, visibleInLM: true, summary: null, review: null) (abstract: false), System Architecture Blank] failed: Failed to execute runnable (java.lang.NullPointerException) org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.NullPointerException) at org.eclipse.swt.SWT.error(SWT.java:4533) at org.eclipse.swt.SWT.error(SWT.java:4448) at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.j ava:255) at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchroniz er.java:145) at org.eclipse.swt.widgets.Display.syncExec(Display.java:4821) at org.obeonetwork.m2doc.sirius.services.M2DocSiriusServices.as Image(M2DocSiriusServices.java:327) at org.obeonetwork.m2doc.sirius.services.M2DocSiriusServices.as ImageByRepresentationDescriptionName(M2DocSiriusServices.jav a:428) at sun.reflect.GeneratedMethodAccessor74.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.acceleo.query.runtime.impl.JavaMethodService.int ernalInvoke(JavaMethodService.java:162) at org.eclipse.acceleo.query.runtime.impl.AbstractService.invok e(AbstractService.java:135) at org.eclipse.acceleo.query.runtime.impl.EvaluationServices.ca llService(EvaluationServices.java:129) at org.eclipse.acceleo.query.runtime.impl.EvaluationServices.ca ll(EvaluationServices.java:172) at org.eclipse.acceleo.query.runtime.impl.EvaluationServices.ca llOrApply(EvaluationServices.java:208) at org.eclipse.acceleo.query.runtime.impl.EvaluationServices.ap plyCallOnSequence(EvaluationServices.java:275) at org.eclipse.acceleo.query.runtime.impl.EvaluationServices.ca llOrApply(EvaluationServices.java:203) at org.eclipse.acceleo.query.parser.AstEvaluator.caseCall(AstEv aluator.java:192) at org.eclipse.acceleo.query.ast.util.AstSwitch.doSwitch(AstSwi tch.java:119) at org.eclipse.emf.ecore.util.Switch.doSwitch(Switch.java:53) at org.eclipse.emf.ecore.util.Switch.doSwitch(Switch.java:69) at org.eclipse.acceleo.query.parser.AstEvaluator.eval(AstEvalua tor.java:112) at org.eclipse.acceleo.query.runtime.impl.QueryEvaluationEngine .eval(QueryEvaluationEngine.java:52) at org.obeonetwork.m2doc.generator.M2DocEvaluator.caseRepetitio n(M2DocEvaluator.java:1049) at org.obeonetwork.m2doc.generator.M2DocEvaluator.caseRepetitio n(M2DocEvaluator.java:1) at org.obeonetwork.m2doc.template.util.TemplateSwitch.doSwitch( TemplateSwitch.java:147) at org.eclipse.emf.ecore.util.Switch.doSwitch(Switch.java:53) at org.eclipse.emf.ecore.util.Switch.doSwitch(Switch.java:69) at org.obeonetwork.m2doc.generator.M2DocEvaluator.doSwitch(M2Do cEvaluator.java:1084) at org.obeonetwork.m2doc.generator.M2DocEvaluator.caseBlock(M2D ocEvaluator.java:1300) at org.obeonetwork.m2doc.generator.M2DocEvaluator.caseBlock(M2D ocEvaluator.java:1) at org.obeonetwork.m2doc.template.util.TemplateSwitch.doSwitch( TemplateSwitch.java:199) at org.eclipse.emf.ecore.util.Switch.doSwitch(Switch.java:53) at org.eclipse.emf.ecore.util.Switch.doSwitch(Switch.java:69) at org.obeonetwork.m2doc.generator.M2DocEvaluator.doSwitch(M2Do cEvaluator.java:1084) at org.obeonetwork.m2doc.generator.M2DocEvaluator.caseDocumentT emplate(M2DocEvaluator.java:278) at org.obeonetwork.m2doc.generator.M2DocEvaluator.caseDocumentT emplate(M2DocEvaluator.java:1) at org.obeonetwork.m2doc.template.util.TemplateSwitch.doSwitch( TemplateSwitch.java:279) at org.eclipse.emf.ecore.util.Switch.doSwitch(Switch.java:53) at org.eclipse.emf.ecore.util.Switch.doSwitch(Switch.java:69) at org.obeonetwork.m2doc.generator.M2DocEvaluator.doSwitch(M2Do cEvaluator.java:1084) at org.obeonetwork.m2doc.generator.M2DocEvaluator.generate(M2Do cEvaluator.java:267) at org.obeonetwork.m2doc.util.M2DocUtils.generate(M2DocUtils.ja va:694) at org.obeonetwork.m2doc.util.M2DocUtils.generate(M2DocUtils.ja va:652) at org.obeonetwork.m2doc.genconf.GenconfUtils.generate(GenconfU tils.java:494) at org.obeonetwork.m2doc.genconf.GenconfUtils.generate(GenconfU tils.java:421) at org.obeonetwork.m2doc.genconf.editor.command.GenerateHandler $1.run(GenerateHandler.java:54) at org.eclipse.jface.operation.ModalContext$ModalContextThread. run(ModalContext.java:119) Caused by: java.lang.NullPointerException at org.eclipse.gmf.runtime.diagram.core.listener.DiagramEventBr oker.initializeDiagramEventBroker(DiagramEventBroker.java:24 7) at org.eclipse.gmf.runtime.diagram.core.listener.DiagramEventBr oker.startListening(DiagramEventBroker.java:230) at org.eclipse.sirius.diagram.ui.tools.internal.part.OffscreenE ditPartFactory.createDiagramEditPart(OffscreenEditPartFactor y.java:88) at org.eclipse.sirius.diagram.ui.tools.api.part.DiagramEditPart Service.createDiagramEditPart(DiagramEditPartService.java:15 8) at org.eclipse.sirius.diagram.ui.business.internal.dialect.Diag ramDialectUIServices.exportWithResult(DiagramDialectUIServic es.java:452) at org.eclipse.sirius.ui.business.api.dialect.DialectUIServices .export(DialectUIServices.java:250) at org.eclipse.sirius.ui.business.internal.dialect.DialectUIMan agerImpl.export(DialectUIManagerImpl.java:267) at org.eclipse.sirius.ui.business.internal.dialect.DialectUIMan agerImpl.export(DialectUIManagerImpl.java:258) at org.obeonetwork.m2doc.sirius.services.M2DocSiriusServices$1. run(M2DocSiriusServices.java:318) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:3 5) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchr onizer.java:182) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.jav a:4211) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3827) at org.eclipse.jface.operation.ModalContext$ModalContextThread. block(ModalContext.java:165) at org.eclipse.jface.operation.ModalContext.run(ModalContext.ja va:369) at org.eclipse.jface.dialogs.ProgressMonitorDialog.run(Progress MonitorDialog.java:481) at org.eclipse.ui.internal.progress.ProgressMonitorJobsDialog.r un(ProgressMonitorJobsDialog.java:242) at org.eclipse.ui.internal.progress.ProgressManager$3.run(Progr essManager.java:895) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70) at org.eclipse.ui.internal.progress.ProgressManager.busyCursorW hile(ProgressManager.java:930) at org.eclipse.ui.internal.progress.ProgressManager.busyCursorW hile(ProgressManager.java:905) at org.obeonetwork.m2doc.genconf.editor.command.GenerateHandler .execute(GenerateHandler.java:50) at org.obeonetwork.m2doc.genconf.editor.command.AbstractGenerat ionHandler.execute(AbstractGenerationHandler.java:60) at org.eclipse.ui.internal.handlers.HandlerProxy.execute(Handle rProxy.java:295) at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4Ha ndlerProxy.java:90) at sun.reflect.GeneratedMethodAccessor85.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.e4.core.internal.di.MethodRequestor.execute(Meth odRequestor.java:55) at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClas s(InjectorImpl.java:282) at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(Injector Impl.java:264) at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke( ContextInjectionFactory.java:132) at org.eclipse.e4.core.commands.internal.HandlerServiceHandler. execute(HandlerServiceHandler.java:152) at org.eclipse.core.commands.Command.executeWithChecks(Command. java:494) at org.eclipse.core.commands.ParameterizedCommand.executeWithCh ecks(ParameterizedCommand.java:488) at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.exe cuteHandler(HandlerServiceImpl.java:210) at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributio nItem.executeItem(HandledContributionItem.java:433) at org.eclipse.e4.ui.workbench.renderers.swt.AbstractContributi onItem.handleWidgetSelection(AbstractContributionItem.java:4 54) at org.eclipse.e4.ui.workbench.renderers.swt.AbstractContributi onItem$3.handleEvent(AbstractContributionItem.java:482) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84) at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4418) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1079) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:4236) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3824) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine $4.run(PartRenderingEngine.java:1121) at org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:336) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine .run(PartRenderingEngine.java:1022) at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRu nUI(E4Workbench.java:150) at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:693) at org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:336) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:610) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:148) at org.polarsys.capella.core.platform.sirius.ui.app.CapellaAppl ication.start(CapellaApplication.java:116) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:134) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:104) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:388) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:243) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 673) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:610) at org.eclipse.equinox.launcher.Main.run(Main.java:1519)
Thank you for your help

Hello Benjamin,
I had the same problem with the M2DOC exports. I don’t know the origin of the problem. However, after generating the .genconf file, I closed the project and re-opened it. Then I generate the documentation. It works like that.
Clément

Hello Clement,
Thank for the tip ! Strangely, when I close the project, restart Capella and re-open the project, all image are generated !
Benjamin.

Copyright © Eclipse Capella, the Eclipse Capella logo, Eclipse and the Eclipse logo are Trademarks of The Eclipse Foundation.