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

    user

    09/18/2025, 10:03 AM
    Our project is currently using M3 and a colleague of mine had created an experimental branch using RC2 using workarounds to we are not pushing to any external environment, yet.
    j
    j
    +5
    • 8
    • 12
  • m

    Marc Fishman

    09/18/2025, 4:00 PM
    Hi all! We are using Grails 5, and we use namedQueries pretty extensively. Specifically, we're using them a lot to chain lots of small criteria together to make for really flexible, fluid, and reusable query logic. We've been trying to move away from them and toward more
    where
    queries, as namedQueries are deprecated and not supported in Grails 6+ (from my understanding), but we're finding the lack of ability to chain them together really limiting. I'm curious if others have any similar experience or alternative suggestions. I've gone through lengthy discussions with ChatGPT and was kind of disappointed with the results. Any thoughts, ideas, or best practices welcome!
    j
    • 2
    • 1
  • s

    Stephen Lynch

    09/18/2025, 8:16 PM
    @James Fredley Your fix for https://github.com/apache/grails-core/issues/15078 just reminded me to check one of my apps to see if I had the same issue in RC2. I noticed something else whether this is intentional or not. Adding the migration plugin adds an extra 49 jars to the war file (tested on your example project attached the the above issue). It seems the migration plugin is pulling in the grails-shell-cli which in turn is pulling in a lot of dependencies. Is the grails-shell-cli required at runtime?
    j
    • 2
    • 5
  • u

    user

    09/21/2025, 6:34 PM
    Grails-7 questions. currently when I run my app as executable war file I have to do this in my build.gradle:
    Copy code
    bootWar {
        from('grails-app/views') {
            into 'WEB-INF/grails-app/views'
        }
    Copy code
    }
    u
    j
    +9
    • 12
    • 43
  • u

    user

    09/21/2025, 6:39 PM
    Or the gsp view can not be resolved. Also with war mode, i18n messages can not be loaded correctly. The whole setting(application.yml) and build.gradle works correct with grails 6.
  • u

    user

    09/22/2025, 2:16 PM
    I have an internal grails plugin that has some tests that require domain entities. These domain entities are only required to test the plugin code and are not useful to the main project. Is there a way to configure either (a) move test-domain entities out of grails-app/domain and later promote them to domain object when under test environment - or (b) suppress these from being dragged into the main project somehow? Thx
    j
    u
    +4
    • 7
    • 21
  • b

    billgonemad

    09/22/2025, 2:58 PM
    Working on upgrading to Grails 7 and seems the app will not auto generate the SSL cert like previous versions when running in development mode. I have worked around this by generating a cert myself and including the proper config in my application-development.yml file. By am wondering, is there a way to get the app to generate this like previous versions?
    Copy code
    |Generating SSL certificate
    Warning |
    Unable to automatically generate SSL certificate, manual configuration required. Set 'server.ssl.key-store' in application.yml
    j
    j
    p
    • 4
    • 6
  • p

    Paul Trudel

    09/24/2025, 6:52 PM
    I am working on upgrading my Grails app to Grails 7 RC 2. I am running into this error when building my project
    Cannot resolve reloading agent JAR: Failed to resolve imported Maven boms: Could not find org.grails:grails-bom:7.0.0-RC2
    These repos only have BOM versions up to 7.0.0-M3 https://repo.grails.org/ui/native/core/org/grails/grails-bom/ https://repo.maven.apache.org/maven2/org/grails/grails-bom/ Is there another repo that I need to add to my
    build.gradle
    that contains these artifacts?
    j
    • 2
    • 2
  • r

    rss

    09/24/2025, 9:04 PM
    Grails 2.5.6 - "Method on class was used outside of a Grails application" error I’m using Grails 2.5.6 and I created a simple Person domain and a PersonController. When I try to call POST /person/add, I get the following error: Method on class [com.demo.Person] was used outside of a Grails application. If running in the context of a test using the mocking API or bootstrap Grails correctly. My code: grails-app/domain/com/demo/Person.groovy package com.demo class Person { String name } grails-app/controllers/com/demo/PersonController.groovy package com.demo import...
  • m

    muser

    09/25/2025, 8:25 PM
    Hello is grails website down?
    j
    • 2
    • 2
  • j

    James Fredley

    09/25/2025, 9:34 PM
    https://grails.apache.org/ is back
    partygrails 4
  • p

    pablo.pazos

    09/27/2025, 6:07 AM
    Hi all, quick question, I've noticed that Date is mapped to datetime in MySQL which doesn't store the fractional seconds (SS.sss), thought the type has a length that allows to store up to 6 digits e.g. datetime(3) stores 3 fractional seconds. Is there a DSL to set the length of the datetime? Thanks!
    j
    • 2
    • 4
  • r

    rss

    10/02/2025, 1:54 PM
    Intercept session timeout I have an application written in Grails 6.x. I use spring-security-core and spring-security-ldap plugins to authenticate against an Active directory server. I have set a timeout of 5min and once the session expires I'm redirect correctly to the login page. The problem rises for the ajax call, in my js code I intercept a 401 status return and then redirect the user from the front end to the login page. But this never happens because it is intercept by the backend that redirects to the login...
  • d

    DanielC

    10/02/2025, 8:30 PM
    So I keep getting “Missing X-content-type-options header” on vulnerability scans. So I added “nosniff” to the headers in an interceptor. The issue is, the scan is showing the issue on /assets/js file. So if I do something like localhost:8080/assets/jsfile I am not getting the nosniff header. I was wondering if there is a way to configure the tomcat server itself in something like the application.yml file to add no sniff? Or if there is another way to get that header?
    j
    • 2
    • 6
  • d

    Dave

    10/04/2025, 4:11 PM
    Hi all, is https://repo.grails.org/ down?
    j
    • 2
    • 2
  • d

    Dave

    10/04/2025, 4:12 PM
    Could it be it needs turning off and on again?
    😂 1
  • j

    jdaugherty

    10/04/2025, 4:22 PM
    seems to be working for me at the moment
  • d

    Dave

    10/04/2025, 4:32 PM
    Hmmm, i'll try another machine, thanks for sharing.
  • m

    matt.aguirre

    10/06/2025, 4:28 PM
    Does any user or recommend a package/plugin to generate openapi/swagger documentation? Using Grails 6.2.3.
    j
    j
    • 3
    • 6
  • u

    user

    10/07/2025, 1:41 PM
    Is there any brave person willing to test seed-me recompiled with Apache Grails 7.0.0-RC2 (https://github.com/wondrify/seed-me/pull/30)?
  • m

    Mark Johnson

    10/08/2025, 2:06 PM
    is this the correct way to specify multipple optional config files in application.yml for a grails 6 app?
    Copy code
    spring:
        config:
            import: >
                optional:file:${PATH_EXT_CONFIG:-/app/config}/application.yml,
                optional:file:${PATH_EXT_CONFIG:-/app/config}/application.groovy,
                optional:file:${PATH_EXT_CONFIG:-/app/config}/custom-application.yml
  • m

    Mark Johnson

    10/08/2025, 2:33 PM
    Idiomatic I mean
  • s

    sbglasius

    10/08/2025, 3:56 PM
    @Mark Johnson or look at the external-config plugin: https://github.com/sbglasius/external-config
  • m

    Mark Johnson

    10/09/2025, 8:30 AM
    @sbglasius thanks!
    Copy code
    grails:
        config:
            locations:
                - optional:file:${PATH_EXT_CONFIG:-/app/config}/application.yml
                - optional:file:${PATH_EXT_CONFIG:-/app/config}/application.groovy
                - optional:file:${PATH_EXT_CONFIG:-/app/config}/custom-application.yml
    assuming that in
    Copy code
    #application.yml
    
    a.list:
        - name: example1
          description: desc1
    and assuming that in
    Copy code
    #custom-application.yml
    
    a.list:
        - name: example1
          description: desc1
        - name: example2
          description: desc2
    which one will should take precedence also is
    optional:
    valid in your plugin i dont see any reference, can i dispense with it
  • r

    rss

    10/09/2025, 4:24 PM
    Why did json views syntax change between Grails 4 and Grails 5? While upgrading a Grails 4 application to Grails 5, I encountered a failure in one of the json views (.gson file) when specifying a field having an empty map. In Grails 4, this worked fine, but in Grails 5 I have to put parentheses around the empty map literal, or the render call fails saying that there is no property of the view class with that name. I wrote the following unit test to reproduce the behavior: import grails.plugin.json.view.test.JsonRenderResult import...
  • g

    giangio

    10/09/2025, 4:47 PM
    I've been asked about CSRF protection, does Grails take care of it automagically? This is what ChatGPT is telling me, but I havent found anything on Spring Security Core docs, any word of wisdom? ChatGPT says I can use this, is she (don't ask LOL) allucinating?
    Copy code
    grails:
        plugin:
            springsecurity:
                csrf:
                    enabled: true
                    tokenName: _csrf
                    headerName: X-CSRF-TOKEN
    j
    • 2
    • 1
  • a

    Arjang

    10/09/2025, 5:28 PM
    Spring Security question. Annotation does not work when RequestMap is stored in DB (Doc section 4.6). For example this won’t work
    Copy code
    @Secured("hasRole('ROLE_ADMIN')")
        def index(Integer max) {
    But it works if we use Static RequestMap (Doc section 4.5). Is this a correct behaviour?
    j
    • 2
    • 5
  • j

    James Fredley

    10/09/2025, 9:36 PM
    How do you configure database migration in Grails 7
    u
    u
    +2
    • 5
    • 6
  • j

    James Fredley

    10/09/2025, 9:45 PM
    How do you configure spring security in Grails 7
    u
    u
    • 3
    • 2
  • j

    James Fredley

    10/09/2025, 9:58 PM
    How do you configure database migration in Grails 7
    u
    u
    +5
    • 8
    • 7