CDV ❯ TCNonPortableObjectError using tim-ehcache-2.x-ee and non-EE tims
-
Bug
-
Status: Resolved
-
2 Major
-
Resolution: Won't Fix
-
-
-
teck
-
Reporter: teck
-
April 08, 2011
-
0
-
Watchers: 1
-
September 06, 2013
-
September 06, 2013
Description
If you’re using a container TIM (e.g. tim-tomcat-6.0) and want to use something else that depends on the EE toolkit (eg. tim-ehcache-2.x-ee) you currently need to list explicit toolkit references in tc-config.xml (see DEV-5524).
Doing that you might end up with a
Unfortunately doing that will let an
Ultimately you’ll end up with this exception since the transients aren’t honored.
A workaround is to list tim-ehcache-2.x-ee last in the
{quote} com.tc.exception.TCNonPortableObjectError: ******************************************************************************* Attempt to share an instance of a non-portable class referenced by a portable class. This unshareable class has not been included for sharing in the configuration.
For more information on this issue, please visit our Troubleshooting Guide at: http://www.terracotta.org/kit/reflector?kitID=default&pageID=npoe
Referring class : org.terracotta.modules.ehcache.store.EnterpriseClusteredStore Referring field : org.terracotta.modules.ehcache.store.ClusteredStore.nonStrictBackend Non-portable field name: org.terracotta.modules.ehcache.store.ClusteredStore.nonStrictBackend Thread : main JVM ID : VM(1) Non-included class : org.terracotta.modules.ehcache.store.backend.NonStrictBackend
Under most circumstances, you should only be adding classes for your application. If you are adding classes for frameworks or code not written by you, then you should consider finding a Terracotta Integration Module (TIM) that matches the framework you are using.
As an example, if the non-portable class listed below is net.sf.ehcache.CacheManager, you should consider using the ehcache TIM.
It is also possible that some or all of the classes above are truly non-portable, the solution is then to mark the referring field as transient. For more information on non-portable classes see the Troubleshooting Guide.
Action to take:
1) Reconfigure to include the unshareable classes
* edit your tc-config.xml file
* locate the
<instrumented-classes>
<include>
<class-expression>org.terracotta.modules.ehcache.store.backend.NonStrictBackend</class-expression>
</include>
</instrumented-classes>
* if there is already an
*******************************************************************************
at com.tc.object.ClientObjectManagerImpl.throwNonPortableException(ClientObjectManagerImpl.java:798)
at com.tc.object.ClientObjectManagerImpl.checkPortabilityOfTraversedReference(ClientObjectManagerImpl.java:689)
at com.tc.object.ClientObjectManagerImpl.access$700(ClientObjectManagerImpl.java:84)
at com.tc.object.ClientObjectManagerImpl$NewObjectTraverseTest.checkPortability(ClientObjectManagerImpl.java:1071)
at com.tc.object.Traverser.addReferencedObjects(Traverser.java:47)
at com.tc.object.Traverser.traverse(Traverser.java:81)
at com.tc.object.ClientObjectManagerImpl.traverse(ClientObjectManagerImpl.java:962)
at com.tc.object.ClientObjectManagerImpl.create(ClientObjectManagerImpl.java:307)
at com.tc.object.ClientObjectManagerImpl.lookupOrCreateIfNecesary(ClientObjectManagerImpl.java:354)
at com.tc.object.ClientObjectManagerImpl.lookupOrCreate(ClientObjectManagerImpl.java:335)
at com.tc.object.tx.ClientTransactionManagerImpl.logicalInvoke(ClientTransactionManagerImpl.java:511)
at com.tc.object.TCObjectLogical.logicalInvoke(TCObjectLogical.java:17)
at com.tc.object.bytecode.ManagerImpl.logicalInvoke(ManagerImpl.java:338)
at com.tc.object.bytecode.ManagerUtil.logicalInvoke(ManagerUtil.java:325)
at com.terracotta.toolkit.collections.ConcurrentDistributedMapDso.doLogicalPut(ConcurrentDistributedMapDso.java:158)
at com.terracotta.toolkit.collections.ConcurrentDistributedMapDso.putIfAbsent(ConcurrentDistributedMapDso.java:508)
at com.terracotta.toolkit.collections.ConcurrentDistributedMapDsoArray.putIfAbsent(ConcurrentDistributedMapDsoArray.java:176)
at org.terracotta.collections.ConcurrentDistributedMap.putIfAbsent(ConcurrentDistributedMap.java:144)
at org.terracotta.modules.ehcache.store.TerracottaClusteredInstanceFactory.getOrCreateStoreInternal(TerracottaClusteredInstanceFactory.java:244)
at org.terracotta.modules.ehcache.store.TerracottaClusteredInstanceFactory.getOrCreateStore(TerracottaClusteredInstanceFactory.java:229)
at org.terracotta.modules.ehcache.store.TerracottaClusteredInstanceFactory.getOrCreateStore(TerracottaClusteredInstanceFactory.java:122)
at org.terracotta.modules.ehcache.store.TerracottaClusteredInstanceFactory.createStore(TerracottaClusteredInstanceFactory.java:116)
at net.sf.ehcache.terracotta.ClusteredInstanceFactoryWrapper.createStore(ClusteredInstanceFactoryWrapper.java:81)
at net.sf.ehcache.CacheManager.createTerracottaStore(CacheManager.java:456)
at net.sf.ehcache.Cache.initialise(Cache.java:1050)
at net.sf.ehcache.CacheManager.addCacheNoCheck(CacheManager.java:1057)
at net.sf.ehcache.CacheManager.addCache(CacheManager.java:980) \{quote\}
Comments
Fiona OShea 2011-04-11
Fiona OShea 2011-11-09
Should we fix this?
Tim Eck 2011-11-09
I don’t think it is is worth it at this point. You can’t have this particular issue in express mode
Add Release Note to 3.5.0 relnotes http://www.terracotta.org/confluence/display/release/Release+Notes+Terracotta+3.5.0