Home » Eclipse Projects » Sirius » Impossible to find an interpreter - Could not find a session for model element(Exception when I try to programmatically open an AIRD file and display the diagrams it contains)
Impossible to find an interpreter - Could not find a session for model element [message #1608552] |
Mon, 09 February 2015 15:48 |
Francois Cabrol Messages: 32 Registered: January 2015 |
Member |
|
|
Hi everyone,
I am currently developing a POC, which consists of a standalone Eclipse RCP application enabling to create representations from existing semantic models, or to load an AIRD files and display one or several representations described in this AIRD file.
For the moment, I am just trying to programmatically display all the diagrams described in a given AIRD file, previously created using the "New Representation" context menu in the Sirius perspective.
In my command handler, I use the same code as described at the end of the topic named "Open Diagram programmatically", but I get a RuntimeException with the following message : Impossible to find an interpreter - Could not find a session for model element : proto.impl.ConfigurationDataFileImpl@ac266b
Sometimes the representation is then shown after I restart my application, but not always.
What does the message mean, and what is the proper way to open an AIRD file ?
The whole stack trace is copied below.
François
!ENTRY org.eclipse.sirius 4 0 2015-02-09 11:37:28.144
!MESSAGE Impossible to find an interpreter - Could not find a session for model element : proto.impl.ConfigurationDataFileImpl@ac266b (filename: sampleFileName.xml, configurationDataFileId: testIdOfTheDeath, version: , description: null, type: std)
!STACK 0
java.lang.RuntimeException
at org.eclipse.sirius.tools.api.interpreter.InterpreterRegistry.getInterpreter(InterpreterRegistry.java:70)
at org.eclipse.sirius.tools.api.interpreter.InterpreterUtil.getInterpreter(InterpreterUtil.java:39)
at org.eclipse.sirius.business.api.dialect.AbstractRepresentationDialectServices.checkPrecondition(AbstractRepresentationDialectServices.java:274)
at org.eclipse.sirius.diagram.ui.business.internal.dialect.DiagramDialectServices.canCreate(DiagramDialectServices.java:133)
at org.eclipse.sirius.business.internal.dialect.DialectManagerImpl.createRepresentation(DialectManagerImpl.java:132)
at org.eclipse.sirius.diagram.tools.api.command.view.CreateDiagramWithInitialOperation.execute(CreateDiagramWithInitialOperation.java:102)
at org.eclipse.sirius.business.api.helper.task.TaskExecutor.operation(TaskExecutor.java:95)
at org.eclipse.sirius.business.api.helper.task.TaskExecutor.execute(TaskExecutor.java:65)
at org.eclipse.sirius.tools.api.command.SiriusCommand.doExecute(SiriusCommand.java:80)
at org.eclipse.emf.transaction.RecordingCommand.execute(RecordingCommand.java:135)
at org.eclipse.emf.workspace.EMFCommandOperation.doExecute(EMFCommandOperation.java:119)
at org.eclipse.emf.workspace.AbstractEMFOperation.execute(AbstractEMFOperation.java:150)
at org.eclipse.core.commands.operations.DefaultOperationHistory.execute(DefaultOperationHistory.java:513)
at org.eclipse.emf.workspace.impl.WorkspaceCommandStackImpl.doExecute(WorkspaceCommandStackImpl.java:208)
at org.eclipse.emf.transaction.impl.AbstractTransactionalCommandStack.execute(AbstractTransactionalCommandStack.java:165)
at org.eclipse.emf.transaction.impl.AbstractTransactionalCommandStack.execute(AbstractTransactionalCommandStack.java:219)
at org.eclipse.sirius.diagram.ui.business.internal.dialect.DiagramDialectServices.initRepresentationForElement(DiagramDialectServices.java:311)
at org.eclipse.sirius.business.api.dialect.AbstractRepresentationDialectServices.initRepresentations(AbstractRepresentationDialectServices.java:408)
at org.eclipse.sirius.business.api.dialect.AbstractRepresentationDialectServices.initRepresentations(AbstractRepresentationDialectServices.java:359)
at org.eclipse.sirius.diagram.ui.business.internal.dialect.DiagramDialectServices.initRepresentations(DiagramDialectServices.java:292)
at org.eclipse.sirius.business.internal.dialect.DialectManagerImpl.initRepresentations(DialectManagerImpl.java:345)
at org.eclipse.sirius.business.internal.session.danalysis.DAnalysisSessionImpl.createView(DAnalysisSessionImpl.java:1015)
at org.eclipse.sirius.ui.business.api.viewpoint.ViewpointSelectionCallback.selectViewpoint(ViewpointSelectionCallback.java:68)
at org.eclipse.sirius.ui.business.api.viewpoint.ViewpointSelectionCallback.selectViewpoint(ViewpointSelectionCallback.java:42)
at thales.thav.dsi.em.proto.ui.util.ProtoUtils$1.doExecute(ProtoUtils.java:61)
at org.eclipse.emf.transaction.RecordingCommand.execute(RecordingCommand.java:135)
at org.eclipse.emf.workspace.EMFCommandOperation.doExecute(EMFCommandOperation.java:119)
at org.eclipse.emf.workspace.AbstractEMFOperation.execute(AbstractEMFOperation.java:150)
at org.eclipse.core.commands.operations.DefaultOperationHistory.execute(DefaultOperationHistory.java:513)
at org.eclipse.emf.workspace.impl.WorkspaceCommandStackImpl.doExecute(WorkspaceCommandStackImpl.java:208)
at org.eclipse.emf.transaction.impl.AbstractTransactionalCommandStack.execute(AbstractTransactionalCommandStack.java:165)
at org.eclipse.emf.transaction.impl.AbstractTransactionalCommandStack.execute(AbstractTransactionalCommandStack.java:219)
at thales.thav.dsi.em.proto.ui.util.ProtoUtils.displayDiagrams(ProtoUtils.java:53)
at thales.thav.dsi.em.proto.ui.handlers.SampleHandler.execute(SampleHandler.java:45)
at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:294)
at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:90)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:55)
at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:247)
at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:229)
at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:132)
at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:149)
at org.eclipse.core.commands.Command.executeWithChecks(Command.java:499)
at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:210)
at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.executeItem(HandledContributionItem.java:825)
at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.handleWidgetSelection(HandledContributionItem.java:701)
at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.access$6(HandledContributionItem.java:685)
at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem$4.handleEvent(HandledContributionItem.java:613)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4353)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1061)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4172)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3761)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.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(EclipseStarter.java:380)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
at org.eclipse.equinox.launcher.Main.main(Main.java:1438)
|
|
|
Re: Impossible to find an interpreter - Could not find a session for model element [message #1611294 is a reply to message #1608552] |
Wed, 11 February 2015 09:15 |
|
> Hi everyone,
Hi François,
I think the Acceleo interpreter is missing. If Acceleo3 expressions are
used within your specification model (*.odesign), the plug-in
"org.eclipse.sirius.common.acceleo.mtl" needs to be installed in your
application to execute them.
>
> I am currently developing a POC, which consists of a standalone
> Eclipse RCP application enabling to create representations from existing
> semantic models, or to load an AIRD files and display one or several
> representations described in this AIRD file.
>
> For the moment, I am just trying to programmatically display all
> the diagrams described in a given AIRD file, previously created using
> the "New Representation" context menu in the Sirius perspective.
>
> In my command handler, I use the same code as described at the end
> of the topic named "Open Diagram programmatically", but I get a
> RuntimeException with the following message : Impossible to find an
> interpreter - Could not find a session for model element :
> mailto:proto.impl.ConfigurationDataFileImpl@ac266b
>
> Sometimes the representation is then shown after I restart my
> application, but not always.
>
> What does the message mean, and what is the proper way to open an
> AIRD file ?
>
> The whole stack trace is copied below.
>
> François
Regards,
--
Florian - Obeo
Need professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
| |
Re: Impossible to find an interpreter - Could not find a session for model element [message #1619393 is a reply to message #1619112] |
Mon, 16 February 2015 14:54 |
|
Hi Frédéric,
Le 16/02/2015 11:45, Frédéric Botron a écrit :
> Hi, and thanks for your reply.
>
> In fact, my application already contains feature
> org.eclipse.sirius.runtime.acceleo, itself containing plugin
> org.eclipse.sirius.common.acceleo.mtl.
>
> I have this error, whether I run my application from an product, or
> from my SIRIUS Eclipse runtime. I do not know what to do to solve this
> problem. In fact, I do not understand what this message means, given my
> Session object is already created when I try to display the diagrams.
Could give us more information about what you were doing when the error
was displayed ?
> RuntimeException with the following message : Impossible to find an
> interpreter - Could not find a session for model element :
> mailto:proto.impl.ConfigurationDataFileImpl@ac266b
This error usually means that the indicated EObject does not belong to
the current session (no container, no resource, or resource not
referenced as a semantic resource), then Sirius is not able to retrieve
the IInterpreter to use to evaluate the different expressions required
to display/compute a representation.
In your case, do you known from where comes the
proto.impl.ConfigurationDataFileImpl@ac266b element(filename:
sampleFileName.xml, configurationDataFileId: testIdOfTheDeath, version:
, description: null, type: std) ?
Another information found in your stack:
>
> !ENTRY org.eclipse.sirius 4 0 2015-02-09 11:37:28.144
> !MESSAGE Impossible to find an interpreter - Could not find a session
> for model element : proto.impl.ConfigurationDataFileImpl@ac266b
> (filename: sampleFileName.xml, configurationDataFileId:
> testIdOfTheDeath, version: , description: null, type: std)
> !STACK 0
> java.lang.RuntimeException
> at
>
org.eclipse.sirius.tools.api.interpreter.InterpreterRegistry.getInterpreter(InterpreterRegistry.java:70)
>
> at
[...]
>
org.eclipse.sirius.business.api.dialect.AbstractRepresentationDialectServices.checkPrecondition(AbstractRepresentationDialectServices.java:274)
>
[.../]
>
org.eclipse.sirius.business.api.dialect.AbstractRepresentationDialectServices.initRepresentations(AbstractRepresentationDialectServices.java:408)
>
[.../]
>
org.eclipse.sirius.ui.business.api.viewpoint.ViewpointSelectionCallback.selectViewpoint(ViewpointSelectionCallback.java:42)
>
> at
>
thales.thav.dsi.em.proto.ui.util.ProtoUtils$1.doExecute(ProtoUtils.java:61)
> at
It seems that the whole stack comes from your Viewpoint selection: when
you activate a Viewpoint, Sirius will look into its representation
children to collect all representation description with the
Initalization attribute enabled. Then it will try to create all possible
corresponding representations regarding your semantic model
(eAllContents on the roots of your semantic resources - from this, I do
not understand your "impossible to find an interpreter" error). Could
you indicate which version of Sirius you use ?
I think you should disable the initialization of your representation
descriptions and explicitely create the needed representations from your
ProtoUtil after the Viewpoitn selection if required.
Regards,
--
Maxime - Obeo
Need professional services for Sirius?
http://www.obeodesigner.com/sirius
Maxime Porhel - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
| |
Goto Forum:
Current Time: Sat Apr 27 02:29:41 GMT 2024
Powered by FUDForum. Page generated in 0.02806 seconds
|