今天在用grails时出现一个奇怪的错误

本文探讨了一个在Grails项目中遇到的问题:在文件D: estgrailsprojectsproductknowlegegrails-appdomainorgsecurityResource.groovy中出现了两次类Resource的定义。其中一个通过class语句显式定义,另一个则是基于文件名从脚本主体自动生成的。文章提供了修改文件名或类名的解决方案,并解释了问题的根本原因在于UE的编码设置问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

3: Invalid duplicate class definition of class Resource : The source D:\test\grails\projects\productknowlege\grails-app\domain\org\security\Resource.groovy contains at least two definitions of the class Resource.
One of the classes is an explicit generated class using the class statement, the other is a class generated from the script body based on the file name. Solutions are to change the file name or to change the class name.
@ line 3, column 1.
class Resource {
^

1 error

查了半天外国网站,最后才知道是UE保存时,编码设置的问题,重新创建了一下文件就OK了。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值