我正在關注免費的在線書籍「Grails入門」(http://www.infoq.com/minibooks/grails-getting-started),並在嘗試列出任何域類時遇到java.lang.ClassCastException。任何人都可以破譯這個?Grails應用程序中的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的代碼。鑑於它是堆棧跟蹤的頂部,您應該從哪裏開始尋找。 – David 2013-03-21 02:20:27
嘗試grails乾淨的力量:) – uchamp 2013-03-21 05:43:46
當我從想法運行,但不是從命令行(grails run-app)運行時,我注意到了這個問題。也許這與環境有關?我們的生產版本使用遠程數據庫,並且開發人員使用hsqldb。 – nycynik 2013-07-09 19:31:19