grails

Swagger grails Integration

假如想象 提交于 2020-01-17 06:14:25
问题 I am new to swagger and I want to integrate swagger to Restful API project using grails framework. Please help if anybody have any idea what i am doing wrong? my grails specification as below: | Grails Version: 3.0.7 | Groovy Version: 2.4.4 | JVM Version: 1.8.0_71 Did some settings for swagger as below: in build.gradle: dependencies { ... compile "io.swagger:swagger-core:1.5.3" compile "io.swagger:swagger-jaxrs:1.5.3" ... } in resources.groovy import io.swagger.jaxrs.config.BeanConfig beans =

How to specify portable jndi datsource lookup in grails

孤街浪徒 提交于 2020-01-17 05:45:20
问题 I know JNDI lookup in grails is as simple as datasource { jndiName = "java:comp/env/myDataSource" } this works great on Tomcat. On other containers (WebLogic, JBOSS, etc.) the jndiName for the same thing would be just myDataSource . The question is how do I configure this to be generic and portable so that the code does not need to be changed based on the deploy target? 回答1: You might be able to key off a system property that you know will be set when running in Tomcat and not set anywhere

how to get GWT work with Grails 3

帅比萌擦擦* 提交于 2020-01-17 05:02:13
问题 I am using Grails latest version i.e 3.1.3, and GWT I have gone through the gwt/grails plugin and their tutorials , but All of this is for old version of grails , where we had "BuildConfig.groovy" and the format looks different. Now as we have build.gradle , I cant find a way to put gwt plugin there What i have tried is : adding compile "org.grails.plugins:gwt:1.0.2" now when i run command: grails create-gwt-module I get the exception: Could not resolve all dependencies for configuration '

alternative to grails multicolumn unique constraint (optimistic inserts)

拈花ヽ惹草 提交于 2020-01-17 04:22:49
问题 I have a heavy used domain class Relationship which looks pretty similar to following one class Relationship { Element source Element destination Type type // other properties omitted static constraints = { type unique: ['source', 'destination'] } } I have a service creating new instances of this domain class which checks for existing instances and if found reuses them but I would like to implement sort of optimistic inserts with the unique constraint only in the database because GORM unique

Error while deploying grails app on tomcat 8

試著忘記壹切 提交于 2020-01-17 01:31:11
问题 I have simply grails app, while im trying to deploy war file with my app on tomcat i recive such errors, just part of it Configuring Spring Security Core ... ... finished configuring Spring Security Core Configuring Spring Security LDAP ... ... finished configuring Spring Security LDAP ERROR org.springframework.boot.SpringApplication - Application startup failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManagerPostProcessor' :

YourKit Profile On Remote Grails App

烈酒焚心 提交于 2020-01-17 01:20:30
问题 I am trying to track down a memory leak that I am having with a Grails application and am using the Yourkit Profiler, but am running into a problem. I have the Grails application running in Tomcat6 on the Production server and have unpacked the YourKit profiler and ran it according to the documentation using sudo bin/yjp.sh -attach , but I am getting the error: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect

Disable the natively generated identity value feature in grails

穿精又带淫゛_ 提交于 2020-01-16 23:14:44
问题 The following is my Domain class details. class Age { String agetype static constraints = { } } I am using HeidiSQL. I want to drop the id column that is generated automatically.And set primary key as 'agetype'. what I can I do? 回答1: Identifier can be customized easily inside the mapping block, if the default id is not required. class Age { String agetype static mapping = { id name: 'agetype', column: 'AGE_TYPE', // if the column name is AGE_TYPE generator: 'assigned' // Unique String should

Disable the natively generated identity value feature in grails

风流意气都作罢 提交于 2020-01-16 23:14:02
问题 The following is my Domain class details. class Age { String agetype static constraints = { } } I am using HeidiSQL. I want to drop the id column that is generated automatically.And set primary key as 'agetype'. what I can I do? 回答1: Identifier can be customized easily inside the mapping block, if the default id is not required. class Age { String agetype static mapping = { id name: 'agetype', column: 'AGE_TYPE', // if the column name is AGE_TYPE generator: 'assigned' // Unique String should

Using a Grails service inside a script

谁都会走 提交于 2020-01-16 20:34:09
问题 I'm trying to use a Grails service inside the following Grails script includeTargets << grailsScript("_GrailsInit") target(loadGames: "The description of the script goes here!") { def listFile = new File('list.txt') listFile.eachLine { def result = ctx.getBean("bggService").search(it) println it + " " + result.length() } } setDefaultTarget(loadGames) I've seen about a dozen different webpages each offering a different combination of ctx appCtx , and applicationContext (as well as many others)

Grails conflict between jQuery Plugin and JS script

夙愿已清 提交于 2020-01-16 20:05:31
问题 I have a Grails app that needs jQuery, so I load jQuery and jQuery-UI via plugins: buildConfig.groovy: runtime ":jquery:1.11.1" compile ":jquery-ui:1.10.4" That works fine as far as I don't include a standalone JS-script that also uses jQuery. This script is named myscript.jquery.js and I placed it under web-app/js. Now I include those plugins and the script in my main.gsp: main.gsp: <html> <head> ... <r:require modules='jquery, jquery-ui, bootstrap, customcss' /> <g:javascript src="myscript