Skip to content

factory_class: 'org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory' loads hibernate5 non-jakarta #14721

Open
@jamesfredley

Description

@jamesfredley

Document this in the upgrade guide.

When factory_class: 'org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory' is present in application.yml, the org.hibernate:hibernate-ehcache dependency is loaded with the non-jakarta version of hibernate-core which causes method not found errors given Grails 7 uses the Jakarta version.

hibernate:
    allow_update_outside_transaction: true
    cache:
        queries: false
        use_second_level_cache: true
        use_query_cache: false
        region:
            factory_class: 'org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory'

The workaround is to define the org.hibernate:hibernate-ehcache dependency directly with the exclude, but we need to identify what is loading it and attempt to exclude the non-jakarta version of hibernate-core by default.

https://github.com/grails-plugins/grails-audit-logging-plugin/pull/244/files/7892e9cbde72a07438bf3b416b6b6f0457bcbe96#diff-0940648752e294ad17fe3e7b76f2999bee97caa527f5e5036a0d47f743f22805R38

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Todo

Relationships

None yet

Development

No branches or pull requests

Issue actions