grails / grails-database-migration

Grails® framework Database Migration Plugin
Apache License 2.0
99 stars 116 forks source link

EnversService#initialize should be called only once #204

Open xavs opened 2 years ago

xavs commented 2 years ago

Task List

Steps to Reproduce

  1. Grails 4.X.X project
  2. Hibernate Envers used. Annotate some domain with @Audited
  3. Any command via grails grails prod dbm-gorm-diff or ./gradlew :runCommand -Pargs="dbm-generate-gorm-changelog " --info --stacktrace

Expected Behaviour

plugin task is performed

Actual Behaviour

Grails application running at http://localhost:0 in environment: development
Command execution error: EnversService#initialize should be called only once

> Task :runCommand FAILED
:runCommand (Thread[Execution worker for ':',5,main]) completed. Took 14.215 secs.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':runCommand'.
> Process 'command '~/.sdkman/candidates/java/8.0.265-open/bin/java'' finished with non-zero exit value 1
Command execution error: EnversService#initialize should be called only once`

Environment Information

Example Application

davebrown1975 commented 1 year ago

Any comment on this issue? This is STILL present in Grails 5

verglor commented 1 year ago

As a workaround it's possible to disable hibernate-envers with configuration hibernate.integration.envers.enabled = false.