Problem solved:
The file(s) of the text file:
C:\Users\XXX\AppData\Roaming\MathWorks\MATLAB\R2017b\javaclasspath.txt
Which is in my case:
C:\ProgramData\MATLAB\SupportPackages\R2017b\3P.instrset\mongodb.instrset\MongoDriver\mongo-java-driver-3.4.1.jar
Has / have to be added before compiling to the XXX.prj
AND for the special error above. The file:
C:\Program Files\MATLAB\R2017b\toolbox\database\database\+database\+internal\+utilities\charArrayDisp.m
has to be added as well to the XXX.prj