StackOverflowError is thrown when loading an entity with an ID that is an bidirectional eager one-to-one association has FetchMode.SELECT mapped, as in the following:
This happens when loading by ID using a query and when loading by primary key with EntityManager#find.
In addition, loading by ID using EntityManager#find fails with FetchMode.SELECT, whether lazy or eager due to HHH-14389.