After some investigation, this problem is caused by a class that has been entirely commented.
For example:
//package xxx.xxxx.xxxxx;
////
//public class Test {
////
//}
If you put a class like this in your domain package, the generation process fails.
Well, on the other hand, this kind of classes wouldn't have to exist in your project.