Actually the Java codes are generated using an annotation processor. But even if I move the generated source codes into the main source folder, I still get such errors frequently even though there is nothing wrong with the source code itself. So I suspect it's because of my mixing of the two languages together.