
Grails
friendan
快乐源于分享丶
展开
-
重命名文件夹.gradle
我想让grails重新生成.gradle,又不想删除现在的.gradle文件夹,所以想到了重命名,常规的方法重命名不了,只有使用dos命令了:ren C:\Users\Administrator\.gradle .gradle222如果执行命令后,出现拒绝访问,打开任务管理器,把所有的java.exe进程关闭即可。原创 2016-03-15 21:38:05 · 2530 阅读 · 0 评论 -
No Datastore Session bound to thread, and configuration does not allow creation of non-transactional
参考文章:https://stackoverflow.com/questions/31032623/java-lang我的环境:| Grails Version: 3.1.3| Groovy Version: 2.4.6| JVM Version: 1.7.0_80今天在gsp页面查询数据库出现如下错误:java.lang.IllegalStateException原创 2016-04-19 09:00:36 · 967 阅读 · 0 评论 -
Error Error occurred running Grails CLI: No profile found for name [web]. (Use --stacktrace to see
我的环境:| Grails Version: 3.1.4| Groovy Version: 2.4.6| JVM Version: 1.7.0_80C:\Users\Administrator>----------------------------------------------------------------------错误信息:D:\Projects\原创 2016-05-28 22:18:47 · 6479 阅读 · 0 评论 -
Grails在服务类中获取web根目录
参考文章:http://www.oschina.net/code/snippet_1579_2199众所周知在控制器,获取web根目录只要调用以下这行代码就可以了:servletContext.getRealPath("/")然而在服务类中没有servletContext,这下麻烦大了,如何得到servletContext呢?困扰了我好久。。。解法方法:原创 2016-05-17 09:44:55 · 2365 阅读 · 0 评论 -
IntelliJ IDEA 15.0.2运行grails工程不能自动重新加载修改后的类的问题
之前运行grails工程,然后修改控制器类,服务类等,IDEA都能够自动重新加载修改后的类,这样就不用重新启动工程了,很是方便。今天发现竟然不能自动加载修改后的类了,真是郁闷呀。。。-------------------------------------------------------------------------------------------------------原创 2016-05-30 18:14:31 · 3112 阅读 · 0 评论 -
grails指定端口运行工程
我的环境: | Grails Version: 3.1.4| Groovy Version: 2.4.6| JVM Version: 1.7.0_80根据grails手册,可以通过以下方式指定端口,不过我发现无效哈!grails -Dserver.port=8090 run-app-----------------------------------------原创 2016-05-31 20:46:52 · 1710 阅读 · 0 评论 -
window.onscroll无效问题
我的环境:| Grails Version: 3.1.4| Groovy Version: 2.4.6| JVM Version: 1.7.0_80--------------------------------------------------------------------------------------------------------------------原创 2016-06-11 00:24:04 · 17275 阅读 · 4 评论 -
解决grails上传文件过大,发生异常的问题
参考文章:http://my.oschina.net/scjelly/blog/523705http://docs.grails.org/latest/guide/spring.htmlhttp://docs.grails.org/latest/guide/theWebLayer.html#uploadingFiles我的环境:| Grails Version: 3.1原创 2016-06-13 17:06:21 · 3296 阅读 · 0 评论 -
grails org.hibernate.LazyInitializationException: could not initialize proxy - no Session
参考文章:http://stackoverflow.com/questions/1368025/grails-and-hibernates-lazy-initialization-exceptionhttp://piperzero.iteye.com/blog/1660556错误信息:Caused by: org.hibernate.LazyInitializationEx原创 2016-06-15 15:21:24 · 2021 阅读 · 0 评论 -
grails在gsp页面显示资源图片
我的环境是:| Grails Version: 3.1.4| Groovy Version: 2.4.6| JVM Version: 1.7.0_80在工程目录src\main\webapp下面新建文件夹:resources,然后把需要的图像文件放到resources目录里面,如:xx.jpg在gsp页面添加以下代码即可显示我们之前添加的图像了:或原创 2016-07-02 13:32:23 · 1715 阅读 · 0 评论 -
grails调用groovy脚本
参考文章:http://www.poorren.com/java-groovy-dynamic-algorithm/http://www.cnblogs.com/jizha/p/5027695.html?utm_source=tuicool&utm_medium=referralgrails本身就是使用groovy开发的,所以调用groovy脚本也是很方便的。我封装原创 2016-06-24 13:08:04 · 1482 阅读 · 0 评论 -
No 'Access-Control-Allow-Origin' header is present on the requested resource.
我的环境:| Grails Version: 3.1.4| Groovy Version: 2.4.6| JVM Version: 1.7.0_80-------------------------------------------------------------------错误信息:XMLHttpRequest cannot load http://xxx. No原创 2016-05-10 16:22:23 · 1788 阅读 · 0 评论 -
org.hibernate.ObjectNotFoundException: No row with the given identifier exists:
参考文章:http://www.tuicool.com/articles/uuMJbu我的环境:| Grails Version: 3.1.4| Groovy Version: 2.4.6| JVM Version: 1.7.0_80-----------------------------------------------------------------------原创 2016-05-10 14:40:49 · 1268 阅读 · 0 评论 -
| Error Error initializing classpath: Unable to start the daemon process.
今天运行命令:grails run-app 出现如下错误:| Error Error initializing classpath: Unable to start the daemon process.This problem might be caused by incorrect configuration of the daemon.For example, an unreco原创 2016-03-31 11:12:43 · 1497 阅读 · 0 评论 -
IntelliJ IDEA 15.0.2导入grails工程
我的环境:grails-3.1.3 + IntelliJ IDEA 15.0.2 + WIN7 X74基础知识:1、grails框架使用gradle来管理工程。IntelliJ IDEA导入grails工程分三步走:第一步:导入grails工程所在文件夹。第二步:设置grails所在文件夹。第三步:配置工程运行----------------------------原创 2016-03-31 12:49:16 · 7947 阅读 · 1 评论 -
| Error Error occurred running Grails CLI: Profile [org.grails.profiles:base:3.1 .3] declares and in
在公司运行grails正常, 在家运行grails时老是出现以下错误:D:\Projects\Grails\project\HelloWorld>grailsJava HotSpot(TM) Client VM warning: TieredCompilation is disabled in this release.| Error Error occurred running原创 2016-03-20 11:16:27 · 2154 阅读 · 0 评论 -
Error Domain class not found for name User
Grails执行命令:generate-views User出现以下错误:| Error Domain class not found for name User错误原因:1、领域类User在某个包中,所以创建视图时必须包含包名和类名。解决方法:1.创建视图时包含领域类的包名和类名即可,如:generate-views cn.xxx.yyy.User原创 2016-04-01 09:50:54 · 762 阅读 · 0 评论 -
Grails在xx.gsp页面获取配置文件信息
我的环境:1、| Grails Version: 3.1.3| Groovy Version: 2.4.6| JVM Version: 1.7.0_802、配置文件是:application.yml---------------------------------------------如application.yml文件有如下内容:user: n原创 2016-04-06 11:55:23 · 1654 阅读 · 0 评论 -
Error Error initializing classpath: Connection timed out: connect (Use --stacktrace to see the full
参考文章:http://cache.baiducontent.com/c?m=9d78d513d99007b8589cc93e5801d6160e54f7743da785552c82cd1f84652b564711f4ba5767505791872b2716ae394bea87217347557df2c796d5198bac935838885023716cd01c578f47f2981032c05原创 2016-03-13 22:10:14 · 3392 阅读 · 0 评论 -
Could not download spring-boot-autoconfigure.jar (org.springframework.boot: spring-boot-autoconfigur
我在家创建了一个grails工程运行grails run-app,出现如下错误:D:\Projects\Grails\project\HelloWorld>grails run-appJava HotSpot(TM) Client VM warning: TieredCompilation is disabled in this release.> Configuring > 0/原创 2016-03-14 22:36:57 · 7730 阅读 · 0 评论 -
at org.gradle.wrapper.Download.downloadInternal(Download.java:58)
我的环境:| Grails Version: 3.1.3| Groovy Version: 2.4.6| JVM Version: 1.7.0_80--------------------------------------------------------------------------------------------------今天启动grails项目出现如下原创 2016-04-25 12:49:10 · 1277 阅读 · 0 评论 -
调用grails领域类save方法没反应,不成功问题
参考文章:http://akunamotata.iteye.com/blog/1742859问题: 今天在调用领域类的save方法时,没有任何反应,数据库没有任何数据,没有任何出错信息,真是奇怪了。。。解决方法:1.在调用领域类的save方法时,判断一下返回值,然后打印错误信息看看是什么原因引起的。if(!xxx.save()){原创 2016-04-27 18:06:36 · 2008 阅读 · 0 评论 -
grails在服务类中获取配置文件的值
我的环境:| Grails Version: 3.1.4| Groovy Version: 2.4.6| JVM Version: 1.7.0_80配置文件是:application.yml------------------------------------------------application.yml文件有如下配置内容:topinf原创 2016-04-27 18:12:54 · 2111 阅读 · 0 评论 -
grails Deadlock found when trying to get lock; try restarting transaction
参考文章: http://blog.youkuaiyun.com/aesop_wubo/article/details/8286215 http://www.aichengxu.com/view/24054 最近碰到在领域类中自关联时产生的死锁问题,被困扰了好几天, 后面解决时发现太简单了,真是始料不及呀。。。 // 我碰到死锁时,领域类的关键代码如下,翻开数据库day原创 2016-06-22 11:02:23 · 3504 阅读 · 0 评论