Questions tagged [grails3]

Grails 3 is the next major version of the Grails framework. This tag can/should be used with all Grails 3.x version so that the users on StackOverflow don't have to filter each specific Grails version (for example, 3.1.10, 3.2.0-m2) and they can filter every question which is related to Grails 3.

289 questions
2
votes
1 answer

How to generate EAR file in GRAILS 3?

I want to generate ear file using GRAILS 3. I tired using Gradle ear plugin did not work? how do I do it please help.
neg6
  • 21
  • 1
2
votes
0 answers

Update parent using child domainclass with beforeInsert / beforeUpdate

Hello I have a question about beforeInsert/beforeUpdate in Grails. I can't get a simple parent/child use case to work. The child updates the parent grandchildren counter. See the model below: class Parent{ int grandchildren def…
Dennie de Lange
  • 2,776
  • 2
  • 18
  • 31
2
votes
2 answers

How to test a Grails service that retrieves information from the HTTP session

I am trying to write tests for a Grails web-plugin. The plugin contains a service (UtilityService) which has a function called getSession() which returns the GrailsHttpSession. Other services use that to read/write values in the session. The code…
Mike Gostomski
  • 138
  • 2
  • 8
2
votes
0 answers

How to exclude a plugin from development environment in Grails 3?

I would like to disable a specific plugin while running in development mode. Is there a generic way to achieve this in Grails 3.x? I found the following solutions for Grails 2.x, but they won't work for Grails 3 since it uses Gradle instead of…
GreenGiant
  • 4,930
  • 1
  • 46
  • 76
2
votes
1 answer

Find isDirty() for children elements

I'm using Grails 3.2: class Training{ boolean clientChanged = false static transients = ['clientChanged'] static hasMany = [clients:User] //... def beforeUpdate(){ clientChanged = this.isDirty('clients') } def…
Michal_Szulc
  • 4,097
  • 6
  • 32
  • 59
2
votes
1 answer

PooledConnection has already been closed

I have a grails 3.1.12 application and using Oracle DB. I am getting "PooledConnection has already been closed" exception while running the following code snippet1 and code snippet2. Snippet 1 and Snippet 2 works and intermittently gives…
Swaroop Lata
  • 21
  • 1
  • 3
2
votes
1 answer

Fatal slow performance after Grails 3 upgrade

I have updated small application to Grails 3.2.3. After some issues this is now resolved Grails 3.x update - bootRun failed But unfortunately the application is unusable. On my high-end laptop ThinkPad 460p I cant even load home page of application.…
Zbyněk Nevrlý
  • 193
  • 1
  • 9
2
votes
1 answer

Grails: Value out of sequence: expected mode to be OBJECT or ARRAY when writing

I'm trying to parse a JSON object using grails.converters.JSON, but this errors appears. The code def str = '{"a": "b"}' def json = new JSON(str) or def map = [:] map.a = "b" def json = map as JSON json = new JSON(json.toString()) are returning…
ricardogobbo
  • 1,690
  • 3
  • 19
  • 41
2
votes
1 answer

Is there a way to inject a Grails datasource into logback.groovy for use with DBAppender?

So, Grails already sets up datasources backed by connection pools. Is there a way to leverage those for use with DBAppender in Logback so that I don't have to create a separate parallel datasource/connection pool? logback.groovy is somewhat external…
U47
  • 193
  • 14
2
votes
1 answer

Grails 3 interceptor - unable to set cookie in 'after' method

In my Grails 3.2 application I found out that cookies set in after and afterView methods are not set. My (simplified) controller: class MyInterceptor { boolean before() { Cookie c = new Cookie('before', 'ok') response.addCookie…
ilPittiz
  • 734
  • 1
  • 10
  • 23
2
votes
2 answers

Is this a bug in Grails 3.1.11? I'm using Collection Set within executeQuery and it causes java.lang.ClassCastException

Issue: When trying to use Collection Set within namedParameters of ExecuteQuery It throws: java.lang.ClassCastException java.util.LinkedHashSet cannot be cast to java.lang.Long I can convert the Set to data type List but I was wondering why this…
Hacked Child
  • 91
  • 1
  • 5
2
votes
1 answer

@Transactional not applied to all controller actions

We notices after the update from Grails 3.1.11 to 3.2.0 that one action of a controller is no longer working: @Transactional(readOnly = true) class RoomPlanController { ... def show(RoomPlan roomPlan) { ... } def…
Andreas
  • 380
  • 2
  • 14
2
votes
3 answers

Hibernate 5 Search with Grails 3

I am using Grails 3.1.4 and I want use Hibernate-Search for full text search of my entities. In my build.gradle I have included Hibernate 5 and Hibernate Search compile "org.hibernate:hibernate-core:5.0.9.Final" compile…
Tobi
  • 2,001
  • 2
  • 27
  • 49
2
votes
1 answer

grails 3 gsp using domain object constraints failing

In grails 2 we were able to reference the domain object constraints in a gsp as to keep the html 5 configration dry. On grails 3 (tried both 3.1.10 and 3.2.0.RC1) I get an error for code I tested in grails 2 successfully. I am trying to reference…
Joe
  • 1,219
  • 8
  • 13
1
vote
1 answer

Importing Grails project to IntelliJ IDEA using Gradle fails

When importing a Grails 3+ project to IntelliJ IDEA Ultimate, the Gradle build stops at “Starting Gradle Daemon...”. Screenshot of IntelliJ build window This happens when a new Grails 3 project is created using the command “grails create-app…