Hibernate setting up AttributeConverters before EntityManagerFactory is available under Wildfly

Description

The EntityManagerFactory is needed to build a Repository which is being injected into the AttributeConverter. e.g.

This triggers the following exception:

I am using the following configuration to provide Hibernate the set of SpringBeans for CDI:

If I try a non-constructor injection approach in my ExampleAttributeConverter e.g.

Then exampleRepository is never set and is constantly null when the AttributeConverter methods are invoked.

Environment

Spring: 5.1.7.Release
Wildfly: 10.1.0-Final
Hibernate: 5.3.7.Final

Status

Assignee

Unassigned

Reporter

Rooshan Aslam

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