grails

Unable to start Grails 3.3.8 application with Postgres DB

限于喜欢 提交于 2020-01-06 03:26:08
问题 I started migrating my application from Grails 2.5.5 to Grails 3.3.8 running on Postgres DB but getting errors while starting the application in IntelliJ. Below are the details: Error: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'methodValidationPostProcessor' defined in class path resource [org/springframework/boot/autoconfigure/validation/ValidationAutoConfiguration.class]: Unsatisfied dependency expressed through method

Groovy/Grails autoconvert NaN string to double field

笑着哭i 提交于 2020-01-06 03:25:06
问题 I want to let users edit a field with double data in Grails view. I want to allow Double.NaN (to void values). There is a special char looking like a diamond with a question mark in it (in HTML) that acts like NaN, but - well - the users wont find that on their keys. In Java it works with Double.valueOf("NaN") . But typing NaN in the input field will throw a IllegalArgumentException saying "NaN" is an Unparseable Number. What method is callled for conversion? Whats the key to let it

How to set up an insert to a grails created file with next sequence number?

守給你的承諾、 提交于 2020-01-06 02:43:29
问题 I'm using a JMS queue to read from and insert data into a postgres table created by grails. The problem is obtaining the next sequence value. I thought I had found the solution with the following statement (by putting "DEFAULT" where the ID should go), but it's no longer working. I must have changed something, because I needed to recreate the table. What's the best way to get around this problem? ps = c.prepareStatement("INSERT INTO xml_test (id, version, xml_text) VALUES (DEFAULT, 0, ?)");

Different classes grails use to handle upload files

别来无恙 提交于 2020-01-06 02:22:36
问题 I have a grails controller which handle fileupload. I deployed the application on glassfish in windows and in ubuntu. On windows deployment, the request object of request.getFile("filename") is of type commons.CommonsMultipartFile while on ubuntu deployment the request is of type support.DefaultMultipart What causes this different behavour? Is there a way to make it consistent? The application server is glassfish3.1.2 回答1: Anything grails supplies via the request.getFile(...) method should

Correctly specify test report location for Grails 3 build on Bamboo

邮差的信 提交于 2020-01-06 01:54:13
问题 I am building a Grails 3 application using Atlassian Bamboo. I've configured the Grails 3 task as explained in my answer to this question. I am having trouble getting Bamboo to find my test reports. On the Grails task type, you can specify if the task produces test results, and if so, where they come from. So I have tried the following: Look in the standard test results directory Specify custom results directories: **/*reports/*.xml (which is the default when you choose Specify...) build

Randomly getting capped collection error in tests

不羁的心 提交于 2020-01-05 16:56:50
问题 ===EDIT=== Before editing the contents, let me tell you that this question is the exact duplicate of Trying to create a mongodb collection in grails using mongodb plugin. However, the solution given doesn't work for me, and the context in which I am working may be different. So, this question. ========== I am getting the following capped collections related error while running tests for capped collections over mongo. Following are the version of softwares that I am using: Grails 2.1.2 MongoDB

Modify Id generation for a Grails Plugin

北战南征 提交于 2020-01-05 13:49:25
问题 I am using a plugin for Grails - the Amazon S3 plugin - and the domain object provided by the plugin doesn't specify the Id Generator. I am using Postgresql and require the id genrator to be identity. I could copy the plugin in my plugins directory and mess with the domain object provided but that doesn't sound like a clean approach.Could I add the correct id generation at runtime? Or maybe there is a better way. 回答1: If you are using 1.2, you could provide a default mapping for all your GORM

Grails - illegal arguments for java.sql.Date

橙三吉。 提交于 2020-01-05 13:09:14
问题 I'm trying to create an sql.Date by creating a Calendar object on the current date. This is driving me crazy, if i hardcode the date as a string every thing is fine: def dat = java.sql.Date.valueOf("2011-01-31"); But, if I create the same string in code I'm getting an illegal argument error. def currentDay = { def today = Calendar.getInstance(); def dateYear = today.get(Calendar.YEAR); def dateMonth = today.get(Calendar.MONTH) + 1; def dateDay =today.get(Calendar.DATE); def todayDate =

Sending Multiple Selected Items from Controller to View

我的未来我决定 提交于 2020-01-05 12:34:41
问题 I have a list of items and user of this application may select as many items he wish. Now, I want to download the details of each selected items. I have method: getSelectedItems() which returns the ids of each selected items comma separated such as if user selects 2,4,6,7 item then it will return 2,4,6,7, Now, I want to pass this string as params to controller. I am using <g:link> tag such as: <g:link controller="items" action="downloadSelecteditems" params="${getSelectedItemss}" class="btn

Memory Leak in Grails with MongoDB

二次信任 提交于 2020-01-05 12:11:25
问题 I've found a strange issue when saving or updating several objects in Grails with MongoDB. Currently I'm using Grails 2.2.3 and MongoDB plugin 1.3.0. The problem seems to be that the instances of MiUsuario are never GC neither when I manually call the GC. In our main application we don't make batch updates, but when doing load tests (with JMeter and monitoring JVM with Java VisualVM) this problem causes memory filling and Tomcat stops responding. I've created a small new application to show