Questions tagged [grails-3.1]

Version 3.1 of the grails Open Source web application framework that uses the Spring, Hibernate, Groovy programming language, which is in turn based on the Java virtual machine (JVM) and Java. Use it in addition to the grails and grails-3 tags in specific question to grails 3.1.

From the Grails documentation:

What's new in Grails 3.1?

Grails 3.1 is at the milestone stage, but already includes the following new features.

Spring Boot 1.3 and Spring 4.2

Grails 3.1 has been upgraded to Spring Boot 1.3 and Spring 4.2.

Improvements to Grails 3 Profiles

Profile Publishing and Repositories

The following improvements are available in Grails profiles:

  • Profiles are now published as regular JAR files to any Maven compatible repository (Artifactory, Nexus etc.).
  • Additional profiles can be created easiy with the new create-profile command.
  • Profiles can now contribute to the generation of the build
  • Profiles can now have one or many features

For more information see the new section on Profiles in the user guide.

175 questions
2
votes
0 answers

How can I access GORM object properties in a GroovyScriptCommand?

I used the Grails create-script command to create my own custom script for rendering source code artifacts based on a GORM domain object. I want to generate a command object that contains the properties of the domain object. I see the properties and…
DAC
  • 707
  • 1
  • 6
  • 20
2
votes
2 answers

grails 3 rest-api profile GET

I am using grails 3 rest-api profile. I created generated simple domain class @Resource(readOnly = false, formats = ['json', 'xml']) class User { String name String address Date dateOfBirth } while http://localhost:8080/user/ will give…
1977
  • 2,580
  • 6
  • 26
  • 37
1
vote
1 answer

Grails 3.1 - Can't find codec for domain class

I am not able to convert domain class into Basic DB object. Below is my code: def update_val class_object.class.withNewSession { MongoCodecSession m -> update_val = m.pendingUpdates.find { it.key.name ==…
1
vote
2 answers

What is the best way to check if the user is logged in or not in grails Spring Security?

I would like to check if the user is logged in or not.I have integrated interceptor in most of the projects to check if user is logged in . But this does-not work well with AJAX request and matching all the controllers in the interceptor causes…
1
vote
2 answers

How can I remove hibernate in grails 3.x?

The command recommended by this SO question does not exist for grails 3.1.x Can I configure Grails with no datasource? grails uninstall-plugin hibernate | Error Command not found uninstall-plugin The grails app in question needs no persistence,…
Ed J
  • 2,466
  • 4
  • 26
  • 20
1
vote
0 answers

In Grails 3.1.x, how do I configure grails logging to include the class, method and line number in the logging statement?

The class that gets printed is the logging framework's class, not the groovy class that contains the log statement. The method is always 'call', and line number is always -1. logback pattern: pattern = "%date{ISO8601} [%-5level]…
Ed J
  • 2,466
  • 4
  • 26
  • 20
1
vote
1 answer

How to disable default URL mappings for some actions

I'm using Grails version 3.1.12. I want to disable some default URL mappings for actions in order to manage them manually. For example, given the controller: class MyController { myAction() { render('Hello') } } This action maps by…
1
vote
1 answer

404 when deploying Grails 3.1.10 war to tomcat7 or tomcat8

The closest stackoverflow question that explains my symptoms is here - How can I deploy a Grails 3.0.1 war file in Tomcat7? I am in the process of upgrading a Grails 2.3.4 application to Grails 3.1.10 and everything is working with 'grails…
Kirby
  • 1,980
  • 3
  • 21
  • 33
1
vote
2 answers

How can I do: required="false" in grails g:select?

required="false" does not work in "g:select" tag Example: and produces a html tag required (in html5) How can I make the "g:select"…
Victor Soares
  • 757
  • 1
  • 8
  • 34
1
vote
1 answer

How do I edit an existing spring bean in resources.groovy

I've been having trouble getting grails 3.1.6, and jndi to work with multiple datasources I'm very close but I need to set a 'hibernate.default_schema' on one of the data sources, however it's environment specific. resources.goovy: …
Lifeweaver
  • 986
  • 8
  • 29
1
vote
2 answers

Grails 3 - findAllBy with join

I have a domain class: class Owner { Integer ownerType Prop propertyToJoinSometimes static constraints = { propertyToJoinSometimes nullable: true } } I usually don't want to load propertyToJoinSometimes when loading Owner,…
Anonymous1
  • 3,877
  • 3
  • 28
  • 42
1
vote
0 answers

Upgrading grails 2 to grails 3: HibernateCriteriaBuilder equivalent

I am upgrading several plugins and one application from grails 2.3.11 to grails 3.1.10 right now. In some places I have encountered import grails.orm.HibernateCriteriaBuilder Which does not exist in Grails 3. Is import…
Piotr Zakrzewski
  • 3,591
  • 6
  • 26
  • 28
1
vote
2 answers

Grails access variable in build.gradle from Service class

I am sitting in front of a Grails 3.1.4 Application. The build.gradle file looks like this: buildscript { ... } version "01.01.12.99" ... ext { ... } repositories { ... } dependencyManagement { ... } dependencies { …
kiltek
  • 3,183
  • 6
  • 47
  • 70
1
vote
1 answer

How to mock the Asset-Pipeline taglib when testing a view

I have a test where the gsp uses the Asset Pipeline tag assetPath, in grails 2 I had no issues but in grails 3 I'm getting an org.grails.taglib.GrailsTagException: [SOME_GSP.gsp:184] Error executing tag : Error evaluating expression…
Lifeweaver
  • 986
  • 8
  • 29
1
vote
0 answers

@TestMixin(HibernateTestMixin) in Grails 3.1.x can´t handle special namend tables?

My Application uses the SpringSecurityCore Plugin. In my AdminUser Class i have something like this in Domainclass AdminUser: static mapping = { table 'com_admin_user' id generator: 'native', params:[ sequence: 'com_adinuser_id_seq'…
se-jaeger
  • 111
  • 1
  • 5