Joined: Sun Aug 08, 2010 2:43 am Posts: 2
|
I get a ClassCastException when I try to do the following: Map cacheEntries = sessionFactory.getStatistics().getSecondLevelCacheStatistics(regionName).getEntries();
Any pointers to what could be wrong here?
I am using: Java 1.6 Hibernate 3.5.3 GWT 2.0
I get the same exception when I use EhCache as well. However, I was expecting Hashtable cache to work.
My second level cache config is <!-- second-level cache related properties --> <property name="cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property> <property name="hibernate.cache.use_second_level_cache">true</property> <property name="hibernate.cache.use_structured_entries">true</property> <property name="hibernate.cache.use_query_cache">true</property>
The stack trace of the exception Caused by: java.lang.ClassCastException: org.hibernate.cache.QueryKey cannot be cast to org.hibernate.cache.CacheKey at org.hibernate.stat.ConcurrentSecondLevelCacheStatisticsImpl.getEntries(ConcurrentSecondLevelCacheStatisticsImpl.java:57) at xx.server.util.HibernateUtil.printCacheStatistics(HibernateUtil.java:68) at xx.server.staff.ManageStaffServiceImpl.searchStaff(ManageStaffServiceImpl.java:147) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:562) ... 22 more
|
|