【发布时间】:2013-03-10 04:19:04
【问题描述】:
我正在关注免费的在线书籍“Grails 入门”(http://www.infoq.com/minibooks/grails-getting-started),并且在尝试列出任何域类时遇到 java.lang.ClassCastException。谁能破译这个?
URI: /RaceTrack/runner/list
Class: java.lang.ClassCastException
Message: sun.proxy.$Proxy26 cannot be cast to org.springframework.orm.hibernate3.HibernateCallback
堆栈跟踪:
Line | Method
->> 15 | list in RunnerController.groovy
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 186 | doFilter in PageFragmentCachingFilter.java
| 63 | doFilter in AbstractFilter.java
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 722 | run in java.lang.Thread
附加信息(PageFragmentCachingFilter.java 的第 186 行附近)
183: if(method == null) {
184: log.debug("No cacheable method found for {}:{} {}",
185: new Object[] { request.getMethod(), request.getRequestURI(), getContext() });
186: chain.doFilter(request, response);
187: return;
188: }
189: Collection<CacheOperation> cacheOperations = cacheOperationSource.getCacheOperations(
附加信息(大约在 AbstractFilter.java 的第 63 行):
60: try {
61: // NO_FILTER set for RequestDispatcher forwards to avoid double gzipping
62: if (filterNotDisabled(request)) {
63: doFilter(request, response, chain);
64: }
65: else {
66: chain.doFilter(req, res);
【问题讨论】:
-
能否请您包含来自 RunnerController 的代码。鉴于它是您应该开始查找的堆栈跟踪的顶部。
-
试试 grails clean 的威力 :)
-
我从idea运行时注意到了这个问题,但不是从命令行(grails run-app)运行。也许这与环境有关?我们的生产版本使用的是远程数据库,而开发版本使用的是 hsqldb。
-
从IDEA运行时也有问题,但不是命令行。清除 .slcache 没有帮助,所以必须与 IDEA 相关。
标签: exception grails groovy classcastexception