[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]
NoClassDefFoundError: com/tcclient/cache/CacheData  XML
Forum Index -> Terracotta 中文社区
Author Message
eric.sun

jedi

Joined: 10/02/2008 09:18:42
Messages: 123
Offline

It's weird we have this sorta exception which is thrown from a method like this:
Code:
  
 Collections.sort(instance, new Comparator<ClassName>() {
 			public int compare(ClassName p1, ClassName p2) {
 				return p1.getfield1().compareToIgnoreCase(p2.getfield1());
 			}
 
 }


Code:
java.lang.NoClassDefFoundError: com/tcclient/cache/CacheData
 	at com.tcclient.ehcache.TimeExpiryMap$EntryWrapper.getValue(TimeExpiryMap.java:286)
 	at com.tc.object.walker.MapEntry.getValue(MapEntry.java:25)
 	at com.tc.object.walker.MapEntryNode.<init>(MapEntryNode.java:16)
 	at com.tc.object.walker.ObjectGraphWalker.makeNode(ObjectGraphWalker.java:60)
 	at com.tc.object.walker.ObjectGraphWalker.visit(ObjectGraphWalker.java:74)
 	at com.tc.object.walker.ObjectGraphWalker.walk(ObjectGraphWalker.java:46)
 	at com.tc.object.ClientObjectManagerImpl.storeObjectHierarchy(ClientObjectManagerImpl.java:977)
 	at com.tc.object.ClientObjectManagerImpl.sendApplicationEvent(ClientObjectManagerImpl.java:968)
 	at com.tc.object.tx.ClientTransactionManagerImpl.checkWriteAccess(ClientTransactionManagerImpl.java:378)
 	at com.tc.object.bytecode.ManagerImpl.checkWriteAccess(ManagerImpl.java:743)
 	at com.tc.object.bytecode.ManagerUtil.checkWriteAccess(ManagerUtil.java:354)
 	at java.util.ArrayList.set(ArrayList.java)
 	at java.util.AbstractList$ListItr.set(AbstractList.java:412)
 	at java.util.Collections.sort(Collections.java:163)
gkeim

ophanim

Joined: 12/05/2006 10:22:37
Messages: 685
Location: Terracotta, Inc.
Offline

You're trying to sort a shared collection (ArrayList), which isn't properly locked for write access, and it's in the process of throwing an UnlockedSharedObjectException. You're either using the DSO Eclipse plug-in or the Sessions Configurator because it's trying to package up information about what's not properly locked for remediation purposes and running into another problem with the NoClassDefFoundError. Try adding some locking around the sort or, if you didn't expect the collection to be shared, enable newObjectDebug debugging to see where it's being shared.

What version Terracotta and tim-ehcache is this?

Gary Keim (terracotta developer) Want to post to this forum? Join the Terracotta Community
lima

consul
[Avatar]
Joined: 06/22/2009 10:12:31
Messages: 361
Offline

今天刚帮一个用户解决了类似的异常错误:
java.lang.NoClassDefFoundError: com/tcclient/cache/CacheData
at com.tcclient.ehcache.TimeExpiryMap$EntryWrapper.getValue(TimeExpiryMap.java:286)
at com.tc.object.walker.MapEntry.getValue(MapEntry.java:25)
at com.tc.object.walker.MapEntryNode.<init>(MapEntryNode.java:16)
at com.tc.object.walker.ObjectGraphWalker.makeNode(ObjectGraphWalker.java:60)
。。。

他是因为tc-config.xml中tim-ehcache的版本写错了。
应该是:
tim-ehcache-1.4.1 1.4.0-SNAPSHOT

他的写成:
tim-ehcache-1.4.1 1.4.1-SNAPSHOT

不知道你是不是也有相同的问题。
eric.sun

jedi

Joined: 10/02/2008 09:18:42
Messages: 123
Offline

gkeim, you are right, there might be a locking issue.
I am running an terracotta Eclipse plugin and the exception appeared in my eclipse console.

We are using tc3.0.0 and ehcache 1.3

Code:
      <module name="tim-ehcache-commons" version="1.3.1"/>
       <module name="tim-ehcache-1.3" version="1.3.1"/>


gkeim

ophanim

Joined: 12/05/2006 10:22:37
Messages: 685
Location: Terracotta, Inc.
Offline

That particular type (com.tcclient.cache.CacheData) used to be exported from tim-ehcache so that it would be available to other classloaders, but it's commented out in the code:

https://svn.terracotta.org/repo/forge/projects/tim-ehcache/branches/tc-3.0/tim-ehcache-commons/src/main/java/org/terracotta/modules/ehcache/commons_1_0/EhcacheTerracottaCommonsConfigurator.java

I don't have enough experience with the tim-ehcache implementation to know if this is a bug or not (but I think it is). I created the following JIRA ticket to track this situation:

https://jira.terracotta.org/jira/browse/CDV-1369


Gary Keim (terracotta developer) Want to post to this forum? Join the Terracotta Community
 
Forum Index -> Terracotta 中文社区
Go to:   
Powered by JForum 2.1.7 © JForum Team