- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有以下域对象:
package example.rest
import grails.rest.Resource
@Resource(uri="/departments", formats=['json', 'xml'])
class Department {
String displayName
Integer locationId
Boolean showModal
static mapping = {
id generator: "assigned"
table "departments"
version false
}
static constraints = {
showModal nullable: true
displayName nullable: true
locationId nullable: true
}
}
ERROR errors.GrailsExceptionResolver - GroovyCastException occurred when processing request: [PUT] /example-rest/departments/21
Cannot cast object 'example.rest.DepartmentController$_update_closure7@6e36bf53' with class 'example.rest.DepartmentController$_update_closure7' to class 'example.rest.DepartmentController'. Stacktrace follows:
org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object 'example.rest.DepartmentController$_update_closure7@6e36bf53' with class 'example.rest.DepartmentController$_update_closure7' to class 'example.rest.DepartmentController'
at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:200)
at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
最佳答案
修复http://jira.grails.org/browse/GRAILS-10972时,我遇到了类似的问题。您的问题应该在Grails 2.3.5中解决(将在本周末发布)。由commit https://github.com/grails/grails-core/commit/d073a93b修复。
确保Config.groovy中的grails.mime.types设置也已更新。必须手动完成。参见GRAILS-10973。
关于grails - Grails @Resource在PUT上抛出GroovyCastException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20527987/
对于单元测试,我需要模拟Grails服务中使用的几个与Apache Thrift相关的Java类(THttpClient,TBinaryProtocol和一个生成的Client),但是使用常规的模拟技
我在构建期间执行的 Jenkinsfile 中运行以下 groovy 脚本: import java.util.stream.Collectors import java.util.stream.St
我是 groovy 和 Jenkins DSL 工作的新手。我正在尝试使用常规脚本来创建运行测试脚本的作业。我遇到了一个 Cannot cast object 错误,我不确定问题是什么,也不确定是在什
我在服务中抛出异常(尤其是这些验证)并在 Controller 中 try catch 它们。我正在获取数据 在公司 Controller 中: try{ def data = request
我在我的网络应用程序项目中广泛使用了 groovy 类。我可以创建一个类型的实例(定义为 groovy 类),但以后永远不能强制转换回它(GroovyCastException 发生)。 org.co
我正在尝试从 jar 存档中读取文件,并将其作为 java.io.InputStream 返回。 这是我试图实现此目的的方法: InputStream getExportInfo(path) {
目前我正在研究一种以字符串形式运行java代码的方法。这就是我的做法。 import java.util.HashMap; import java.util.Map; import groovy.la
我是一名优秀的程序员,十分优秀!