NullPointerException during iteration on a List

Description

The following NullPointerException occurs when iterating on a List of object loaded by Hibernate:

My field declaration is:

The setter method in which the NPE occurs:

NPE occurs during a call on the Session.merge method:

The getSession() method is a utility method which create a new Session from the SessionFactory.

After taking a look at the org.hibernate.engine.internal.StatefulPersistenceContext code, it seems that the problem comes from:

The CollectionEntry ce returned by getCollectionEntry is null.

Environment

Windows 7, MySQL 5.6.25-enterprise-commercial-advanced, connectorJ driver, Java version 1.8.0_131

Assignee

Unassigned

Reporter

Vincent Fischer

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure