So I created my grammar xtext in which I declared a part View, a part Model, and another for controller (MVC), then I generated my model and now I'm modeling using Sirius I created Also my palette, and I was able to drag items, but my problem is when I want to save my diagram, I always have an error " Save Failed
Java.lang.NullPointerException ".
I don't know why this error and how to solve it, thank you for helping me.
Asked
Active
Viewed 134 times
0

Senoussaoui Ikram
- 197
- 1
- 1
- 9
-
Look in the .log file in the workspace .metadata directory to see is there is a more detailed stack trace. If there is edit your question and add the trace. – greg-449 Mar 07 '17 at 14:32
1 Answers
0
It might be (but without the actual stacktrace it's speculation) that your model in memory does not fit the constraints imposed by your grammar. Another way to put it is: your grammar can't seraialize the model in the state it is. Let's imagine you are working with Java, and you have an instance of a JavaClass in memory but no name for it, then the Java grammar won't allow to serialize it as the name in
public class Name {
}
is mandatory.
If you are not yet aware of this presentation you might want to have a look at it as it covers most of the issues you have to handle when mixing Sirius and Xtext.

Cédric Brun
- 376
- 1
- 6