Hibernate version: 2.1.7[c]
We're trying to use the StandardQueryCache with a Remote Cache (JCS), which WILL serialize the keys and values put into it.
Doing a get on the StandardQueryCache causes a NotSerializableException: java.lang.reflect.Method. Browsing through the code, I see that it's doing a cache.get on a QueryKey, which clearly has a reference to an Object with a java.lang.reflect.Method on it.
Here's the complete stack trace:
Code:
11:37:00,655 ERROR RemoteCache:361 - java.rmi.MarshalException: error marshalling arguments; nested exception is:
java.io.NotSerializableException: java.lang.reflect.Method
11:37:00,656 ERROR RemoteCache:364 - sun.rmi.server.UnicastRef.invoke(UnicastRef.java:122)
11:37:00,657 ERROR RemoteCache:364 - org.apache.jcs.auxiliary.remote.server.RemoteCacheServer_Stub.get(RemoteCacheServer_Stub.java:183)
11:37:00,658 ERROR RemoteCache:364 - org.apache.jcs.auxiliary.remote.RemoteCache.get(RemoteCache.java:163)
11:37:00,659 ERROR RemoteCache:364 - org.apache.jcs.auxiliary.remote.RemoteCacheNoWait.get(RemoteCacheNoWait.java:88)
11:37:00,661 ERROR RemoteCache:364 - org.apache.jcs.auxiliary.remote.RemoteCacheNoWaitFacade.get(RemoteCacheNoWaitFacade.java:133)
11:37:00,662 ERROR RemoteCache:364 - org.apache.jcs.engine.control.CompositeCache.get(CompositeCache.java:496)
11:37:00,663 ERROR RemoteCache:364 - org.apache.jcs.engine.control.CompositeCache.get(CompositeCache.java:403)
11:37:00,664 ERROR RemoteCache:364 - org.apache.jcs.access.CacheAccess.get(CacheAccess.java:199)
11:37:00,665 ERROR RemoteCache:364 - net.sf.hibernate.cache.JCSCache.get(JCSCache.java:31)
11:37:00,666 ERROR RemoteCache:364 - net.sf.hibernate.cache.StandardQueryCache.get(StandardQueryCache.java:64)
11:37:00,667 ERROR RemoteCache:364 - net.sf.hibernate.loader.Loader.list(Loader.java:1015)
11:37:00,668 ERROR RemoteCache:364 - net.sf.hibernate.hql.QueryTranslator.list(QueryTranslator.java:854)
11:37:00,669 ERROR RemoteCache:364 - net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1553)
11:37:00,681 ERROR RemoteCache:364 - net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:39)
11:37:00,682 ERROR RemoteCache:364 - org.springframework.orm.hibernate.HibernateTemplate$31.doInHibernate(HibernateTemplate.java:658)
11:37:00,683 ERROR RemoteCache:364 - org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:243)
11:37:00,684 ERROR RemoteCache:364 - org.springframework.orm.hibernate.HibernateTemplate.executeFind(HibernateTemplate.java:263)
11:37:00,685 ERROR RemoteCache:364 - org.springframework.orm.hibernate.HibernateTemplate.findByNamedQuery(HibernateTemplate.java:647)
11:37:00,686 ERROR RemoteCache:364 - org.springframework.orm.hibernate.HibernateTemplate.findByNamedQuery(HibernateTemplate.java:639)
11:37:00,687 ERROR RemoteCache:364 - com.ifilm.dao.HibernateMainDao.findByNamedQuery(HibernateMainDao.java:131)
11:37:00,688 ERROR RemoteCache:364 - com.ifilm.dao.HibernateMainDao.getPrimaryGenresByType(HibernateMainDao.java:309)
11:37:00,689 ERROR RemoteCache:364 - com.ifilm.servlet.list.Drilldown.service(Drilldown.java:86)
11:37:00,690 ERROR RemoteCache:364 - javax.servlet.http.HttpServlet.service(HttpServlet.java:103)
11:37:00,691 ERROR RemoteCache:364 - com.caucho.server.http.FilterChainServlet.doFilter(FilterChainServlet.java:96)
11:37:00,696 ERROR RemoteCache:364 - com.ifilm.servlet.AdRedirectFilter.doFilter(AdRedirectFilter.java:81)
11:37:00,697 ERROR RemoteCache:364 - com.caucho.server.http.FilterChainFilter.doFilter(FilterChainFilter.java:88)
11:37:00,698 ERROR RemoteCache:364 - com.ifilm.servlet.WWWRedirectFilter.doFilter(WWWRedirectFilter.java:39)
11:37:00,699 ERROR RemoteCache:364 - com.caucho.server.http.FilterChainFilter.doFilter(FilterChainFilter.java:88)
11:37:00,700 ERROR RemoteCache:364 - com.ifilm.util.HibernateFilter.doFilter(HibernateFilter.java:22)
11:37:00,701 ERROR RemoteCache:364 - com.caucho.server.http.FilterChainFilter.doFilter(FilterChainFilter.java:88)
11:37:00,702 ERROR RemoteCache:364 - com.ifilm.filter.global.UniqueMaker.doFilter(UniqueMaker.java:43)
11:37:00,703 ERROR RemoteCache:364 - com.caucho.server.http.FilterChainFilter.doFilter(FilterChainFilter.java:88)
11:37:00,704 ERROR RemoteCache:364 - com.caucho.http.filter.GzipFilter.doFilter(GzipFilter.java:128)
11:37:00,705 ERROR RemoteCache:364 - com.caucho.server.http.FilterChainFilter.doFilter(FilterChainFilter.java:88)
11:37:00,739 ERROR RemoteCache:364 - com.caucho.server.http.Invocation.service(Invocation.java:315)
11:37:00,740 ERROR RemoteCache:364 - com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:135)
11:37:00,741 ERROR RemoteCache:364 - com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:246)
11:37:00,742 ERROR RemoteCache:364 - com.caucho.server.http.HttpRequest.handleConnection(HttpRequest.java:164)
11:37:00,743 ERROR RemoteCache:364 - com.caucho.server.TcpConnection.run(TcpConnection.java:139)
11:37:00,744 ERROR RemoteCache:364 - java.lang.Thread.run(Thread.java:595)
As part of the Serializable contract, all referencable objects in the object graph must implement Serializable.
Seems to me this should be a perfectly valid thing to do. Am I mistaken?
-Travis Savo <tsavo@ifilm.com>