Questions tagged [grails]

Grails is an Open Source, full stack, web application framework that uses the Groovy programming language (which is in turn based on the Java virtual machine (JVM) and Java). The framework is oriented around high-productivity application development by following the "coding by convention", and uses common Java technologies such as Hibernate and Spring.

Filter by
Sorted by
Tagged with
-1 votes
0 answers
9 views

grails application throws below exception while trying to get the app up using Websphere 9

[11/20/23 17:14:49:868 EST] 000000e6 SystemOut O 2023-11-20 17:14:49.867 ERROR - - - [ebContainer : 1] StackTrace : Full Stack Trace: org.springframework.web.util....
praj's user avatar
  • 1
0 votes
1 answer
47 views

how to create a thread safe hit counter in grails?

i have a concurrency issue in my hit counter implementation. here is how i have implemented the hit counter. The hit counter domain is as follows class PageHitCounter { String pageIdentifier ...
kofhearts's user avatar
  • 3,656
0 votes
0 answers
11 views

OneToMany domain class not saving in unit test

I have a relation for an attributes table that works in my application but in the unit test, the save doesn't clear old values. class Customer { static hasMany = [customerAttributes: ...
Chic's user avatar
  • 10k
0 votes
0 answers
19 views

How do I manage to let Grails handle a wide variety of Date inputs?

I would like Grails to handle a variety of date inputs in the same input section/for the same database field. The <g:datePicker> is great and all, but it handles everything on the server side, ...
Der RnB's user avatar
0 votes
0 answers
25 views

Command [generate-views] error: Could not execute build using connection to Gradle distribution 7.6.3

I have a Grails 6.0.0 project with scaffolding plunging in place. When I try to generate controller I get the following exception. create-controller is working fine. See https://docs.gradle.org/7.6.3/...
Naeem Ghumman's user avatar
-1 votes
0 answers
17 views

java.lang.AbstractMethodError: javax.ws.rs.core.UriBuilder.uri(Ljava/lang/String;)Ljavax/ws/rs/core/UriBuilder during API request from front to back

Bonjour, Lorsque je fais un appel API de mon frontend vers mon backend, j'ai l'erreur suivante : <html> <head> <title>Grails Runtime Exception</title> <style type=&...
atheveny's user avatar
0 votes
0 answers
17 views

Correct way to configure Grails/hibernate for Postgres SERIAL

When using the Postgresql SERIAL data type (i.e. auto generation of id sequence), what is the best way to configure that in Grails / hibernate? Doing nothing is not an option, because it defaults to a ...
xpusostomos's user avatar
  • 1,357
0 votes
0 answers
33 views

Grails 6.1.0 (and) Intellij 2023.2.5 Ultimate problems

I wanted to start a new project with Intellij (2023.2.5 Ultimate with grails plugin) and grails 6.1.0 and Java 11. In Intellij I got an error creating the project (missing init in <I forgot>). ...
susi's user avatar
  • 493
0 votes
1 answer
16 views

Grails GSP How to change the Text of a Button template on the fly?

Im a newbie in the Grails Framework so keep that in mind. I have a Button Template which i render on a different place. I want to keep all the functionality of the template and the text on all usages ...
Florian Hensel's user avatar
0 votes
2 answers
28 views

Grails hibernate search returns copied instances

I have a domain class in Grails, which looks like the following: class Tag implements Serializable { Long wallpaper String location, tag static mapping = { if (Environment.current ...
Joshua's user avatar
  • 21
-1 votes
0 answers
26 views

Issue in passing parameters causing : org.springframework.util.ObjectUtils.nullSafeConciseToString [duplicate]

When I was using Spring-5.3.23 as part of Grails-5.2.6 I was able to run a integration test by passing parameter as params = [ test : "abc" ] But ...
Soven K Rout's user avatar
0 votes
1 answer
34 views

Spring Security REST - Invalidate Refresh Token when accountExpired

I have an application that uses Grails 3.1, Spring Security, and Spring Security REST. In my User entity, I have the accountExpired field, which, when set to true, prevents the user from accessing the ...
Victor Soares's user avatar
0 votes
2 answers
47 views

Grails 3/4/5 Spring Security Plugin login by email

We upgraded a Grails application from version 3 to 4. With all dependencies, including Spring Security on 4.0.4. Previously, users had logged in with their name and password. We now wanted to change ...
Voland's user avatar
  • 1
0 votes
1 answer
42 views

Download multiple file from controller

I have this controller that let me download a file: File toDownload = new File("/tmp/" + fileName) response.setContentType("application/octet-stream") response.setHeader(&...
NiBE's user avatar
  • 869
-1 votes
0 answers
33 views

spring boot: what dependencies are needed make a simple spring boot app with domain objects, ORM and web services (similar to grails?) [duplicate]

I come from grails where all config and setup is done for you, and you just write domain code (such as domain objects, services and controllers). No plugins, no mvn configuration, no pain. Now I'm ...
John Little's user avatar
0 votes
0 answers
12 views

Grails controller unit test - injected object is null

I'm using Spock to test a grails controller. In the controller: def submitUserRegistration() { loginService.sudoAsAppAdmin { // sudoAsAppAdmin is a method that accepts a closure In the test: ...
nasch's user avatar
  • 5,408
1 vote
1 answer
31 views

Grails oddness when trying to download a file from a URL

I'm trying to automate firmware updates on some of my systems. So, I first download a firmware file from the vendors website, and then I want to upload this to my TFTP server ready for my devices to ...
Simon's user avatar
  • 119
0 votes
0 answers
33 views

Using Neo4j Testcontainers With Grails and Spock, can't find correct neo4j datasource

I'm using testcontainer to test the neo4j-related functionalities in the application with Grails 3.3.2 and Spock. The grails application config for Neo4j: environments { development { grails { ...
stackoverflow_user's user avatar
0 votes
1 answer
55 views

Cross Domain Session

The projects of the company I work for are being changed, the names are App A, App B, App C and App D. One of this changes is the login and session. Two applications (A and B) has the same database, ...
João G. Hartmann's user avatar
0 votes
0 answers
16 views

How to define filter env-entry in Grails 6.0.0, resources.groovy?

I am uplifting an older Grails 1.3.7 application to Grails 6.0.0. In older project under src/templates/war/web.xml oAuth filters were defined, along with env-entry, as shown below : <filter> ...
Nikhil Kumar's user avatar
0 votes
1 answer
18 views

Setting up IntelliJ environment to run old grails 2.4.2 code

Using IntelliJ and trying the setup the environment to run "legacy" code running on Grails 2.4.2 Upgrading is not in the plans for the moment. So to do some small changes I need the recreate ...
Salvador Valencia's user avatar
0 votes
0 answers
20 views

GORM standalone: get all Domain's constraints

I'm using GORM-Stanalone in my app with: dependencies { api 'org.grails:grails-datastore-gorm-hibernate5:8.0.1' // api 'org.grails:grails-validation:3.3.16' // <- tried that with no effect } I ...
injecteer's user avatar
  • 20.3k
3 votes
0 answers
60 views

Grails 3.017 not showing the fields of the domain class fields in localhost 8080

I am new to Grails . I am using Grails 3.0.17 in my project . I have created a dummy project named A I have created a dummy class B in my domain as below:- class B { String name static ...
Karthik KK's user avatar
0 votes
0 answers
38 views

Issues with GSP Grails 5.3, Loop issue and Unexpected Expression error

I am running into a couple issues that I'm hitting a brick wall on and looking for other opinions on what is happening. First issue is I am getting an Uncaught Syntax Error: expected expression got '}'...
Daniel Geiselman's user avatar
-1 votes
1 answer
19 views

Running databasemigration with Grails IntegrationTest run - is it possible

So this is the problem I'm trying to work around: I'm working with an old grails project using PosgreSQL, including GORM. The domain classes are as minimal as GORM wants them to be - so ID ...
Chris J's user avatar
  • 1,439
0 votes
0 answers
29 views

Grails 5 how to get next sequence id

For a form I need as a default the next sequence id in the form. Do you guys have any idea's how to tackle this with hibernate? id column: 'KEY', sqlType: 'NUMBER', generator: 'sequence', params: [...
Bee's user avatar
  • 1
1 vote
0 answers
12 views

how to get overwritten value via environment value when reading config as map using config.getProperty method in grails6

I have configuration defined in application.yml as storage: local: container: "/var/optimus" When I run the application, I have set the environment variable: STORAGE_LOCAL_CONTAINER: &...
Deewendra Shrestha's user avatar
0 votes
0 answers
31 views

Is there any way of caching dependencies in a grails application ((Packaging Grails application) in order to speed up tests?

Is there any way of cache dependencies in a grails application to speed up tests and prevent packaging grails application everytime I run grails test-appcommand? I'm using a docker container as well. ...
juanfran928's user avatar
0 votes
1 answer
62 views

Why is Grails (6.0.0) trying to cast a String URL parameter to a domain object? (It seems related to a partial match of the domain name.)

I have a controller method that takes a String argument called "search": def test(String search) { log.info("search: ${search}") render("testing ${search}") } ...
Dan L's user avatar
  • 3
0 votes
1 answer
36 views

In Grails, how to get the granted authorities (roles) of a user that isn't logged in

In Grails, you can use springSecurityService.principal.authorities to get the logged in user's roles from CAS. I've been doing this for sometime now, but for the first time, I need to be able to check ...
Nick's user avatar
  • 1,092
0 votes
0 answers
35 views

"It is not a known persistent type" when trying to save Spy object Grails 4.1.2

I cannot save to database object which is spying on other object. That makes testing more difficult. Is there any workaround to this problem or do you know if it is intentioned? I am not sure if this ...
SaySaeqo's user avatar
0 votes
1 answer
42 views

Deploying more than two war files in tomcat version 8.5 gives GC limit exceeded error

I am trying to deploy total 4 war files in tomcat server 8.5. All war I have made from groovy and angularJS. If I deploy any 2 war files, it is working fine, but as soon as I try to deploy third one ...
vineet agrawal's user avatar
0 votes
1 answer
47 views

How to add a namespace to an XML attribute using XmlSlurper (Apache Groovy)?

I'm iterating through the child elements of a flattish XML, and adding a certain attribute for elements that are empty. import groovy.xml.XmlUtil import groovy.xml.MarkupBuilder import groovy.xml....
Axel K.'s user avatar
0 votes
1 answer
39 views

Grails domain.list() does not retrieve data

Using IntelliJ and Grails, I have created a database connection to my MySQL database. The connection works: I can actually see the data in IntelliJ itself when I type a query. However, when I create a ...
Joshua's user avatar
  • 21
0 votes
1 answer
77 views

converting a curl request to groovy / grails HTTPBuilder request

I am doing a curl request :- curl -X POST -H "Content-Type: application/json" -H "Accept: application/json,text/javascript" -d '[{"command": "system.login", &...
Simon's user avatar
  • 119
0 votes
0 answers
21 views

Grails Criteria, order by month and only in current year of a date

I am currently trying to change this query so that it only returns items sorted by month then manufacturer, and are only in this year. List<Item> results = criteria.list { ...
arya asda's user avatar
0 votes
0 answers
29 views

Grails Integration Test process not ending

I am running grails Integration Test cases using command "gradle integrationTest". The test cases run properly but, the process itself doesn't end. This is causing issues in jenkins pipeline ...
Vinay's user avatar
  • 1
0 votes
0 answers
23 views

Grails standalone container performance

I have a question about the performance of grails running a standalone container. When I run ./gradlew bootRun my application responds 454413 in one minute. When I compile the application using ./...
Ricardo Bocchi's user avatar
1 vote
1 answer
29 views

Link with anchor navigation in Grails

How to make link like /news/index#partition with Grails tag g:link Current is <g:link controller="news" action="index">News</g:link>
user2572790's user avatar
0 votes
0 answers
12 views

In jqxGrid click on cell is deleting the saved value

In my jqxGrid my columns format is custom. When I click on cells if there is saved data on that cell grid is deleting it, when i click Esc key on my keyboard the value comes back, when i click with ...
Deadman Deadman's user avatar
1 vote
1 answer
57 views

Grails 2 Gorm Hibernate 4: 2 round robin servers causing jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '493' for key 'PRIMARY'

I am working on a Grails version 2.5 project. I am facing a problem with Gorm / Hibernate. The project is deployed on 2 servers, each would be getting a call in a round robin fashion. When we hit one ...
Prakhar Mishra's user avatar
0 votes
1 answer
42 views

Unable to run executable jar for grails 6 application

I am following the documentation here - https://docs.grails.org/latest/guide/deployment.html to create and run executable jar with grails 6 and java 11. Steps to reproduce: create a new app grails ...
Deewendra Shrestha's user avatar
1 vote
1 answer
104 views

Unable to run integration tests when upgrading grails from version 5 to 6 - Could not determine the dependencies of task ':integrationTest'

We are upgrading a grails 5.2 application to grails 6. The application boots up fine, anf the unit tests are also running, however when running integration tests, we are getting following error: %./...
Deewendra Shrestha's user avatar
2 votes
1 answer
277 views

Cannot build newly created Grails 6.0.0 app with provided Gradle wrapper or system Gradle

Configuration: MacOS Ventura, 13.5 JDK: Liberica JDK 11, and/or Liberica JDK 17 System Gradle: Gradle 8.2.1 Grails: Grails Version: 6.0.0 Problem: I can run $> grails create-app foobar to create a ...
mindcrime's user avatar
  • 697
0 votes
1 answer
26 views

Grails 5 RestfulController extension is showing default constructor missing problem

I am using grails-5.2.5 to migrate an application from grails-2.5.2 version. In grails-2 version there is a class RestVehicleTrackingController which extends RestfulController. The purpose of the ...
Sumon Bappi's user avatar
  • 1,987
0 votes
2 answers
134 views

How to avoid optimistic locking failure exception during ajax periodic calls in grails?

I have a simple function in MessageController that is called by the mail compose page every 1 second using ajax call. It is a simple function to periodically save the message draft so that the message ...
kofhearts's user avatar
  • 3,656
0 votes
1 answer
56 views

grails 5 spring security 5 403 error page is not shown

I am using grails 5.2.5 and spring security 5.6.0. When a 403 is occurred then the access deny message is written in the browser document.I want to show a 403 specific view page.But it is not working. ...
Sumon Bappi's user avatar
  • 1,987
0 votes
1 answer
56 views

How do I fix Grails 6 integration tests failing due to i18n messages not being found?

I am having issues with resolving i18n messages in my integration tests after upgrading our Grails application to 6.0.0 from 5.3.2. I'm getting a similar error for 26 out of our 110 integration tests: ...
wubbalubba's user avatar
0 votes
0 answers
16 views

Exception URL is called but view page is not shown in grails

I am using grails-5.2.5 version. During saving a multipart request when size is exceeded then exception is printed in IDEA console but is not shown in view page which is configured in URL mapping. My ...
Sumon Bappi's user avatar
  • 1,987
0 votes
0 answers
34 views

Grails 4.1.0 application throwing exception 'TABLE_NAME' not found when try to execute sql.rows

I try to execute the query using groovy.sql.Sql sql.rows("select * from table_name") //all query string in samll case OR sql.rows("select * from 'table_name'") //all query string ...
Prince Mishra's user avatar

1
2 3 4 5
598