https://grails.org/ logo
Join Slack
Powered by
# questions
  • j

    jdaugherty

    08/16/2025, 9:48 PM
    isn’t config a property on grailsApplication? does it work if you change [‘config’] to .config ?
    g
    m
    • 3
    • 3
  • d

    domix

    08/17/2025, 9:15 PM
    Hello! I just created a fresh Grails 7.0-RC1 application with Forge
    j
    • 2
    • 16
  • g

    gaolei

    08/18/2025, 4:06 AM
    Hello community, me again, Still try to upgrade one of my products to grails 7, getting close, but still have issues: Now I have this error:
    Copy code
    Users_lei_[project_folder]_grails_app_views_layouts_main_gsp$_run_closure1$_closure9$_closure17.doCall(Users_[project_folder]_grails_app_views_layouts_main_gsp:24)
    	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
    	at org.grails.taglib.TagBodyClosure.executeClosure(TagBodyClosure.java:203)
    	at org.grails.taglib.TagBodyClosure.captureClosureOutput(TagBodyClosure.java:105)
    	at org.grails.taglib.TagBodyClosure.call(TagBodyClosure.java:216)
    	at org.grails.plugins.web.taglib.GrailsLayoutTagLib.captureTagContent(GrailsLayoutTagLib.groovy:53)
    	at org.grails.plugins.web.taglib.GrailsLayoutTagLib$_closure6.doCall(GrailsLayoutTagLib.groovy:213)
    	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
    	at org.grails.gsp.GroovyPage.invokeTagLibClosure(GroovyPage.java:449)
    	at org.grails.gsp.GroovyPage.invokeTag(GroovyPage.java:367)
    	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
    	at org.codehaus.groovy.vmplugin.v8.IndyInterface.fromCache(IndyInterface.java:321)
    	at Users_[project_folder]_grails_app_views_layouts_main_gsp$_run_closure1$_closure9.doCall(Users_[project_folder]_grails_app_views_layouts_main_gsp:27)
    	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
    	at org.grails.taglib.TagBodyClosure.executeClosure(TagBodyClosure.java:203)
    	at org.grails.taglib.TagBodyClosure.captureClosureOutput(TagBodyClosure.java:105)
    	at org.grails.taglib.TagBodyClosure.call(TagBodyClosure.java:216)
    	at org.grails.plugins.web.taglib.GrailsLayoutTagLib$_closure7.doCall(GrailsLayoutTagLib.groovy:231)
    	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
    	at org.grails.gsp.GroovyPage.invokeTagLibClosure(GroovyPage.java:449)
    	at org.grails.gsp.GroovyPage.invokeTag(GroovyPage.java:367)
    	... 40 common frames omitted
    Caused by: java.lang.NullPointerException: Cannot invoke "com.opensymphony.module.sitemesh.Page.getTitle()" because the return value of "org.codehaus.groovy.runtime.InvokerHelper.invokeMethodSafe(Object, String, Object)" is null
    	at org.grails.plugins.web.taglib.RenderGrailsLayoutTagLib$_closure4.doCall(RenderGrailsLayoutTagLib.groovy:319)
    	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
    	at org.grails.gsp.GroovyPage.invokeTagLibClosure(GroovyPage.java:442)
    	at org.grails.gsp.GroovyPage.invokeTag(GroovyPage.java:367)
    	... 63 common frames omitted
    
    Caused by: java.lang.NullPointerException: Cannot invoke "com.opensymphony.module.sitemesh.Page.getTitle()" because the return value of "org.codehaus.groovy.runtime.InvokerHelper.invokeMethodSafe(Object, String, Object)" is null
    I am using sitemesh 2 with
    Copy code
    implementation "org.apache.grails:grails-layout"
    I compared my project settings with a working grails 7 sample app(sitemesh2 and grails-layout), i can not tell difference BTW: I found claude code helped quite a bit when you do the upgrations.
    j
    • 2
    • 3
  • s

    Steve Osguthorpe

    08/19/2025, 8:53 AM
    Hello... I'm after information on the EOL of Grails 6. Is Grails 6 still supported/updated or is it officially in maintenance with 7 being the ONLY community supported version. We need to update a few projects with this information and I'm not sure of the answers given the move to community support.
  • s

    Steve Osguthorpe

    08/19/2025, 8:56 AM
    And if there is a timeline for support of 7, i.e. when it'll be maintenance and when 8 is planned and EOL's etc that would be useful. I'm assuming that it will be less frequent than a (bi)yearly pre-planned release and will likely be 7 will be the main version until we need 8 and the timeline become more reactive?
    j
    • 2
    • 16
  • p

    pablo.pazos

    08/19/2025, 9:30 PM
    Hi all, quick question: is is possible to define a DATE(x) over a datetime field? (in the domain I have Date x, and DATE(x) is only the yyyy-mm-dd part, not the full datetime)
    g
    p
    m
    • 4
    • 18
  • p

    pablo.pazos

    08/21/2025, 4:50 AM
    Hi all, I'm trying to make a Date x map to date in MySQL instead of datetime(6). I tried mapping type, sqlType and formula, none of those are taken by $ grails dbm-gorm-diff (which checks changes on the domain and generates the migration scripts, it's generating just an empty changeSet). What am I doing wrong?
    b
    j
    • 3
    • 3
  • g

    gaolei

    08/21/2025, 7:44 PM
    Another Grails 7 question. Seemed it will not correctly pick the application.yml if I do (java 24, grails 7.0.0-RC1)
    Copy code
    gradle bootRun
    However, if I do
    Copy code
    gradle run
    application.yml will be correctly picked. ?
    j
    b
    • 3
    • 7
  • a

    Arjang

    08/22/2025, 6:28 PM
    Just wondering, main.gsp always comes with
    Copy code
    <a class="navbar-brand" href="/#">
    Does that work for you? I always have to change it to
    Copy code
    <a class="navbar-brand" href="${createLink(uri:'/')}">
    j
    • 2
    • 3
  • c

    cjchalmers

    09/01/2025, 7:45 PM
    I am trying to implement a simple event publishing solution but fear I am barking up the wrong tree. I am using version 6.2.3. Basically I want to send emails when certain events take place (password change or reset) and thought publishing an event to a listener that subsequently sends the email would make sense. However the code I currently have is based on the Spring "ApplicationEventPublisher" and a listener on the Spring "@EventListener". In addition to this my listener is based under ./src/main/groovy as a Spring Component. Needless to say this is not working. The publish code runs but the Listener is either not running or at least not listening for an event. I saw the following docs - https://async.grails.org/latest/guide/index.html#notifying Does anyone have a simple example/pointers how to get this working? Basically I want to have a service that will Publish an Event after-which a generic Email Service can listen and act on this and take care of sending. The user wont notice any delay etc Much appreciated if someone can help me out
    j
    • 2
    • 4
  • c

    cjchalmers

    09/02/2025, 9:26 AM
    I am looking at integrating additional (Spring) beans under src/main/groovy It was my understanding that I could just annotate these with @Component and they'd be picked up. This doesn't seem to work for me. I can add them in the resources.groovy file and they would work there, albeit with constructor/method injection configured Is my understanding misplaced or do I have a config issue my side?
    s
    • 2
    • 2
  • r

    rss

    09/02/2025, 7:24 PM
    Swagger ui crashing(out of memory) in Springdoc + Grails/Groovy I'm trying to create a simple API with swagger documentation. I have this controller: @RestController @RequestMapping("/api/v1/authTest") @Tag(name = "Auth", description = "Endpoints") class AuthTest{ LoginAuth loginAuth @PostMapping("/token") @Operation(summary = "token test") AuthToken token(@RequestBody CredentialsAuth credentials) { try { return loginAuth.autenticate(credentials) } catch (ApiAuthException e) { throw new...
  • c

    cjchalmers

    09/03/2025, 8:08 PM
    I have a Grails 6.2.3 app, based on the API profile. One part of functionality is to send emails to users, for example for passwordResets. I do this using a gsp template. I added the following in Gradle next to json views to make that work • implementation "org.grails.plugins:gsp" Locally all works fine, now I am deploying to a test server as a bootable Jar and it's as though the template is not being compiled into the jar file. Does anyone have experience with this? Am I missing a dependency/plugin config? Is there an alternative to gsp templates? Any help/pointers much appreciated.
  • j

    jdaugherty

    09/03/2025, 8:08 PM
    You need to apply teh grails-gsp gradle plugin
    c
    • 2
    • 1
  • j

    jdaugherty

    09/03/2025, 8:08 PM
    so the gsps are compiled into the war / jar
  • r

    rss

    09/04/2025, 6:34 PM
    Groovy/Grails Ambiguous mapping error with springdoc swagger This is my controller package example.infra.adapters.input.api.v1.endpoints import example.aplication.services.authentication.LoginAuthenticator import example.aplication.dtos.authentication.CredencialsDTO import example.aplication.dtos.authentication.AuthenticationTokenDTO import example.aplication.exceptions.authentication.AuthenticationErrorException import org.springframework.web.bind.annotation.* import org.springframework.http.ResponseEntity import...
  • a

    Arjang

    09/07/2025, 2:03 PM
    Not terribly important, I don’t know how to suppress java 24 warnings
    Copy code
    WARNING: A restricted method in java.lang.System has been called
    WARNING: java.lang.System::loadLibrary has been called by org.fusesource.hawtjni.runtime.Library in an unnamed module (file:/.../.sdkman/candidates/grails/7.0.0-RC1/lib/grails-cli-7.0.0-RC1-all.jar)
    Should i suppress it? I am not sure what is correct action is.
    j
    • 2
    • 1
  • m

    matt.aguirre

    09/08/2025, 7:43 PM
    Does anyone here use spotbugs and if so, how do you configure it to run and analyze a grails project? I am attempting to do so w/ a grails 6.2.3 project.
    j
    s
    • 3
    • 2
  • u

    user

    09/12/2025, 8:55 AM
    Hi. I have some problems with RC2 release. I have dasboard.gsp like this
    Copy code
    <!doctype html>
    <html>
    <head>
        <meta name="layout" content="logged"/>
    </head>
    <body>
    <sec:access expression="!hasRole('ROLE_ESERCENTE')">
        <g:include controller="domanda" action="index"/>
    </sec:access>
    <sec:access expression="hasRole('ROLE_ESERCENTE')">
        <g:include controller="domanda" action="index"/>
    </sec:access>
    </body>
    </html>
    and logged.gsp like this
    Copy code
    <!doctype html>
    <html>
        <head>
            <meta charset="utf-8">
            <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
            <meta name="description" content="">
            <title><g:layoutTitle default="Taxcredit"/></title>
            <script nonce="${request.getAttribute('cspNonce')}">window.__PUBLIC_PATH__ = '${createLink(uri: '/')}' + 'assets/fonts'</script>
            <asset:stylesheet src="application.css"/>
            <script src="<https://cdn.jsdelivr.net/npm/autonumeric@4.1.0>"></script>
            <asset:javascript src="application.js"/>
    
            <link href="<https://cdn.datatables.net/v/dt/dt-2.3.4/r-3.0.6/sc-2.4.3/datatables.min.css>" rel="stylesheet" crossorigin="anonymous">
    %{--        <script type="text/javascript" src="<https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.36/pdfmake.min.js>"></script>--}%
    %{--        <script type="text/javascript" src="<https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.36/vfs_fonts.js>"></script>--}%
            <script src="<https://cdn.datatables.net/v/dt/dt-2.3.4/r-3.0.6/sc-2.4.3/datatables.min.js>" crossorigin="anonymous"></script>
    
            <asset:link rel="shortcut icon" href="favicon_32_mibact.png" type="image/x-icon"/>
            <g:layoutHead/>
        </head>
        <body class="logged">
    .......
    but the result html is
    Copy code
    <!doctype html>
    <html>
    <grailsLayout:captureHead>
        <grailsLayout:captureMeta gsp_sm_xmlClosingForEmptyTag="/" name="layout" content="logged"/>
    </grailsLayout:captureHead>
    <grailsLayout:captureBody>
    
        <html>
        <grailsLayout:captureHead>
            
            <grailsLayout:wrapTitleTag><grailsLayout:captureTitle>Domanda Elenco</grailsLayout:captureTitle></grailsLayout:wrapTitleTag>
            <grailsLayout:captureMeta gsp_sm_xmlClosingForEmptyTag="/" name="layout" content="logged"/>
        </grailsLayout:captureHead>
    
    <grailsLayout:captureBody>
    It doesn’t seem to loading javascript and css from head… With M5 release it works.
  • u

    user

    09/12/2025, 9:12 AM
    Why there is <grailsLayout:captureHead> instead of <head>?
    j
    u
    • 3
    • 7
  • s

    Stephen Lynch

    09/12/2025, 10:29 AM
    After the RC2 release, I'm not seeing grails-i18n RC2 artifact in maven central or repo.grails.org ?
    t
    j
    • 3
    • 3
  • a

    Arjang

    09/13/2025, 1:44 PM
    I am getting errors with command stop-app. Is this the same issue as https://github.com/apache/grails-core/issues/13695 or should i create a new ticket?
    Copy code
    grails> stop-app --stacktrace
    | Shutting down application...
    | Error Application not running. (NOTE: Stack trace has been filtered. Use --verbose to see entire trace.)
    java.io.FileNotFoundException: <http://localhost:8080/actuator/shutdown>
    	at stop-app.run(stop-app.groovy:87)
    	at org.grails.cli.profile.commands.script.GroovyScriptCommand.handle(GroovyScriptCommand.groovy:156)
    	at org.grails.cli.profile.AbstractProfile.handleCommand(AbstractProfile.groovy:478)
    	at org.grails.cli.GrailsCli.handleCommand(GrailsCli.groovy:364)
    	at org.grails.cli.GrailsCli$_handleCommandWithCancellationSupport_closure6.doCall(GrailsCli.groovy:455)
    	<===========--> 90% EXECUTING [6m 13s]
    | Error Application not running.
    grails>
    j
    • 2
    • 1
  • a

    Arjang

    09/14/2025, 12:34 AM
    Which grails-spring-security should i use? There are 2 MVN repos A) https://mvnrepository.com/artifact/org.apache.grails/grails-spring-security runtimeOnly ‘org.apache.grailsgrails spring security7.0.0-RC2’ B) https://mvnrepository.com/artifact/org.springframework.security/spring-security-core implementation ‘org.springframework.securityspring security core7.0.0-M2’
  • j

    James Fredley

    09/14/2025, 12:45 AM
    A
  • l

    lraynal

    09/17/2025, 2:15 PM
    Hi all, I have a RC2 question : In a Service, I have an @Autowired micronaut http declarative @Client The ServiceUnitTest is giving me
    Copy code
    expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
  • l

    lraynal

    09/17/2025, 2:21 PM
    Something changed from v6 ?
    j
    j
    • 3
    • 4
  • b

    billgonemad

    09/17/2025, 8:07 PM
    Was there a change with GORM setting the default mapping (upgrading to 7.0.0-RC2 currently)? We had a runtime.groovy file like this
    Copy code
    grails.gorm.default.mapping = {
        autowire true
    }
    but it doesn't appear to be getting picked up and the beans are not being injected into the domain class. Adding to the mapping block on the domain appears to work however.
    j
    g
    • 3
    • 5
  • j

    James Fredley

    09/17/2025, 9:50 PM
    set the channel topic: Grails questions. Please ask them on https://lists.apache.org/list.html?users@grails.apache.org and paste the SO link here. That way history is retained and it is searchable. Slack is NOT!
  • j

    James Fredley

    09/17/2025, 10:35 PM
    set the channel topic: Grails questions. Please ask them on https://lists.apache.org/list.html?users@grails.apache.org and paste the link here. That way history is retained and it is searchable. Slack is archived on https://www.linen.dev/s/grails/c/general
  • j

    James Fredley

    09/17/2025, 10:35 PM
    set the channel topic: Grails questions. Please ask them on https://lists.apache.org/list.html?users@grails.apache.org and paste the link here. That way history is retained and it is searchable. Slack is archived on https://www.linen.dev/s/grails/c/questions