Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Problem with multiple ecore EMF model
Problem with multiple ecore EMF model [message #425904] Thu, 11 December 2008 14:45 Go to next message
Eclipse UserFriend
Originally posted by: sderrienREMOVE.irisa.fr

Hello,

I have a problem with the EMF editor for models based on multiple ecore
file (classes in a model A.ecore that inherits from classes defined as
interfaces in a model B.ecore).

The short story :
=========================

Whenever I try to create a model through the EMF wizard, I get the
following Error :

The selected wizard could not be started.
Plug-in "B.editor" was unable to instantiate class
"B.presentation.BModelWizard".
A/AClassDefinedInA

As soon as I remove the inheritance from the first model everything
works fine again.


The long story :
=========================

I know this is a fairly long description, but I couldn't find a shorter
way to describe the problem on which I have been beating my head for days.

I thank in advance those who will make the effort to read the whole mail.

Until now, we used to used a very general Java graph data-structure
interface (with classes such as IGraph, INode, IEdge, etc...) for which
we have developped *many* useful algorithms (traversal, subgraph
isomorphism, clique, etc).

Before moving to EMF, we used to define our own problem specific Java
classes, and make them implement all the IGraph, INode, interfaces so as
to be able to use all the aforementioned algorithms at no additional
developpment cost.

We now want like to use EMF for defining our models, while still
benefiting from our IGraph interface.

Here is what we did so far :

1) We created a EMF model (graph.ecore) in which we defined the
IGraph,INode,... as EClass marked as pure interfaces and abstract
classes. These Eclass do not have any structural Features, and all the
original interface methods are declared as EOperations.

2) We generated the Model code, the edit, editor, for it. Since the
model elements were marked a interface only, no actual class
implementation was generated for them (this is exaclty what we wanted).

3) We created some other model (FSM.ecore) which references the graph
ecore models, and defines Eclass elements which inherit (i.e. implement)
corresponding INode, ..., IEdge interfaces.

For example, our problem specific model FSM.ecore (which models Finite
State Machine as its name suggests) owns a EClass named State that
implements the INode interface, a Transition Eclass which implements
IEdge, etc.

4) We generate the Model code and implement by hand all the EOperations
defined in the graph.ecore model. From there we are able to use all our
graph algorithms on the EMF model objects.

And this is were all the trouble begins ...

I could not find a way to use the EMF generated editor on the new FSM
model, whenever I try to create a model through the EMF wizard, I get
the following Error :

The selected wizard could not be started.
Plug-in "fr.irisa.cairn.model.fsm.editor" was unable to instantiate
class "fr.irisa.cairn.model.fsm.presentation.FSMModelModelWizard".
fr/irisa/cairn/graph/INode

As soon as I remove the inheritance from the INode,IEdge, etc classes in
my FSM model, everything works fine again.

Any help would be GREATLY appreciated ...

Steven
Re: Problem with multiple ecore EMF model [message #425906 is a reply to message #425904] Thu, 11 December 2008 14:56 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
Steven,

Comments below.

news.eclipse.org wrote:
> Hello,
>
> I have a problem with the EMF editor for models based on multiple
> ecore file (classes in a model A.ecore that inherits from classes
> defined as interfaces in a model B.ecore).
>
> The short story :
> =========================
>
> Whenever I try to create a model through the EMF wizard, I get the
> following Error :
>
> The selected wizard could not be started.
> Plug-in "B.editor" was unable to instantiate class
> "B.presentation.BModelWizard".
> A/AClassDefinedInA
>
> As soon as I remove the inheritance from the first model everything
> works fine again.
Have you looked in the Error log for more detailed stack trace
information? Keep in mind that plugin.xmls and MANIFEST.MF are never
regenerated so stale information in the plugin.xml (like if you changed
the package name) would cause a problem like this.
>
>
> The long story :
> =========================
>
> I know this is a fairly long description, but I couldn't find a
> shorter way to describe the problem on which I have been beating my
> head for days.
>
> I thank in advance those who will make the effort to read the whole
> mail.
>
> Until now, we used to used a very general Java graph data-structure
> interface (with classes such as IGraph, INode, IEdge, etc...) for
> which we have developped *many* useful algorithms (traversal, subgraph
> isomorphism, clique, etc).
>
> Before moving to EMF, we used to define our own problem specific Java
> classes, and make them implement all the IGraph, INode, interfaces so
> as to be able to use all the aforementioned algorithms at no
> additional developpment cost.
>
> We now want like to use EMF for defining our models, while still
> benefiting from our IGraph interface.
>
> Here is what we did so far :
>
> 1) We created a EMF model (graph.ecore) in which we defined the
> IGraph,INode,... as EClass marked as pure interfaces and abstract
> classes. These Eclass do not have any structural Features, and all the
> original interface methods are declared as EOperations.
>
> 2) We generated the Model code, the edit, editor, for it. Since the
> model elements were marked a interface only, no actual class
> implementation was generated for them (this is exaclty what we wanted).
>
> 3) We created some other model (FSM.ecore) which references the graph
> ecore models, and defines Eclass elements which inherit (i.e.
> implement) corresponding INode, ..., IEdge interfaces.
>
> For example, our problem specific model FSM.ecore (which models Finite
> State Machine as its name suggests) owns a EClass named State that
> implements the INode interface, a Transition Eclass which implements
> IEdge, etc.
>
> 4) We generate the Model code and implement by hand all the
> EOperations defined in the graph.ecore model. From there we are able
> to use all our graph algorithms on the EMF model objects.
>
> And this is were all the trouble begins ...
>
> I could not find a way to use the EMF generated editor on the new FSM
> model, whenever I try to create a model through the EMF wizard, I get
> the following Error :
>
> The selected wizard could not be started.
> Plug-in "fr.irisa.cairn.model.fsm.editor" was unable to instantiate
> class "fr.irisa.cairn.model.fsm.presentation.FSMModelModelWizard".
> fr/irisa/cairn/graph/INode
>
> As soon as I remove the inheritance from the INode,IEdge, etc classes
> in my FSM model, everything works fine again.
It really sounds like problems with incorrect information in the
plugin.xml or MANIFEST.MF for the base graph model. Check the
<workspace>/.metadata/.log to find mind detailed information about the
underlying cause.
>
> Any help would be GREATLY appreciated ...
>
> Steven
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Problem with multiple ecore EMF model [message #425929 is a reply to message #425906] Fri, 12 December 2008 09:13 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: sderrienREMOVE.irisa.fr

Hi Ed,

Thanks you for you quick answer, I really appreciate your help.

The weirdest thing in the story is that the .metadata/.log does not log
anything regarding this error message ...

In despair, I tried to regenerate everything in a new workspace and it
just worked perfectly.

For the records, the problem originated from the fact that whenever I
would delete the corresponding generated edit and editor project, I
wouldn't ask to also remove the content of the disk, which cause sode
effect during generated code merge ...


Steven


Ed Merks a écrit :
> Steven,
>
> Comments below.
>
> news.eclipse.org wrote:
>> Hello,
>>
>> I have a problem with the EMF editor for models based on multiple
>> ecore file (classes in a model A.ecore that inherits from classes
>> defined as interfaces in a model B.ecore).
>>
>> The short story :
>> =========================
>>
>> Whenever I try to create a model through the EMF wizard, I get the
>> following Error :
>>
>> The selected wizard could not be started.
>> Plug-in "B.editor" was unable to instantiate class
>> "B.presentation.BModelWizard".
>> A/AClassDefinedInA
>>
>> As soon as I remove the inheritance from the first model everything
>> works fine again.
> Have you looked in the Error log for more detailed stack trace
> information? Keep in mind that plugin.xmls and MANIFEST.MF are never
> regenerated so stale information in the plugin.xml (like if you changed
> the package name) would cause a problem like this.
>>
>>
>> The long story :
>> =========================
>>
>> I know this is a fairly long description, but I couldn't find a
>> shorter way to describe the problem on which I have been beating my
>> head for days.
>>
>> I thank in advance those who will make the effort to read the whole
>> mail.
>>
>> Until now, we used to used a very general Java graph data-structure
>> interface (with classes such as IGraph, INode, IEdge, etc...) for
>> which we have developped *many* useful algorithms (traversal, subgraph
>> isomorphism, clique, etc).
>>
>> Before moving to EMF, we used to define our own problem specific Java
>> classes, and make them implement all the IGraph, INode, interfaces so
>> as to be able to use all the aforementioned algorithms at no
>> additional developpment cost.
>>
>> We now want like to use EMF for defining our models, while still
>> benefiting from our IGraph interface.
>>
>> Here is what we did so far :
>>
>> 1) We created a EMF model (graph.ecore) in which we defined the
>> IGraph,INode,... as EClass marked as pure interfaces and abstract
>> classes. These Eclass do not have any structural Features, and all the
>> original interface methods are declared as EOperations.
>>
>> 2) We generated the Model code, the edit, editor, for it. Since the
>> model elements were marked a interface only, no actual class
>> implementation was generated for them (this is exaclty what we wanted).
>>
>> 3) We created some other model (FSM.ecore) which references the graph
>> ecore models, and defines Eclass elements which inherit (i.e.
>> implement) corresponding INode, ..., IEdge interfaces.
>>
>> For example, our problem specific model FSM.ecore (which models Finite
>> State Machine as its name suggests) owns a EClass named State that
>> implements the INode interface, a Transition Eclass which implements
>> IEdge, etc.
>>
>> 4) We generate the Model code and implement by hand all the
>> EOperations defined in the graph.ecore model. From there we are able
>> to use all our graph algorithms on the EMF model objects.
>>
>> And this is were all the trouble begins ...
>>
>> I could not find a way to use the EMF generated editor on the new FSM
>> model, whenever I try to create a model through the EMF wizard, I get
>> the following Error :
>>
>> The selected wizard could not be started.
>> Plug-in "fr.irisa.cairn.model.fsm.editor" was unable to instantiate
>> class "fr.irisa.cairn.model.fsm.presentation.FSMModelModelWizard".
>> fr/irisa/cairn/graph/INode
>>
>> As soon as I remove the inheritance from the INode,IEdge, etc classes
>> in my FSM model, everything works fine again.
> It really sounds like problems with incorrect information in the
> plugin.xml or MANIFEST.MF for the base graph model. Check the
> <workspace>/.metadata/.log to find mind detailed information about the
> underlying cause.
>>
>> Any help would be GREATLY appreciated ...
>>
>> Steven
>>
>>
Re: Problem with multiple ecore EMF model [message #425943 is a reply to message #425929] Fri, 12 December 2008 21:50 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
Steven,

If you don't delete the underlying resources in the file system, when
you create a workspace project in the same file system location, they
will just come back...


news.eclipse.org wrote:
> Hi Ed,
>
> Thanks you for you quick answer, I really appreciate your help.
>
> The weirdest thing in the story is that the .metadata/.log does not
> log anything regarding this error message ...
>
> In despair, I tried to regenerate everything in a new workspace and it
> just worked perfectly.
>
> For the records, the problem originated from the fact that whenever I
> would delete the corresponding generated edit and editor project, I
> wouldn't ask to also remove the content of the disk, which cause sode
> effect during generated code merge ...
>
>
> Steven
>
>
> Ed Merks a écrit :
>> Steven,
>>
>> Comments below.
>>
>> news.eclipse.org wrote:
>>> Hello,
>>>
>>> I have a problem with the EMF editor for models based on multiple
>>> ecore file (classes in a model A.ecore that inherits from classes
>>> defined as interfaces in a model B.ecore).
>>>
>>> The short story :
>>> =========================
>>>
>>> Whenever I try to create a model through the EMF wizard, I get the
>>> following Error :
>>>
>>> The selected wizard could not be started.
>>> Plug-in "B.editor" was unable to instantiate class
>>> "B.presentation.BModelWizard".
>>> A/AClassDefinedInA
>>>
>>> As soon as I remove the inheritance from the first model everything
>>> works fine again.
>> Have you looked in the Error log for more detailed stack trace
>> information? Keep in mind that plugin.xmls and MANIFEST.MF are never
>> regenerated so stale information in the plugin.xml (like if you
>> changed the package name) would cause a problem like this.
>>>
>>>
>>> The long story :
>>> =========================
>>>
>>> I know this is a fairly long description, but I couldn't find a
>>> shorter way to describe the problem on which I have been beating my
>>> head for days.
>>>
>>> I thank in advance those who will make the effort to read the whole
>>> mail.
>>>
>>> Until now, we used to used a very general Java graph data-structure
>>> interface (with classes such as IGraph, INode, IEdge, etc...) for
>>> which we have developped *many* useful algorithms (traversal,
>>> subgraph isomorphism, clique, etc).
>>>
>>> Before moving to EMF, we used to define our own problem specific
>>> Java classes, and make them implement all the IGraph, INode,
>>> interfaces so as to be able to use all the aforementioned algorithms
>>> at no additional developpment cost.
>>>
>>> We now want like to use EMF for defining our models, while still
>>> benefiting from our IGraph interface.
>>>
>>> Here is what we did so far :
>>>
>>> 1) We created a EMF model (graph.ecore) in which we defined the
>>> IGraph,INode,... as EClass marked as pure interfaces and abstract
>>> classes. These Eclass do not have any structural Features, and all
>>> the original interface methods are declared as EOperations.
>>>
>>> 2) We generated the Model code, the edit, editor, for it. Since the
>>> model elements were marked a interface only, no actual class
>>> implementation was generated for them (this is exaclty what we wanted).
>>>
>>> 3) We created some other model (FSM.ecore) which references the
>>> graph ecore models, and defines Eclass elements which inherit (i.e.
>>> implement) corresponding INode, ..., IEdge interfaces.
>>>
>>> For example, our problem specific model FSM.ecore (which models
>>> Finite State Machine as its name suggests) owns a EClass named State
>>> that implements the INode interface, a Transition Eclass which
>>> implements IEdge, etc.
>>>
>>> 4) We generate the Model code and implement by hand all the
>>> EOperations defined in the graph.ecore model. From there we are able
>>> to use all our graph algorithms on the EMF model objects.
>>>
>>> And this is were all the trouble begins ...
>>>
>>> I could not find a way to use the EMF generated editor on the new
>>> FSM model, whenever I try to create a model through the EMF wizard,
>>> I get the following Error :
>>>
>>> The selected wizard could not be started.
>>> Plug-in "fr.irisa.cairn.model.fsm.editor" was unable to
>>> instantiate class
>>> "fr.irisa.cairn.model.fsm.presentation.FSMModelModelWizard".
>>> fr/irisa/cairn/graph/INode
>>>
>>> As soon as I remove the inheritance from the INode,IEdge, etc
>>> classes in my FSM model, everything works fine again.
>> It really sounds like problems with incorrect information in the
>> plugin.xml or MANIFEST.MF for the base graph model. Check the
>> <workspace>/.metadata/.log to find mind detailed information about
>> the underlying cause.
>>>
>>> Any help would be GREATLY appreciated ...
>>>
>>> Steven
>>>
>>>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:custom widgets with EMF
Next Topic:Editor for non-unique references
Goto Forum:
  


Current Time: Fri Mar 29 11:48:08 GMT 2024

Powered by FUDForum. Page generated in 0.02971 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top