[Logo] Terracotta Discussion Forums (LEGACY READ-ONLY ARCHIVE)
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
[Expert]
ClassCastException when putting a Class key into a ConcurrentHashMap  XML
Forum Index -> Terracotta for Spring
Author Message
anodos

journeyman

Joined: 12/11/2006 13:33:29
Messages: 41
Offline

I just attempted to make an object distributed which contains a ConcurrentHashMap that uses java.lang.Class as keys (and values):
Code:
ConcurrentHashMap<Class<?>, Class<?>>()

Once this ConcurrentHashMap is made distributed, an attempt to put anything into it results in this exception:
Code:
java.lang.ClassCastException: java.lang.Class cannot be cast to com.tc.object.bytecode.Manageable
 	at com.tc.object.bytecode.ManagerImpl.shareObjectIfNecessary(ManagerImpl.java:548)
 	at com.tc.object.bytecode.ManagerUtil.shareObjectIfNecessary(ManagerUtil.java:132)
 	at java.util.concurrent.ConcurrentHashMap.__tc_hash(ConcurrentHashMap.java)
 	at java.util.concurrent.ConcurrentHashMap.__tc_hash(ConcurrentHashMap.java)
 	at java.util.concurrent.ConcurrentHashMap.put(ConcurrentHashMap.java:880)
 ...

Is it not possible to use java.lang.Class as map keys in Terracotta, or am I configuring something wrong here? Isn't Class a Terracotta literal? Are literals not supports as map keys?
steve

ophanim

Joined: 05/24/2006 14:22:53
Messages: 619
Offline

Funny, I ran into this two days ago. It's a bug:

http://jira.terracotta.org/jira/browse/CDV-243

Want to post to this forum? Join the Terracotta Community
anodos

journeyman

Joined: 12/11/2006 13:33:29
Messages: 41
Offline

Wow, I just searched JIRA, and that bug didn't show up. But now when I search, it shows up... weird. Thanks for the info.
steve

ophanim

Joined: 05/24/2006 14:22:53
Messages: 619
Offline

Yeah, I had added it in the wrong place, doh! Sorry about that

Want to post to this forum? Join the Terracotta Community
steve

ophanim

Joined: 05/24/2006 14:22:53
Messages: 619
Offline

This is fixed now in trunk see:

http://jira.terracotta.org/jira/browse/CDV-243

Want to post to this forum? Join the Terracotta Community
 
Forum Index -> Terracotta for Spring
Go to:   
Powered by JForum 2.1.7 © JForum Team