Hi. I have a project and I’m trying to use grails ...
# questions
u
Hi. I have a project and I’m trying to use grails 7.0.0-M5 with spring security core 7.0.0-M4. When I try to go on login page I receive this error: Message: Error creating bean with name ‘grails.plugin.springsecurity.LoginController’: Failed properties: Property ‘grailsLayoutSelector’ threw exception: java.lang.AbstractMethodError; Property ‘grailsRenderViewMutator’ threw exception: java.lang.AbstractMethodError Caused by: Failed properties: Property ‘grailsLayoutSelector’ threw exception: java.lang.AbstractMethodError; Property ‘grailsRenderViewMutator’ threw exception: java.lang.AbstractMethodError Someone could help me?
j
Spring Security Core 7.0.0-M5 should be ready soon now that Core 7.0.0-M5 has been released. This looks related to https://docs.grails.org/snapshot/guide/single.html#_12_14_grails_layout_configuration
u
Ok. I’ll try again when security M5 is released
j
because the rest responder trait had hard coded references we had to decouple those references in m5; i intend to do the prep release for redis and spring security this week
j
I'm getting this problem or an extremely similar one myself on a Grails 7.0.0-M5 app upgraded from 6.2.3, triggered by an interceptor. But I'm not using Spring Security at all. Caused by: org.springframework.beans.PropertyBatchUpdateException: Failed properties: Property 'grailsLayoutSelector' threw exception: groovy.lang.MissingMethodException: No signature of method: grails.artefact.controller.support.ResponseRenderer$Trait$Helper.setGrailsLayoutSelector() is applicable for argument types: (s.SecurityInterceptor, o.a.g.w.l.LayoutSelector) values: [socialsupermarket.SecurityInterceptor@1ff1b403, org.apache.grails.web.layout.LayoutSelector@a2ac2d2]; Property 'grailsRenderViewMutator' threw exception: groovy.lang.MissingMethodException: No signature of method: grails.artefact.controller.support.ResponseRenderer$Trait$Helper.setGrailsRenderViewMutator() is applicable for argument types: (s.SecurityInterceptor, o.a.g.w.l.GrailsLayoutRenderViewMutator) values: [socialsupermarket.SecurityInterceptor@1ff1b403, org.apache.grails.web.layout.GrailsLayoutRenderViewMutator@4b2837d4]
j
which plugins are you using? its likely you have a plugin compiled with a previous version of 7.0.0 because we reverted sitemesh in m5
j
This is the list of project specific dependencies from build.gradle: //Project specific runtimeOnly 'mysqlmysql connector java5.1.46' implementation 'com.opencsvopencsv5.5.2' implementation 'org.apache.groovygroovy dateutil4.0.27' implementation 'org.apache.groovygroovy datetime4.0.27' implementation 'com.nimbusdsnimbus jose jwt8.3' //Project specific plugins implementation "org.grails.pluginsasync7.0.0-M3" implementation "org.grails.pluginsgrails mail5.0.0" implementation "org.springframework.boot:spring-boot-starter-websocket"
I've started with 'grails create-app', and am bit by bit adding in the various domain classes, controllers, etc., in the hope of finding what breaks it.
j
its mail
we haven’t updated it
j
Ha, I was just about to point a finger at that! I added in the dependencies and got the errors on restart, before any other classes had been added in. I'm glad it's a single plugin which is responsible, because it gives me more hope for the rest of the conversion.
I can work around that for now.
j
we knew this latest revert would be a breaking change
i intend to move code out of the traits longer term to prevent this in the future
it will probably be grails 8 when we do that though
j
I'll use Spring's JavaMailSender for emails in the meantime, until the Mail plugin gets updated. Straightforward enough.
Well, the good news is that I stripped out the Mail plugin and wrote a new MailService class which uses Spring's JavaMailSender, and have altered my code to use that. The bad news is that the application still won't run, with what looks like a very similar error,
j
You have a gsp project right?
or do you not include that dpenedency?
j
This is my dependencies block from build.gradle. To be clear, I've gone back to the version generated from application forge, with all my classes in place. dependencies { implementation platform("org.apache.grailsgrails bom$grailsVersion") developmentOnly("org.springframework.boot:spring-boot-devtools") integrationTestImplementation testFixtures("org.apache.grails:grails-geb") console "org.apache.grails:grails-console" implementation "org.springframework.boot:spring-boot-starter-logging" implementation "org.springframework.boot:spring-boot-starter-validation" implementation "org.springframework.boot:spring-boot-autoconfigure" implementation "org.springframework.boot:spring-boot-starter" implementation "org.apache.grails:grails-core" implementation "org.springframework.boot:spring-boot-starter-actuator" implementation "org.springframework.boot:spring-boot-starter-tomcat" implementation "org.apache.grails:grails-web-boot" implementation "org.apache.grails:grails-logging" implementation "org.apache.grails:grails-rest-transforms" implementation "org.apache.grails:grails-databinding" implementation "org.apache.grails:grails-i18n" implementation "org.apache.grails:grails-services" implementation "org.apache.grails:grails-url-mappings" implementation "org.apache.grails:grails-interceptors" implementation "org.apache.grails:grails-scaffolding" implementation "org.apache.grails:grails-data-hibernate5" implementation "org.apache.grails:grails-gsp" profile "org.apache.grails.profiles:web" runtimeOnly "com.h2database:h2" runtimeOnly "com.zaxxer:HikariCP" runtimeOnly "cloud.wondrify:asset-pipeline-grails" testAndDevelopmentOnly "org.webjars.npm:bootstrap" testAndDevelopmentOnly "org.webjars.npm:bootstrap-icons" testAndDevelopmentOnly "org.webjars.npm:jquery" testImplementation "org.apache.grails:grails-testing-support-datamapping" testImplementation "org.apache.grails:grails-testing-support-web" testImplementation "org.spockframework:spock-core" //Project specific runtimeOnly 'mysqlmysql connector java5.1.46' implementation 'com.opencsvopencsv5.5.2' implementation 'org.apache.groovygroovy dateutil4.0.27' implementation 'org.apache.groovygroovy datetime4.0.27' implementation 'com.nimbusdsnimbus jose jwt8.3' //Project specific plugins implementation "org.grails.pluginsasync7.0.0-M3" //implementation "org.grails.pluginsgrails mail5.0.0" implementation 'com.sun.mailjakarta.mail2.0.1' implementation 'org.springframework.boot:spring-boot-starter-mail' implementation "org.springframework.boot:spring-boot-starter-websocket" }
j
implementation "org.apache.grails:grails-gsp" should include grails-layout, which should have the file that's missing
err
Async is 7.0.0-M3 ?
Async should be using the same as grailsVersion now. You can drop it's version # since it's in the bom
j
OK. Not sure whether your first sentence is a question.
j
the error you're getting is b/c we introduced an interface to let end users choose between sitemesh2 & sitemesh3
that interface should be included by including grails-gsp
but hte erorr you're getting is acting like it's not
if you remove async does it continue to occur?
i also assume you've updated your gradle plugins?
j
Changing to implementation "org.grails.plugins:async" results in * What went wrong: Execution failed for task ':configureGroovyCompilerGrailsCore'.
Could not resolve all files for configuration ':runtimeClasspath'.
> Could not find org.grails.pluginsasync. Required by: root project :
j
it's org.apache.grails:grails-async
the upgrade guide points to this, but there's a script that helps automate these changes
i'm guessing there' some edge case that didn't change that one if you used it?
the full list of what changed to what is here: https://github.com/apache/grails-core/blob/7.0.x/RENAME.md
j
This was an entirely new Grails 7.0.0-M5 from the application forge into which I copied my existing source, so I would not have thought any Gradle plugins would need updating? Anyway, the good news again is that the async plugin change got me past that issue (thanks!) but I've run into another one: Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled. 2025-07-24 153430.888 ERROR --- [ restartedMain] o.s.boot.SpringApplication : Application run failed java.lang.StackOverflowError: null at org.springframework.transaction.interceptor.DefaultTransactionAttribute.<init>(DefaultTransactionAttribute.java:62) at org.springframework.transaction.interceptor.RuleBasedTransactionAttribute.<init>(RuleBasedTransactionAttribute.java:62) at org.grails.datastore.mapping.transactions.CustomizableRollbackTransactionAttribute.<init>(CustomizableRollbackTransactionAttribute.java:46) at socialsupermarket.AuthService.getTransactionManager(AuthService.groovy) at socialsupermarket.AuthService.getTransactionManager(AuthService.groovy) at socialsupermarket.AuthService.getTransactionManager(AuthService.groovy) at socialsupermarket.AuthService.getTransactionManager(AuthService.groovy) at socialsupermarket.AuthService.getTransactionManager(AuthService.groovy) at socialsupermarket.AuthService.getTransactionManager(AuthService.groovy) at socialsupermarket.AuthService.getTransactionManager(AuthService.groovy) at socialsupermarket.AuthService.getTransactionManager(AuthService.groovy) at socialsupermarket.AuthService.getTransactionManager(AuthService.groovy) at socialsupermarket.AuthService.getTransactionManager(AuthService.groovy) at socialsupermarket.AuthService.getTransactionManager(AuthService.groovy) at socialsupermarket.AuthService.getTransactionManager(AuthService.groovy) at socialsupermarket.AuthService.getTransactionManager(AuthService.groovy) at soci etc
Haven't examined this yet.
j
Sounds like we missed updating that one in forge then
Not sure I recognize that class - my guess is that's your code?
j
Yes, AuthService is my code, but it was working fine in 6.2.3. Not sure what the stack overflow with getTransactionManager might be.
j
That one i'm not sure on
I haven't seen that in any of our example applications
@James Fredley Can you help update grails forge so that async is referred to properly? sounds like we need to update forge
j
OK, I had introduced a (presumably?) redundant @Service annotation in the AuthService class (which is in /services anyway). Having got rid of that, my app now starts up! Woohoo! Massive thanks for the help getting me to this point.
j
You're welcome and thanks for being patient as we iron out these early milestone releases.
we'll likely have an RC1 in August given the overall status so it's a good time to test the milestone
j
The great news is that I have now moved on to the point where I'm able to address idiot bugs in my own code 😀 .
😂 1
j
grails-forge does not add grails-async explicitly by default (no async or events) or with any of the optional features. grails-forge has done this since 6.0.0. And it is not provided transitively by any of the default dependencies. There have been a few conversations about this and I believe it was left that it would be provided by plugins that require it. https://github.com/apache/grails-spring-security/blob/7.0.x/plugin-core/plugin/build.gradle provides it And a few here https://github.com/search?q=repo%3Aapache%2Fgrails-core+grails-async+language%3AGradle&amp;type=code&amp;l=Gradle&amp;p=1 the rest-api and rest-api-plugin profiles include it currently, although rest-api profile doesn't match forge, which is an oversight since that is a leftover from Grails 5.
j
it must have come from @John Moore's app then or something