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

    user

    11/26/2025, 2:05 PM
    I bet you'd prefer another one but apparently buying a license for IntelliJ is a tax have to pay
  • u

    user

    11/26/2025, 3:10 PM
    Yes, I even miss intelij, but I like vs code and sublime text (the one I used to like most)... but lately sublime text have shown way more overhead that I would like to have... and for grails both are not good. But, actually as jdaugherty said in the answer to my question, using AI helps.. I thought about it some time ago, using AI autocomplete will make a lot of things easier...
  • u

    user

    11/26/2025, 4:20 PM
    We are using the databasemigration plugin, our DB runs in AWS via Aurora MySQL. Our application should access the DB via a read only URL except when we do the migration. I'm setting "grails.plugin.databasemigration.url" to the read write endpoint and "dataSource.url" to the read only endpoint. Now I would like to log the migration connection information like I do for the dataSource
    Copy code
    private void printDataSourceConfiguration(String stage) {
            <http://log.info|log.info>("Stage: ${stage}")
    
            try {
                // Unwrap if it's a TransactionAwareDataSourceProxy
                DataSource actualDataSource = dataSource
                actualDataSource = ((TransactionAwareDataSourceProxy) dataSource).getTargetDataSource()
                def connection = actualDataSource.getConnection()
                def metaData = connection.getMetaData()
                <http://log.info|log.info>("     Database URL: ${metaData.getURL()}")
                <http://log.info|log.info>("     Database Product: ${metaData.getDatabaseProductName()} ${metaData.getDatabaseProductVersion()}")
                <http://log.info|log.info>("     Driver: ${metaData.getDriverName()} ${metaData.getDriverVersion()}")
                connection.close()
            } catch (Exception e) {
                log.warn("  -> Could not extract connection metadata: ${e.message}")
            }
        }
    what is the object I have to get data from?
    u
    • 2
    • 1
  • j

    James Fredley

    11/26/2025, 9:57 PM
    https://github.com/apache/grails-core/discussions/13546#discussioncomment-10088884 - the state of direct Grails support in IDEs. IntelliJ Ultimate is by far the best integration. But, you can develop in any IDE with Gradle support and use grails-shell in terminal to achieve many of the things possible via the IntelliJ Grails plugin.
  • g

    giangio

    11/27/2025, 10:14 AM
    Hi folks 🙂 I'm trying to use the webjars provided by Grails 7 in my app, here is the
    includes.js
    file:
    Copy code
    // From Grails 7 included webjars
    //= require webjars/dist/jquery.js
    //= require webjars/dist/js/bootstrap.bundle.js
    In the view:
    Copy code
    <asset:javascript src="includes.js"/>
    This is my
    build.radle
    :
    Copy code
    assets {
        minifyCss = true
        minifyJs = true
        minifyOptions = [
                //SIMPLE (default) or ADVANCED or WHITESPACE_ONLY
                optimizationLevel: "SIMPLE",
        ]
        excludes = [
                'webjars/jquery/**',
                'webjars/bootstrap/**',
                'webjars/bootstrap-icons/**',
        ]
        includes = [
                'webjars/jquery/*/dist/jquery.js',
                'webjars/bootstrap/*/dist/js/bootstrap.bundle.js',
                'webjars/bootstrap/*/dist/css/bootstrap.css',
        ]
    }
    They are not included. Building a
    jar
    shows:
    Copy code
    11:06:33.369 [pool-1-thread-2] WARN asset.pipeline.DirectiveProcessor -- Unable to Locate Asset: /webjars/dist/jquery.js
    11:06:33.372 [pool-1-thread-2] WARN asset.pipeline.DirectiveProcessor -- Unable to Locate Asset: /webjars/dist/js/bootstrap.bundle.js
    11:06:36.139 [pool-1-thread-10] WARN asset.pipeline.DirectiveProcessor -- Unable to Locate Asset: /webjars/dist/jquery.js
    11:06:36.140 [pool-1-thread-10] WARN asset.pipeline.DirectiveProcessor -- Unable to Locate Asset: /webjars/dist/js/bootstrap.bundle.js
    11:06:36.567 [pool-1-thread-4] WARN asset.pipeline.DirectiveProcessor -- Unable to Locate Asset: /webjars/dist/css/bootstrap.css
    11:06:39.512 [pool-1-thread-8] WARN asset.pipeline.DirectiveProcessor -- Unable to Locate Asset: /webjars/dist/css/bootstrap.css
    What am I doing wrong?
  • g

    giangio

    11/27/2025, 10:23 AM
    They exist in the
    jar
    with the hash:
    g
    • 2
    • 3
  • r

    rss

    11/27/2025, 10:04 PM
    Call GORM's .list() in trait with generic type In my Grails 6 project, I'd like to add an additional feature to select domain classes, so I defined a custom trait. trait MyDomainClassTrait implements GormEntity {} // domain class class Page implements MyDomainClassTrait { String id } What I'm trying to achieve is to define some sort of "cache manager", internal to the trait, mimicking a few GORM-like methods, so to be able to use either: Page.list(), native GORM Page.cache.list(), returns all GORM entities previously stored in...
  • u

    user

    11/28/2025, 1:13 PM
    Hi Everyone, (sorry for the duplicate, can't delete it) I'm not sure if I'm hitting a bug, a feature, or a limitation of DetachedCriteria.... (Grails 6, Gorm ) Occasionally, when i'm passing in a DetachedCriteria as a subquery to an
    inList("property", mySubQuery)
    I'm given an error:
    ConverterNotFoundException: No converter found capable of converting from type [org.hibernate.criterion.DetachedCriteria] to type [java.lang.Long]
    This is usually when there is some nesting of associations, but I haven't been able to extract a simple reproducible case from our application. The issue arises in
    AbstractHibernateCriterionAdapter
    as follows
    Copy code
    protected void applySubCriteriaToJunction(PersistentEntity entity, AbstractHibernateQuery hibernateCriteria, List<Query.Criterion> existing,
                Junction conjunction, String alias) {
    
            for (Query.Criterion subCriterion : existing) {
                if (subCriterion instanceof Query.PropertyCriterion) {
                    Query.PropertyCriterion pc = (Query.PropertyCriterion) subCriterion;
                    if (pc.getValue() instanceof QueryableCriteria) {
                        pc.setValue(toHibernateDetachedCriteria(hibernateCriteria, (QueryableCriteria<?>) pc.getValue()));
                    }
                    else {
                        AbstractHibernateQuery.doTypeConversionIfNeccessary(entity, pc);
                    }
                }
    Here,
    pc.getValue()
    is an already converted Hibernate DetatchedCriteria, not the original Gorm DetachedCriteria - it looks like the gorm original has been converted, but I've yet been unable to trace where and when. the Hibernate converted DC is not
    instanceof QueryableCriterion
    and so the engine looks instead to convert to a list of scalars. Does anyone have any initial thoughts on bug/limitation or feature here?
    s
    • 2
    • 1
  • u

    user

    11/28/2025, 1:53 PM
    Thank you Steve, I will try and pin down a simple case to reproduce this. I'll take guidance on if there is enough to go on for a bug report here... Thanks again
    👍 1
  • i

    ilPittiz

    11/28/2025, 5:14 PM
    Hi all, dumb question: in a Grails multi-project is it possible to have more than one web-app? I only found examples with a single web-app (
    profile: web
    ) and multiple plugins (
    profile: plugin
    ). I’m trying to better understand if a multi-project build would fit my needs: I’m thinking of having 2 separate web-apps, sharing a bunch of code that I’d organize in one or more plugins. If this is doable, what would
    ./gradlew assemble
    include in the .war archive? Both web-apps + all my plugins? Would
    ./gradlew appName:assemble
    create a .war for a single web-app?
    g
    j
    • 3
    • 3
  • u

    u47

    12/02/2025, 10:28 PM
    Hey everyone. Using Grails 7—so nice to have hot reloading back... Does anyone else lose logging when a class is recompiled? Log messages work fine, but as soon as I make a change, I no longer get logging messages.
    • 1
    • 1
  • g

    gsandrew

    12/03/2025, 12:36 AM
    “Hey everyone. Using Grails 7—so nice to have hot reloading back...” ❤️❤️❤️❤️ indeeeeed 🙂
    👍🏻 1
    👍 2
  • u

    user

    12/05/2025, 12:28 PM
    Hey everyone, how’s it going? specs: Grails: 4.1.3 java 8.0.452-tem I’m trying to implement the database-migration 4.1.0 plugin using this guide as an example: https://grails.github.io/grails-database-migration/4.0.0-RC1/index.html. Here are some of the configurations I’ve made:
    Copy code
    buildscript {
        repositories {
            ...
        }
        dependencies {
    	...
            classpath 'org.grails.plugins:database-migration:4.1.0'
        }
    }
    ...
    sourceSets {
        main {
            resources {
                srcDir 'grails-app/migrations'
            }
        }
    }
    
    dependencies {
        ...
    
        implementation 'org.grails.plugins:database-migration:4.1.0'
        implementation 'org.liquibase:liquibase-core:4.19.0'
    }
    The folder structure is created correctly (
    grails-app/migrations/changelog.groovy
    ), but even if it’s not, there are no failures in the build process, however, it just silently doesn’t run. Could anyone tell me what’s missing?
    g
    u
    +6
    • 9
    • 9
  • u

    user

    12/07/2025, 8:28 AM
    I am migrating Grails 6 application to Grails 7. We are using joda-time plugin. While trying to upgrade that we found out the latest 3.0.0-SNAPSHOT version is available in github, here - https://github.com/grails-plugins/grails-joda-time/blob/3.0.x/gradle.properties . But the application Could not resolve the artifacts for this. Is it not released yet?
  • u

    user

    12/07/2025, 3:58 PM
    Alright.. I figured it out. Thanks.
  • g

    gsandrew

    12/07/2025, 4:09 PM
    Can you share what you figured out in case it bites someone else?
  • j

    jdaugherty

    12/07/2025, 4:09 PM
    the project was renamed
  • j

    jdaugherty

    12/07/2025, 4:09 PM
    and is published to maven central now
  • g

    Galeno de Melo

    12/09/2025, 5:51 PM
    Hi, folks. We are facing a strange problem while migrating our application from Grails 2.5.6 to Grails 4.1.3. When compiling assets using
    ./gradlew assetCompile
    , the gradle task compiles nicely until the first
    .scss
    file.
    Copy code
    Gradle build daemon disappeared unexpectedly (it may have been killed or may have crashed)
    It happens mostly when using Docker with Java Temurin 8 image, but it sometimes happens locally on some devs computers. We are using the 3.2.5 version of asset pipeline plugin
    Copy code
    classpath "com.bertramlabs.plugins:asset-pipeline-gradle:3.2.5"
            classpath "com.bertramlabs.plugins:asset-pipeline-core:3.2.5"
            classpath "com.bertramlabs.plugins:sass-asset-pipeline:3.2.5"
    When I tried moving to 3.4.0 with Sass Dart version, I saw the memory used by the process on System Monitoring jump from 3GB to 24GB in less than a minute. The files were being processed correctly and looking the debug logs I didn't find any circular injection, for example. Do anybody else had this problem or something similar? Thanks in advance
    g
    j
    • 3
    • 5
  • u

    u47

    12/09/2025, 8:56 PM
    If I'm looking to add GSP as a templating engine to a Spring Boot application, is there any instructions on how to do that beyond this test example? I can't make heads or tails of the dependencies listed in
    build.gradle
    and what's doing what (and how to configure it from within a Spring Boot app).
  • u

    u47

    12/09/2025, 11:00 PM
    Specifically, this class (GspAutoConfiguration) appears to do all the configuration I would need, but where does it exist? What dependencies do I need to include it (and it's autoconfiguration) into a Spring Boot app? I'm afraid all the restructuring of the Grails project around v7 has me chasing dead ends.
  • u

    u47

    12/09/2025, 11:26 PM
    Sorry, got the above link wrong: https://github.com/apache/grails-core/blob/v7.0.4/grails-gsp/spring-boot/src/main/java/grails/gsp/boot/GspAutoConfiguration.java
  • j

    jdaugherty

    12/10/2025, 2:31 PM
    @u47 we haven't tested the gsp changes, there's a long term goal to make gsp completely independent of grails, but I think the grails-gsp/spring-boot is meant to be an example to using gsp. I believe the app project there has all of the necessary dependency, however it's not been heavily tested with Grails 7
  • r

    rss

    12/10/2025, 2:54 PM
    Replacement for deprecated Hibernate Criteria .list() and .scroll() I was on Grails 3.3.18 and I’m migrating to Grails 6. Since upgrading, I get this warning in my logs: org.hibernate.orm.deprecation - HHH90000022: Hibernate's legacy org.hibernate.Criteria API is deprecated; use the JPA javax.persistence.criteria.CriteriaQuery instead In my code I was using Hibernate Criteria in two ways: def list = Toto.createCriteria().list { eq('exemple', XXX) } And for large datasets: def listScrollable = Toto.createCriteria().scroll { eq('exemple', XXX) }...
  • u

    u47

    12/10/2025, 4:44 PM
    @jdaugherty Thank you for the response. I can use the code in that example to get started. If I can sort it out, I may try to cobble together that configuration class and all the necessary dependencies into a GSP-specific Spring Boot "starter" which I could contribute back as a one-shot dependency? (I realize I'm a bit in left field with this. I'm mostly experimenting to see just how close a Spring Boot app can be made to a Grails app. With groovy being supported in Spring Boot, and the similaities between their Data Services, it's very close.)
  • j

    jdaugherty

    12/10/2025, 4:44 PM
    I'm happy to publish a starter, i'm pretty sure everything you need is in that example app though
  • j

    jdaugherty

    12/10/2025, 4:45 PM
    if you want to create a repo with a starter, i'll happily merge it into grails core if you're willing. longer term we want to have built in spring support, and it would help us get to that point sooner
  • a

    Artur Czocher

    12/10/2025, 9:28 PM
    Hello. I have an old project in grails 3.3.10 and try to migrate to 4.0.4 (stp by step, finally to 7) I have problem with cmds
    Caused by: groovy.lang.MissingMethodException: No signature of method: ......findConstraintsEvaluator() is applicable for argument types: () values: []
    I can not find a solution. I asked AI 😄 and it told me to inject GrailsApplication to every Validateable class… there is hundreds of them.. is is this really it?
    s
    • 2
    • 1
  • r

    rss

    12/10/2025, 9:54 PM
    Grails 3.3.10 to 4.0.4 validation problem I have an old project in grails 3.3.10 and try to migrate to 4.0.4 (step by step, finally to 7) I have problem with cmds Caused by: groovy.lang.MissingMethodException: No signature of method: xxx.findConstraintsEvaluator() is applicable for argument types: () values: [] I can not find a solution. I asked AI and it told me to inject GrailsApplication to every Validateable class… there is hundreds of them.. is is this really it? I looked at grails docs and there is no method...
    m
    • 2
    • 2
  • u

    user

    12/12/2025, 4:31 PM
    Hey everyone, I was reading about this behavior and came across something unexpected regarding Services. It seems that using certain verbs in the method name can cause the transaction to be lost, which means the operation may never be persisted to the database (issue: https://github.com/apache/grails-core/issues/14539). This appears to be more common in Grails 3+, but still something to avoid in Grails 2 as well. Does anyone know the underlying reason for this behavior, and whether there’s a recommended workaround or best practice to avoid it? Thanks!
    j
    u
    +2
    • 5
    • 19