EntityManagerFactory build doesn't catch Error

Hi,

I migrate my app to hibernate 6 and got some issues.
The console shows

Error creating bean with name ‘entityManagerFactory’ defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: null

Not very eloquente.
I found that in EntityManagerFactoryBuilderImpl.build() it catchs Exception but the problem came from ToOneAttributeMapping.createTableGroupJoin().
It failed on

assert !( lhs instanceof PluralTableGroup );

which is an Error thus not cought by the try/catch.

Hello, that assertion failing tells me there’s probably something wrong with your mappings. Could you please share more details about your specific case? We’re going to need to see how you are declaring at least the to-one property that fails the assertion, but you can just paste the whole entity classes involved so we can try to figure out what’s going on.

I solved the problem it was
Error (worked on hibernate 5)

    @OneToMany(fetch = FetchType.EAGER,
            mappedBy = "myfield"
    )

Correct

@OneToMany(fetch = FetchType.EAGER)
@JoinColumn(name = "id_myfield")

But I wanted just to warn you with the lack of information due to the AssertionError not cought thus got “null”.