-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: net.sf.hibernate.cache.QueryKey NOT Serializable!
PostPosted: Fri Jan 07, 2005 5:03 pm 
Newbie

Joined: Tue Oct 21, 2003 1:25 pm
Posts: 14
Location: Los Angeles, CA
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>


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 12, 2005 9:51 pm 
Regular
Regular

Joined: Tue Nov 11, 2003 7:35 pm
Posts: 63
Hi,

Did you ever find a solution for this problem? Are there any issues you came across trying to use Hibernate with a JCS Remote Cache?

On a related note, I am investigating the possibility of using JCS as my caching provider for use with Hibernate. I know JCS was deprecated some time ago, but in the last year JCS has come a long way and many of bugs were fixed. As a matter of fact, the JCS project has recently been promoted as a top-level Jakarta project and is no longer a subproject of Turbine.

This being the case, is there any reason not to use JCS with Hibernate? I would appreciate any feedback on this issue, in light of the fixed bugs.

I posted a similar question on the JCS forum, here is a link to the thread, particularly question #5:

http://mail-archives.apache.org/eyebrow ... &msgNo=702

If anyone has any comments on any of this, please respond over there or here.

Thank you,
Daniel Rosenbaum


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.