grails

Class 'myClassName' already exists in package 'myPackageName'

非 Y 不嫁゛ 提交于 2021-02-18 12:07:08
问题 I suddenly started facing a strange issue while working on my Grails application using IntelliJ. I have different domain classes and some other classes under src/groovy . When I open a class file to make some changes, I get an error that this class already exists in package which I don't have. I tried to rename the class using refactor but after that I still get the same error. Can anybody suggest what's wrong here or if I did something wrong? 回答1: Try to "Clear" you project and build again.

Class 'myClassName' already exists in package 'myPackageName'

余生长醉 提交于 2021-02-18 12:06:02
问题 I suddenly started facing a strange issue while working on my Grails application using IntelliJ. I have different domain classes and some other classes under src/groovy . When I open a class file to make some changes, I get an error that this class already exists in package which I don't have. I tried to rename the class using refactor but after that I still get the same error. Can anybody suggest what's wrong here or if I did something wrong? 回答1: Try to "Clear" you project and build again.

compileAssets failing on upgrading Grails application

孤者浪人 提交于 2021-02-11 14:46:20
问题 I have a Grails application running version 3.3. I recently upgraded to version 4.0.3. The way I typically upgrade, which I understand is probably not the best way, is to upgrade my environment to the new Grails version, then create a brand new Grails project (I'm using IntelliJ), and then slowly move my files over from the old project to the new project, fixing things as I find they don't work. I have everything moved over and the app works perfectly while running run-app inside IntelliJ.

Create form for domain object with multiselect Enum field fails with 'Property xxx is type-mismatched'

别来无恙 提交于 2021-02-11 13:00:42
问题 I am using Grails 4.0.4 w/ GORM 7.0.7.RELEASE The database I am using is MongoDB I can successfully run the application and navigate to the create form for the domain class. I can select the value for the singleton field someOtherEnum . I can multiselect values for the categories field. When I submit the form, however, I get this message: 'Property categories is type-mismatched'. I used this approach based on the answers to another question posted here, but it's not working for me. I am not

Render map as json in Grails

泄露秘密 提交于 2021-02-10 20:26:31
问题 I'm using Grails for my application, and I have a problem with JSON converters. In my controller, I have: def myObject = [:] myObject.key = 'value' render ??? what is optimal way to render myObject as JSON from the controller? 回答1: It's easy : render (myObject as JSON) or render ([key: "value"] as JSON) 回答2: Other way is : render (contentType: 'text/json'){ array { for(f in Person.list()){ person id: f.id, name: f.name } } } This sample render a list of Persons 来源: https://stackoverflow.com

Uploading a large file (>1GB) to grails3

吃可爱长大的小学妹 提交于 2021-02-10 19:42:29
问题 Uploading a large file (>1GB) to a grails, I only need to access it via stream, no need to save the entire file to disk or RAM. However how can I access the upload stream? I tried with an Interceptor: class UploadLargeFileInterceptor { int order = HIGHEST_PRECEDENCE UploadLargeFileInterceptor() { match(controller:"apiv2", action:"uploadLarge") } boolean before() { log.error('before') log.error(request.getInputStream().text.length() as String) true } boolean after() { log.error('after') true }

Uploading a large file (>1GB) to grails3

心不动则不痛 提交于 2021-02-10 19:41:31
问题 Uploading a large file (>1GB) to a grails, I only need to access it via stream, no need to save the entire file to disk or RAM. However how can I access the upload stream? I tried with an Interceptor: class UploadLargeFileInterceptor { int order = HIGHEST_PRECEDENCE UploadLargeFileInterceptor() { match(controller:"apiv2", action:"uploadLarge") } boolean before() { log.error('before') log.error(request.getInputStream().text.length() as String) true } boolean after() { log.error('after') true }

IntelliJ IDEA 中文官方文档

爷,独闯天下 提交于 2021-02-10 11:41:15
目录 认识IntelliJ IDEA IntelliJ IDEA 安装和设置 IntelliJ IDEA如何使用 IntelliJ IDEA中不容错过的快捷键 IntelliJ IDEA专业的使用技巧 从IntelliJ IDEA获取帮助 使用IntelliJ IDEA的帮助主题 使用Tips of the Day和在线资源 使用Productivity Guide IntelliJ IDEA问题报告并分享意见 keymap 参考 IntelliJ IDEA的一般准则 使用IntelliJ IDEA的用户界面进行导览 IntelliJ IDEA欢迎界面 IntelliJ IDEA的菜单栏与工具栏 IntelliJ IDEA导航栏操作 IntelliJ IDEA状态栏 IntelliJ IDEA的视图模式 设置IntelliJ IDEA背景图像 设置IntelliJ IDEA项目和工作环境 IntelliJ IDEA配置代码样式 IntelliJ IDEA如何配置颜色与字体 配置IntelliJ IDEA键盘快捷键 IntelliJ IDEA如何配置菜单、工具栏与行分隔符 配置IntelliJ IDEA的快速列表 IntelliJ IDEA如何使用代码样式 IntellJ IDEA文件的类型与颜色 IntelliJ IDEA配置文件编码 切换启动JDK与共享IDE设置

Threads are going to be renewed over time to try and avoid a probable memory leak

天大地大妈咪最大 提交于 2021-02-08 14:00:07
问题 I try to deploy my war file. But after success deployment. I get this log: [root@dfdfdf bin]# export JAVA_HOME="/usr/java/jdk1.8.0_112/" [root@dfdfdfdbin]# ./startup.sh Using CATALINA_BASE: /root/apache-tomcat-8.5.8 Using CATALINA_HOME: /root/apache-tomcat-8.5.8 Using CATALINA_TMPDIR: /root/apache-tomcat-8.5.8/temp Using JRE_HOME: /usr/java/jdk1.8.0_112/ Using CLASSPATH: /root/apache-tomcat-8.5.8/bin/bootstrap.jar:/root/apache-tomcat-8.5.8/bin/tomcat-juli.jar Tomcat started. [root@satubangau

Grails 4.0.1 - Spock unit test cases fail because of spaces

点点圈 提交于 2021-02-08 11:20:29
问题 I am testing i18n formatting using unit tests in my Grails 4.0.1 application but seeing strange results. To me, this specs condition should be satisfied, but it is not. I don't suppose anyone has had a similar experience that can be explained, or maybe it's simply a bug? Any help would be appreciated. 回答1: Just as an idea: Can you iterate over both expected and actual values and convert the characters one by one to the ascii so that you'll probably see the difference for( c in ​'123 456,78 $'