After upgrading hibernate from version 5 to 6.5,hibernate.cfg.Configuration.addAttributeConverter method return type has changed

We are upgrading our app from hibernate 5.6.15 to 6.5 version, but encountering this error

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘sessionFactory’ defined in ServletContext resource [/WEB-INF/email_ws_spring.xml]: ‘void org.springframework.orm.hibernate5.LocalSessionFactoryBuilder.addAttributeConverter(java.lang.Class)’

Also,I have noticed that the hibernate.cfg.Configuration.addAttributeConverter method’s return type got changed from void to Configuration from hibernate 6.2+ , so what can i do now to resolve this issue?
Thanks in advance.

I’m not sure what the problem is, since you’re not sharing the full stack trace of the error, but it looks like you might be using a version of Spring which is not compatible with newer Hibernate versions. Please ensure you’re using compatible library versions.

Also,I have noticed that the hibernate.cfg.Configuration.addAttributeConverter method’s return type got changed from void to Configuration from hibernate 6.2+

I don’t see why this would be a problem on Hibernate’s side.