I am getting javax.persistence.EntityNotFoundException error when I am trying to get User through Invoice object
invoice.getUser().getId()
Not sure if that applies to your case.
But I had a similar issue where I updated directly in the database table X and set a field null, but in java class the field was @NotNull.
So when another class Y had a X object with ManyToOne, it wasn't able to load the entity because of the null value in the entity.