Leinster and Ireland have suffered a blow after it was confirmed that Sean O'Brien will miss four months due to shoulder surgery.