grails-3.0

Mapping with Hibernate Annotations in Grails 3.0.1

夙愿已清 提交于 2019-12-04 02:16:11
问题 How can I map a domain class with annotations in Grails 3.0.1? The following steps didn't work for me. Step 1 . I have created a new application with Grails 3.0.1 ( grails create-app books ). Step 2 . As described in Mapping with Hibernate Annotations I have created a new class in src/main/com/books/Book.groovy (tried src/main/groovy/com/books/Book.groovy as well) package com.books; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; @Entity

How to enable CORS in Grails 3.0.1

萝らか妹 提交于 2019-12-03 22:38:01
I would like to do cross origin communication using Grails in server side. The only documentation that I found is this one https://grails.org/plugin/cors but this is for an old version of Grails. The other documentation that I found is for spring: https://spring.io/guides/gs/rest-service-cors/ so I added the file SimpleCorsFilter.groovy to init/myproject/ folder, but I don't know how to wire this component into resources.groovy So, if you got here using grails 3.2.+ you can use the default way. Go to your application.yml and add: grails: cors: enabled: true It will add Access-Control-Allow

Grails 3.0 adding an inline plugin

﹥>﹥吖頭↗ 提交于 2019-12-03 21:01:16
I created simple grails 3.0 applications using commands below: create-app admin --profile=web create-plugin core --profile=plugin Now, I wanted to use core as an inline plugin in admin build, which is a web application. We can easily do that in grails version < 3.0 in buildconfig. Where can I do that in grails 3.0. Every help is worth appreciated. Inplace plugins have been replaced by multi project Gradle builds. See the Grails 3 functional test suite for an example https://github.com/grails/grails3-functional-tests Recently I used an inline plugin in my grails 3 application. here is how I did

How do I publish a grails 3 plugin to my local nexus repo?

怎甘沉沦 提交于 2019-12-03 12:58:47
Running grails publish-plugin doesn't seem to do anything, and the only documentation I could find was about publishing to bintray. [edit:] I can publish the plugin via gradle publish , but wondered if there was a grails-y way to do it, and wonder what grails publish-plugin actually does :/ Charlotte Tan I figured it out with help from Ryan Vanderwerf at http://rvanderwerf.blogspot.com/2015/07/how-to-publish-grails-3-plugin.html who writes that there are a bunch of spring-boot dependencies that don't have versions in them and that causes gradle to freak out. To workaround it, strip out all

Grails 3.3.0 with PostgreSQL 10.1 gives column this_.id does not exist error

时光怂恿深爱的人放手 提交于 2019-12-02 12:11:33
问题 I have to make a Grails 3.3.0 web interface for my internship with PostgreSQL version 10.1 as database and spring-security-core version 3.2.0. I used version 42.1.4 as a JDBC driver for PostgreSQL. I've installed PostgreSQL on my Linux laptop and created the webInterfaceDev database with the user postgres. However, every time I want to start the project I get an error that the column this_.id does not exist. This is the error that I get: 2017-11-16 14:42:21.464 ERROR --- [ main] o.h.engine

Grails 3 and Spring @RequestMapping

為{幸葍}努か 提交于 2019-12-02 08:41:38
In Grails 3 I'm trying to use spring-security-oauth, which provides a few endpoints via the @RequestMapping I can see in the mbeans that the path is configured but any request always hits grails and returns a 404. The requests never seem to hit any of the endpoints configured by the spring-security-oauth lib. Is there anyway to insure the requests hit the endpoints in the jar? To make sure the endpoints configured by @RequestMapping show in a Grails 3 app using Java config you have to use the following set up in Application.groovy @ComponentScan("my.org.config") class Application extends

Grails 3 Automatic Reconnect with MS Sql Server

混江龙づ霸主 提交于 2019-12-02 07:10:35
I am developing a web application on Grails 3.2.2 with spring boot and hibernate and MS SQL Server as a backend database. I want my application to reconnect with the database automatically whenever SQL server comes back after a restart or any other issue. This is how my application.yml file database-related properties look like: development: dataSource: dbCreate: update url: jdbc:jtds:sqlserver://machine_host_name:1433/db_name?autoReconnect=true properties: jmxEnabled: true initialSize: 5 maxActive: 50 minIdle: 5 maxIdle: 25 maxWait: 10000 maxAge: 600000 timeBetweenEvictionRunsMillis: 5000

Grails 3.3.0 with PostgreSQL 10.1 gives column this_.id does not exist error

故事扮演 提交于 2019-12-02 04:12:31
I have to make a Grails 3.3.0 web interface for my internship with PostgreSQL version 10.1 as database and spring-security-core version 3.2.0. I used version 42.1.4 as a JDBC driver for PostgreSQL. I've installed PostgreSQL on my Linux laptop and created the webInterfaceDev database with the user postgres. However, every time I want to start the project I get an error that the column this_.id does not exist. This is the error that I get: 2017-11-16 14:42:21.464 ERROR --- [ main] o.h.engine.jdbc.spi.SqlExceptionHelper : ERROR: column this_.id does not exist Position: 8 2017-11-16 14:42:21.504

Grails 3.0.1 - how to configure grails.gorm.default.constraints in application.yml

廉价感情. 提交于 2019-12-01 17:18:22
问题 I took the old configuration: grails.gorm.default.constraints = { '*' (nullable: true, blank: true) } ... and put it in the application.groovy . Luckily it worked as expected. How would one define this in application.yml ? I tried: grails: gorm: default: constraints: '*' (nullable: true, blank: true) but this gives errors on start. 回答1: application.groovy is the place to do that. Groovy code in a .yml config file is invalid and not supported. 来源: https://stackoverflow.com/questions/29518459

Mapping with Hibernate Annotations in Grails 3.0.1

纵饮孤独 提交于 2019-12-01 12:40:40
How can I map a domain class with annotations in Grails 3.0.1? The following steps didn't work for me. Step 1 . I have created a new application with Grails 3.0.1 ( grails create-app books ). Step 2 . As described in Mapping with Hibernate Annotations I have created a new class in src/main/com/books/Book.groovy (tried src/main/groovy/com/books/Book.groovy as well) package com.books; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; @Entity public class Book { private Long id; private String title; private String description; private Date