Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » cannot generate model code
cannot generate model code [message #48623] Fri, 15 September 2006 05:45 Go to next message
Eclipse UserFriend
Hello everybody,



I follow the GMF tutorial but using my own model (test.mdl) instead. Problem
occurs while I right click the test.genmodel and do generate model code,
nothing happens (also no error message). It should be generate code within 3
packages (test, test.impl, test.util) right? After then, I continue to
generate edit and got an error. The error shows in below. Does anybody know
what happen? Thanks a lot.



Generate Ed&it Code

Generating edit project

Generating Java class test.test.provider.FlowDeleteCommandItemProvider
failed with an unhandled exception

InvocationTargetException

java.lang.reflect.InvocationTargetException

NullPointerException

Generating Java class test.test.provider.FlowCreateCommandItemProvider
failed with an unhandled exception

InvocationTargetException

java.lang.reflect.InvocationTargetException

NullPointerException

Generating Java class test.test.provider.FlowReCreateCommandItemProvider
failed with an unhandled exception

InvocationTargetException

java.lang.reflect.InvocationTargetException

NullPointerException

Generating Java class test.test.provider.ShapeCreateCommandItemProvider
failed with an unhandled exception

InvocationTargetException

java.lang.reflect.InvocationTargetException

NullPointerException

Generating Java class test.test.provider.ShapeDeleteCommandItemProvider
failed with an unhandled exception

InvocationTargetException

java.lang.reflect.InvocationTargetException

NullPointerException

Generating Java class test.test.provider.DiagramEditPartItemProvider
failed with an unhandled exception

InvocationTargetException

java.lang.reflect.InvocationTargetException

NullPointerException



Meilin
Re: cannot generate model code [message #48979 is a reply to message #48623] Fri, 15 September 2006 10:00 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: hpj_1106.163.com

At first, you should delete all files except config.ini file in
configuration folder, and then restart you eclipse.
"exquisitus" <ml154@le.ac.uk> д
Re: cannot generate model code [message #49186 is a reply to message #48623] Sat, 16 September 2006 07:24 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: dont.spam.net

Hi Meilin,

did you check your error log after (try to) generating the code? I guess
there will be some Warnings (containing a Null Pointer Exception :) ).

Is your model valid? You can start the validation by opening your ecore
model and then select "Sample Ecore Editor"->Validate in the menu.

I had a NPE as well. The validation tool told me that I have forgot to
set some values in a Reference Element. After fixing the problem I was
able to generate the other models and the code without any error.

Cheers
Christian
Re: cannot generate model code [message #50109 is a reply to message #49186] Mon, 18 September 2006 14:03 Go to previous messageGo to next message
Eclipse UserFriend
Hi Christian,

Thanks for you help.

I would like to see the warnings but it doesn't show any warning or error
after by clicking gnerate model code.
I also like to validate my ecore model but I can't find where the validation
tool.
If you don't mind, please describe more detail about validation step.

Thank you!
Meilin

"Christian Barth" <dont@spam.net> ???????:eegms0$hcg$1@utils.eclipse.org...
> Hi Meilin,
>
> did you check your error log after (try to) generating the code? I guess
> there will be some Warnings (containing a Null Pointer Exception :) ).
>
> Is your model valid? You can start the validation by opening your ecore
> model and then select "Sample Ecore Editor"->Validate in the menu.
>
> I had a NPE as well. The validation tool told me that I have forgot to set
> some values in a Reference Element. After fixing the problem I was able to
> generate the other models and the code without any error.
>
> Cheers
> Christian
Re: cannot generate model code [message #50168 is a reply to message #50109] Mon, 18 September 2006 14:20 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

This is a multi-part message in MIME format.
--------------050901060808020509080805
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Meilin,

When code generation fails to generate, there typically is some
information about this in the error log. Have you looked at the error log?

In the Ecore editor, you can right click on any object and ask to
validate it but there are still many constraints not being checked,
i.e., https://bugs.eclipse.org/bugs/show_bug.cgi?id=75933 isn't done
yet. A common cause for failure is an EPackage without an nsURI or
name, or an EStructuralFeature without an eType.


exquisitus wrote:
> Hi Christian,
>
> Thanks for you help.
>
> I would like to see the warnings but it doesn't show any warning or error
> after by clicking gnerate model code.
> I also like to validate my ecore model but I can't find where the validation
> tool.
> If you don't mind, please describe more detail about validation step.
>
> Thank you!
> Meilin
>
> "Christian Barth" <dont@spam.net> ???????:eegms0$hcg$1@utils.eclipse.org...
>
>> Hi Meilin,
>>
>> did you check your error log after (try to) generating the code? I guess
>> there will be some Warnings (containing a Null Pointer Exception :) ).
>>
>> Is your model valid? You can start the validation by opening your ecore
>> model and then select "Sample Ecore Editor"->Validate in the menu.
>>
>> I had a NPE as well. The validation tool told me that I have forgot to set
>> some values in a Reference Element. After fixing the problem I was able to
>> generate the other models and the code without any error.
>>
>> Cheers
>> Christian
>>
>
>
>


--------------050901060808020509080805
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Meilin,<br>
<br>
When code generation fails to generate, there typically is some
information about this in the error log.&nbsp; Have you looked at the error
log?<br>
<br>
In the Ecore editor, you can right click on any object and ask to
validate it but there are still many constraints not being checked,
i.e., <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=75933">https://bugs.eclipse.org/bugs/show_bug.cgi?id=75933</a>
isn't done yet.&nbsp; A common cause for failure is an EPackage without an
nsURI or name, or an EStructuralFeature without an eType.<br>
<br>
<br>
exquisitus wrote:
<blockquote cite="mideemnfm$42d$1@utils.eclipse.org" type="cite">
<pre wrap="">Hi Christian,

Thanks for you help.

I would like to see the warnings but it doesn't show any warning or error
after by clicking gnerate model code.
I also like to validate my ecore model but I can't find where the validation
tool.
If you don't mind, please describe more detail about validation step.

Thank you!
Meilin

"Christian Barth" <a class="moz-txt-link-rfc2396E" href="mailto:dont@spam.net">&lt;dont@spam.net&gt;</a> ???????:eegms0$hcg$1@utils.eclipse.org...
</pre>
<blockquote type="cite">
<pre wrap="">Hi Meilin,

did you check your error log after (try to) generating the code? I guess
there will be some Warnings (containing a Null Pointer Exception :) ).

Is your model valid? You can start the validation by opening your ecore
model and then select "Sample Ecore Editor"-&gt;Validate in the menu.

I had a NPE as well. The validation tool told me that I have forgot to set
some values in a Reference Element. After fixing the problem I was able to
generate the other models and the code without any error.

Cheers
Christian
</pre>
</blockquote>
<pre wrap=""><!---->

</pre>
</blockquote>
<br>
</body>
</html>

--------------050901060808020509080805--
Re: cannot generate model code [message #50345 is a reply to message #50168] Mon, 18 September 2006 16:02 Go to previous message
Eclipse UserFriend
I found why I can't validate my ecore because the validation feature is
enable in single object
and can't be run on the top of ecore when opening the ecore editor.

Now, I know the problem was due to one of object missing eReference.
Thank you Ed Merks !

"Ed Merks" <merks@ca.ibm.com> ???????:eemo0o$7p2$1@utils.eclipse.org...
Meilin,

When code generation fails to generate, there typically is some information
about this in the error log. Have you looked at the error log?

In the Ecore editor, you can right click on any object and ask to validate
it but there are still many constraints not being checked, i.e.,
https://bugs.eclipse.org/bugs/show_bug.cgi?id=75933 isn't done yet. A
common cause for failure is an EPackage without an nsURI or name, or an
EStructuralFeature without an eType.


exquisitus wrote:
Hi Christian,

Thanks for you help.

I would like to see the warnings but it doesn't show any warning or error
after by clicking gnerate model code.
I also like to validate my ecore model but I can't find where the validation
tool.
If you don't mind, please describe more detail about validation step.

Thank you!
Meilin

"Christian Barth" <dont@spam.net> ???????:eegms0$hcg$1@utils.eclipse.org...

Hi Meilin,

did you check your error log after (try to) generating the code? I guess
there will be some Warnings (containing a Null Pointer Exception :) ).

Is your model valid? You can start the validation by opening your ecore
model and then select "Sample Ecore Editor"->Validate in the menu.

I had a NPE as well. The validation tool told me that I have forgot to set
some values in a Reference Element. After fixing the problem I was able to
generate the other models and the code without any error.

Cheers
Christian
Previous Topic:Adding custom decorators to an EditPart
Next Topic:Diagram Initialization
Goto Forum:
  


Current Time: Wed Apr 16 10:38:51 EDT 2025

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

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

Back to the top