Skip to main content



      Home
Home » Modeling » EMF » "Generate Model Code" unexpected Error
"Generate Model Code" unexpected Error [message #401585] Wed, 07 June 2006 10:41 Go to next message
Eclipse UserFriend
Originally posted by: fhoerni.sopragroup.com

Hello,

My purpose is to build a metamodel and a conforming model. I use Eclipse
3.1.

Several sources and tutorials said to proceed with the following steps,
which lead to an error:
- I start from scratch and create a new simple project "MySimpleProject".
- in this project, I create a new Ecore Model in order to define my
metamodel: MyMetaModel.ecore - at the prompt "select a model object to
create", I choose "EPackage".
- in this MyMetaModel.ecore, I call the root package "MAIN", and create a
child class ("Book") which has 2 attributes ("title": EString and "date":
EString).

+ platform:/resource/MySimpleProject/MyMetaModel.ecore
+ package MAIN
+ class Book
+ attribute title : EString
+ attribute date: EString

At this point my metamodel is defined with no error, and I want now to
create an editor in order to build a conforming model:
- I create a new EMF Model : MyEMFModel.genmodel, which Model importer is
my previous Ecore model "MyMetaModel.ecore"

+ MyEMFModel
+ package MAIN
+ class Book
+ feature title : EString
+ feature date: EString

- then I right-click on the root of this EMF model, and choose "Generate
Model Code". This gives the following error:

""
MySimpleProject does not exist
An exception stack trace is not available.
""

I wonder If I did something wrong.
Is there another way to build a Model conforming to a MeatModel ? (perhaps
by writing XML directly, but I could not find any help about syntax)

Thanks for any help.

Frederic Hoerni
Re: "Generate Model Code" unexpected Error [message #401589 is a reply to message #401585] Wed, 07 June 2006 13:57 Go to previous messageGo to next message
Eclipse UserFriend
This is a multi-part message in MIME format.
--------------020006050201070602050405
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Frederic,

Unfortunately we haven't implemented all the constraint checking 75933
<https://bugs.eclipse.org/bugs/show_bug.cgi?id=75933> to validate that
the Ecore model is well formed (although we are starting to work on it
now). Things like a missing package name or package nsURI, or a missing
type for a structural feature will all cause problems later when you try
to use the model. The Error Log view (or <workspace>/.metadata/.log)
will contain a full stack trace for the problem. If you look at the
source code for that stack trace it will probably be obvious what's
returning null that shouldn't. Certainly setting a breakpoint (perhaps
an exception breakpoint for NullPointerException) and inspecting the
object involved in the problem should indicate what needs to be fixed in
your Ecore model.


Frederic Hoerni wrote:

> Hello,
>
> My purpose is to build a metamodel and a conforming model. I use
> Eclipse 3.1.
>
> Several sources and tutorials said to proceed with the following
> steps, which lead to an error:
> - I start from scratch and create a new simple project "MySimpleProject".
> - in this project, I create a new Ecore Model in order to define my
> metamodel: MyMetaModel.ecore - at the prompt "select a model object to
> create", I choose "EPackage".
> - in this MyMetaModel.ecore, I call the root package "MAIN", and
> create a child class ("Book") which has 2 attributes ("title": EString
> and "date": EString).
>
> + platform:/resource/MySimpleProject/MyMetaModel.ecore
> + package MAIN
> + class Book
> + attribute title : EString
> + attribute date: EString
>
> At this point my metamodel is defined with no error, and I want now to
> create an editor in order to build a conforming model:
> - I create a new EMF Model : MyEMFModel.genmodel, which Model importer
> is my previous Ecore model "MyMetaModel.ecore"
>
> + MyEMFModel
> + package MAIN
> + class Book
> + feature title : EString
> + feature date: EString
>
> - then I right-click on the root of this EMF model, and choose
> "Generate Model Code". This gives the following error:
>
> ""
> MySimpleProject does not exist
> An exception stack trace is not available.
> ""
>
> I wonder If I did something wrong.
> Is there another way to build a Model conforming to a MeatModel ?
> (perhaps by writing XML directly, but I could not find any help about
> syntax)
>
> Thanks for any help.
>
> Frederic Hoerni
>
>


--------------020006050201070602050405
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Frederic,<br>
<br>
Unfortunately we haven't implemented all the constraint checking <a
href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=75933">75933</a>
to validate that the Ecore model is well formed (although we are
starting to work on it now).
Re: "Generate Model Code" unexpected Error [message #401602 is a reply to message #401589] Thu, 08 June 2006 05:07 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: fhoerni.sopragroup.com

Thanks for your answer.

How do I set a breakpoint for this ?
Do I have to load the concerned source files into the Eclipse framework ?
If so, how do I bind the right-click+"Generate Model Code" to execute the
code where the breakpoint is set ?

Thanks.
Frederic Hoerni

Ed Merks wrote:

> Frederic,

> Unfortunately we haven't implemented all the constraint checking 75933
> <https://bugs.eclipse.org/bugs/show_bug.cgi?id=75933> to validate that
> the Ecore model is well formed (although we are starting to work on it
> now). Things like a missing package name or package nsURI, or a missing
> type for a structural feature will all cause problems later when you try
> to use the model. The Error Log view (or <workspace>/.metadata/.log)
> will contain a full stack trace for the problem. If you look at the
> source code for that stack trace it will probably be obvious what's
> returning null that shouldn't. Certainly setting a breakpoint (perhaps
> an exception breakpoint for NullPointerException) and inspecting the
> object involved in the problem should indicate what needs to be fixed in
> your Ecore model.
Re: "Generate Model Code" unexpected Error [message #401604 is a reply to message #401589] Thu, 08 June 2006 05:34 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: fhoerni.sopragroup.com

I found that this cause the exception:

if (!JavaProject.hasJavaNature(project)) {
throw ((JavaProject)JavaCore.create(project)).newNotPresentExcepti on();
}


Does it mean that my project must be a Java project ?
(I created it as a "simple" project)

Frederic Hoerni


Ed Merks wrote:

> Frederic,

> Unfortunately we haven't implemented all the constraint checking 75933
> <https://bugs.eclipse.org/bugs/show_bug.cgi?id=75933> to validate that
> the Ecore model is well formed (although we are starting to work on it
> now). Things like a missing package name or package nsURI, or a missing
> type for a structural feature will all cause problems later when you try
> to use the model. The Error Log view (or <workspace>/.metadata/.log)
> will contain a full stack trace for the problem. If you look at the
> source code for that stack trace it will probably be obvious what's
> returning null that shouldn't. Certainly setting a breakpoint (perhaps
> an exception breakpoint for NullPointerException) and inspecting the
> object involved in the problem should indicate what needs to be fixed in
> your Ecore model.
Re: "Generate Model Code" unexpected Error [message #401607 is a reply to message #401604] Thu, 08 June 2006 07:09 Go to previous message
Eclipse UserFriend
Frederic,

Definitely the project should be a Java project since we will generate
Java code that needs to compile. I've never tried the case where it's
not...


Frederic Hoerni wrote:
>
> I found that this cause the exception:
>
> if (!JavaProject.hasJavaNature(project)) {
> throw ((JavaProject)JavaCore.create(project)).newNotPresentExcepti on();
> }
>
>
> Does it mean that my project must be a Java project ?
> (I created it as a "simple" project)
>
> Frederic Hoerni
>
>
> Ed Merks wrote:
>
>> Frederic,
>
>> Unfortunately we haven't implemented all the constraint checking
>> 75933 <https://bugs.eclipse.org/bugs/show_bug.cgi?id=75933> to
>> validate that the Ecore model is well formed (although we are
>> starting to work on it now). Things like a missing package name or
>> package nsURI, or a missing type for a structural feature will all
>> cause problems later when you try to use the model. The Error Log
>> view (or <workspace>/.metadata/.log) will contain a full stack trace
>> for the problem. If you look at the source code for that stack trace
>> it will probably be obvious what's returning null that shouldn't.
>> Certainly setting a breakpoint (perhaps an exception breakpoint for
>> NullPointerException) and inspecting the object involved in the
>> problem should indicate what needs to be fixed in your Ecore model.
>
>
Previous Topic:Generated editor is not working
Next Topic:Drag vs. Copy in EMF Editor Tree
Goto Forum:
  


Current Time: Mon Jul 21 07:11:43 EDT 2025

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

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

Back to the top