grails-2.4

Mongo CursorNotFound exception in active cursor via Grails domain criteria

江枫思渺然 提交于 2020-01-02 02:11:09
问题 I'm using Grails 2.4.4, mongo plugin 3.0.2, MongoDB 2.4.10 using a remote database connection. grails { mongo { host = "11.12.13.14" // A remote server IP port = 27017 databaseName = "blogger" username = "blog" password = "xyz" options { autoConnectRetry = true connectTimeout = 3000 connectionsPerHost = 40 socketTimeout = 120000 threadsAllowedToBlockForConnectionMultiplier = 5 maxAutoConnectRetryTime=5 maxWaitTime=120000 } } } In a part of our application, a service method iterates over a 20

Odd behavior with default index action when unit testing a RestfulController in grails

社会主义新天地 提交于 2019-12-24 23:12:21
问题 Using grails 2.4.4 (and 2.4.5) I created the following tiny application. grails create-app example cd example grails create-domain-class Book Then edited Book.groovy to look like package example class Book { String title; static constraints = { } } Then added a basic Controller grails> create-controller example.book | Created file grails-app/controllers/example/BookController.groovy | Created file grails-app/views/book | Created file test/unit/example/BookControllerSpec.groovy and modify the

Fetching some value from message.properties in Grails

巧了我就是萌 提交于 2019-12-24 02:34:08
问题 Want to fetch a value from message.properties file in grails in a job , how can I do that ?? My Job: def execute() { // execute task List<String> emails = NayaxUser.findAllByEmailSent(false)*.username emails.each {emailAddress-> mailService.sendMail { //todo: FETCH FROM MESSAGE.PROPERTIES to emailAddress from FETCH FROM MESSAGE.PROPERTIES subject FETCH FROM MESSAGE.PROPERTIES html body.toString() } } } 回答1: You can use: g.message(code: 'my.message.code') //or g.message(code: 'my.message.code'

Grails - jQuery UI Autocomplete not working

主宰稳场 提交于 2019-12-24 00:38:50
问题 I'm trying to use jQuery UI Autocomplete in my input field. This is my code in controller. import grails.converters.* class SomeController { def someClassList = { def list1 = SomeClass.list() def scList = [] list1.each { scList.add(it.someClassAttribute) } render scList as JSON } } I have this in my view. <head> ... <link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.css"> <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1

Upgrading grails from 2.1.1 to 2.4.3

丶灬走出姿态 提交于 2019-12-23 07:16:43
问题 I am upgrading a grails app from 2.1.1 to 2.4.3 and solving errors along the upgrade is a never ending story. Now I am stuck at this point. Any ideas how to solve this? Thanks! C:\workspace\grails_apps\monitoring>grails run-app | Running Grails application | Error 2014-09-20 17:36:55,136 [localhost-startStop-1] ERROR context.ContextLoader - Context initialization failed Message: Error creating bean with name 'grailsApplication' defined in ServletContext resource [/WEB-INF/applicationContext

Upgrading grails from 2.1.1 to 2.4.3

对着背影说爱祢 提交于 2019-12-23 07:14:29
问题 I am upgrading a grails app from 2.1.1 to 2.4.3 and solving errors along the upgrade is a never ending story. Now I am stuck at this point. Any ideas how to solve this? Thanks! C:\workspace\grails_apps\monitoring>grails run-app | Running Grails application | Error 2014-09-20 17:36:55,136 [localhost-startStop-1] ERROR context.ContextLoader - Context initialization failed Message: Error creating bean with name 'grailsApplication' defined in ServletContext resource [/WEB-INF/applicationContext

Grails 2.4.3 fails to reload controller or service

自闭症网瘾萝莉.ら 提交于 2019-12-19 17:38:58
问题 I have upgraded a Grails 2.3.8 project to 2.4.3. In 2.3.8 we had problems with forked execution, so I have disabled it. Now, when I enable it, and try to reload a changed service or controller class, I get error like these: 2014-09-25 19:50:37,043 [Thread-11] ERROR plugins.AbstractGrailsPluginManager - Plugin [controllers:2.4.3] could not reload changes to file [C:\projects2\...\grails-app\controllers\com\...\AdminController.groovy]: Cannot get property 'cacheOperationSource' on null object

Grails auto-reloading new controller actions

风流意气都作罢 提交于 2019-12-14 00:23:05
问题 I've created new Grails 2.4.3 project created TestController set grails.reload.enabled = true in BuildConfig.groovy run application with grails -reloading run-app My controller action code: def index() { render "test" } When I change the string test to test2 - I see in console (in Eclipse): .................. |Compiling 1 source files And after reloading page I see test2 - ok. But when I try to add new method: def test3() { render "test3" } I see: Why? Why there isn't even the url? Example -

Grails 2.4 spring security & Asset pipeline

拟墨画扇 提交于 2019-12-11 19:00:08
问题 This is what request map table contains: '/', '/index', '/index.gsp', '/**/favicon.ico', '/assets/**', '/**/js/**', '/**/css/**', '/**/images/**', '/login', '/login.*', '/login/*', '/logout', '/logout.*', '/logout/*'] But no static resources are loaded in login page . every request to static resource redirects to login/auth . 回答1: In my (Spring Security 2.0-RC4) application I have: grails.plugin.springsecurity.controllerAnnotations.staticRules = [ '/' : ['permitAll'], '/searchable/**' : [

Grails IntegrationSpec IllegalStateException

笑着哭i 提交于 2019-12-10 10:29:58
问题 After upgrading to 2.4.2 from 2.4.0, I am getting an error when I run my integration tests. It shows that the tests passed, however I am getting an IllegalStateException. Failure: | massemailsystem.UserInformationIntegrationSpec | java.lang.IllegalStateException: Could not find ApplicationContext, configure Grails correctly first at grails.util.Holders.getApplicationContext(Holders.java:97) at grails.test.spock.IntegrationSpec.$spock_initializeSharedFields(IntegrationSpec.groovy:41) I tried