java.lang.NoClassDefFoundError: org/terracotta/offheapstore/exceptions/OversizeMappingException

264 views
Skip to first unread message

Karunesh Y

unread,
Oct 6, 2015, 3:43:36 AM10/6/15
to ehcache-users
Hi All,
 I get below exception.

Currently using ehcache-3.0.0.m3.jar version for integrating and testing my application. Looks like "OversizeMappingException" is not present in the jar file.
Can someone please address asap.
java.lang.NoClassDefFoundError: org/terracotta/offheapstore/exceptions/OversizeMappingException
at org.ehcache.internal.store.offheap.OffHeapStore$Provider.createStore(OffHeapStore.java:133)
at org.ehcache.internal.store.offheap.OffHeapStore$Provider.createAuthoritativeTier(OffHeapStore.java:178)
at org.ehcache.internal.store.tiering.CacheStore$Provider.createStore(CacheStore.java:373)
at org.ehcache.internal.store.DefaultStoreProvider.createStore(DefaultStoreProvider.java:87)

Louis Jacomet

unread,
Oct 6, 2015, 10:13:08 AM10/6/15
to ehcache-users
Hi,

You need the offheap jar.
I will assume you are not using maven, otherwise it would have been added to the classpath automatically, so you will need to get the version from http://search.maven.org/#artifactdetails%7Corg.terracotta%7Coffheap-store%7C2.1.0%7Cjar

I realise we missed indicating this in the release notes - it will be fixed.

Regards,
Louis

--
You received this message because you are subscribed to the Google Groups "ehcache-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ehcache-user...@googlegroups.com.
To post to this group, send email to ehcach...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ehcache-users/86aa7f10-03e6-4f85-871c-835a39fca34e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Karunesh Y

unread,
Oct 7, 2015, 2:55:16 AM10/7/15
to ehcache-users
Hi Louis, Thanks for the reply. Well, i raised 3 issues in Jira "Ehcache Core/EHC-1110,EHC-1111,EHC-1112"

~ ehcache.xml is not picked from classpath
~ defaultCache tag is not accepted. would it be included in next release? or any alternative available?

Louis Jacomet

unread,
Oct 7, 2015, 3:28:22 AM10/7/15
to ehcach...@googlegroups.com
Hello,

We use GitHub for Ehcache 3 development, including the issue tracker over there. I will have a look at your issues.

See answers to your two points inline.

Regards,
Louis

On Wed, Oct 7, 2015 at 8:55 AM Karunesh Y <karun...@gmail.com> wrote:
Hi Louis, Thanks for the reply. Well, i raised 3 issues in Jira "Ehcache Core/EHC-1110,EHC-1111,EHC-1112"

~ ehcache.xml is not picked from classpath
No and it will not be. It is a design decision. 
~ defaultCache tag is not accepted. would it be included in next release? or any alternative available?

Karunesh Y

unread,
Oct 7, 2015, 3:47:00 AM10/7/15
to ehcache-users
Louis,  Thanks for the reply. 

Regarding 

~ ehcache.xml not reading from classpath, do you have any JVM parameters by which i can mention the path/file to be picked?

~ Yes i tried using "ehcache:cache-template" in the xml and used as usesTemplate attribute in "ehcache:cache", it works, but problem is, we create more cache and each cache have to be stored to disk and count of caches created may be around 100, so do i have to define a "ehcache:cache" tags for each of this caches? 

Regards,
Karunesh.Y

Louis Jacomet

unread,
Oct 7, 2015, 3:58:13 AM10/7/15
to ehcach...@googlegroups.com
See answers inline.

Louis

On Wed, Oct 7, 2015 at 9:47 AM Karunesh Y <karun...@gmail.com> wrote:
Louis,  Thanks for the reply. 

Regarding 

~ ehcache.xml not reading from classpath, do you have any JVM parameters by which i can mention the path/file to be picked?

Not unless you use JSR-107 integration.
On that topic, maybe you could explain why having the setup code owned by your application is a problem and what you would want the library to provide.
 
~ Yes i tried using "ehcache:cache-template" in the xml and used as usesTemplate attribute in "ehcache:cache", it works, but problem is, we create more cache and each cache have to be stored to disk and count of caches created may be around 100, so do i have to define a "ehcache:cache" tags for each of this caches? 


You can actually work at this programmatically by building cache configurations out of the XmlConfiguration instance like so:
xmlConfiguration.newConfigurationBuilderFromTemplate("templateName", keyClass, valueClass);
And then create the cache from here on the CacheManager. 
The reason this is not available on the CacheManager itself is that we do not want to reproduce that default cache concept at that level. 

Karunesh Y

unread,
Oct 8, 2015, 5:41:21 AM10/8/15
to ehcache-users
Hi Louis, Thanks for the reply. 

~ Regarding usage of "ehcache:cache-template". [xmlConfiguration.newConfigurationBuilderFromTemplate("templateName", keyClass, valueClass);]
Current implementation is using "org.ehcache.jsr107.EhcacheCachingProvider" into JCache and creating cache using JCache cacheManager, We have a constraint of not including "ehcache" related class directly into application. Is there any way we can setup the code to use cache-template? below is our current implementation using "JCache" and "ehcache provider"

generalized code for explaining purpose:
----------------------------------------------------------
javax.cache.spi.CachingProvider.CachingProvider provider = Caching.getCachingProvider("org.ehcache.jsr107.EhcacheCachingProvider");
javax.cache.CacheManager jCacheManager = provider.getCacheManager();
javax.cache.Cache jcache = jCacheManager.createCache("sampleCache");

Thanks & Regards,
Karunesh.Y

Louis Jacomet

unread,
Oct 8, 2015, 7:05:55 AM10/8/15
to ehcache-users
Since you are using JSR-107 integration, the story is slightly different.

It explains how to specify the config file location.
And the next section that mentions supplementing JSR-107 configurations explains the concept of the default template which will do what you want by being very similar to the Ehcache 2.x defaultCache.

Hope this helps!

Regards,
Louis

Karunesh Y

unread,
Oct 9, 2015, 6:38:10 AM10/9/15
to ehcache-users
Hi Louis, Thanks for the reply.

It worked thanks. I owe a lunch to you. Please give me the privilege to treat you. 

~After the config changes as per advise in the link, The persistence file is created for each cache create request, actually wanted to persist only when there is a overflow of data from heap. The XSD does not talk about "overflow". Is there any way with which we can persist only when over flow from heap to off heap and from off heap to disk.

~Like coherence supports filters (com.tangosol.util.Filter), do we have any such api in EHCache/JSR107? with which we can workout the same.

Thanks & Regards,
Karunesh.Y

Karunesh Y

unread,
Oct 12, 2015, 5:34:01 AM10/12/15
to ehcache-users
Hi Louis,
      We get below exception. Any idea what is going wrong?

Caused by: java.lang.UnsupportedOperationException
        at org.ehcache.internal.store.heap.OnHeapStore$Fault.creationTime(OnHeapStore.java:655)
        at org.ehcache.spi.cache.AbstractValueHolder.equals(AbstractValueHolder.java:127)
        at org.ehcache.internal.concurrent.ConcurrentHashMap.replaceNode(ConcurrentHashMap.java:1114)
        at org.ehcache.internal.concurrent.ConcurrentHashMap.remove(ConcurrentHashMap.java:1533)
        at org.ehcache.internal.store.heap.OnHeapStore$MapWrapper.remove(OnHeapStore.java:1153)
        at org.ehcache.internal.store.heap.OnHeapStore.getOrComputeIfAbsent(OnHeapStore.java:505)
        at org.ehcache.internal.store.tiering.CompoundCachingTier.getOrComputeIfAbsent(CompoundCachingTier.java:98)
        at org.ehcache.internal.store.tiering.CacheStore.computeIfAbsent(CacheStore.java:263)
        at org.ehcache.Ehcache.get(Ehcache.java:199)
        at org.ehcache.jsr107.Eh107Cache.get(Eh107Cache.java:88)

Thanks & Regards,
Karunesh.Y

Louis Jacomet

unread,
Oct 12, 2015, 6:44:12 AM10/12/15
to ehcache-users
Hi Karunesh,

Which version are you using?

This is a bug that has been identified and fixed: https://github.com/ehcache/ehcache3/issues/590
It was part of the milestone 3 release.

Regards,
Louis

Karunesh Y

unread,
Oct 12, 2015, 7:03:14 AM10/12/15
to ehcache-users
Hi Louis,

ehcache-3.0.0.m3.jar

Karunesh Y

unread,
Oct 12, 2015, 8:10:07 AM10/12/15
to ehcache-users
Louis,

    Attached is the screen snap of difference of exception raised my case and in your case referred in the github.

~In mycase:
at org.ehcache.internal.store.heap.OnHeapStore$Fault.creationTime(OnHeapStore.java:655)
~In github
at org.ehcache.internal.store.heap.OnHeapStore$Fault.isExpired(OnHeapStore.java:674)

Please let us know any update you have?

Thanks & Regards,
Karunesh.Y
diffImage.JPG

Louis Jacomet

unread,
Oct 12, 2015, 8:48:51 AM10/12/15
to ehcache-users
Well, looks like you just found a bug.

Regards,
Louis

Karunesh Y

unread,
Oct 12, 2015, 8:58:36 AM10/12/15
to ehcache-users
Hi Louis, Thanks a lot for the reply. We shall wait for Milestone 4 release. At this time do we have any workaround? or can you give us a quick jar to test?

Can you please give comment on below 2 points which i raised in previous.

~After the config changes as per advise in the link, The persistence file is created for each cache create request, actually wanted to persist only when there is a overflow of data from heap. The XSD does not talk about "overflow". Is there any way with which we can persist only when over flow from heap to off heap and from off heap to disk.

~Like coherence supports filters (com.tangosol.util.Filter), do we have any such api in EHCache/JSR107? with which we can workout the same.


Thanks & Regards,
Karunesh.Y

Louis Jacomet

unread,
Oct 12, 2015, 10:22:12 AM10/12/15
to ehcach...@googlegroups.com
Hi Karunesh,

I have no quick fix for you. You can watch the issue and use a -SNAPSHOT version as soon as you see the issue closed.

For the other two questions, see inline.

Regards,
Louis

On Mon, Oct 12, 2015 at 2:58 PM Karunesh Y <karun...@gmail.com> wrote:
Hi Louis, Thanks a lot for the reply. We shall wait for Milestone 4 release. At this time do we have any workaround? or can you give us a quick jar to test?

Can you please give comment on below 2 points which i raised in previous.

~After the config changes as per advise in the link, The persistence file is created for each cache create request, actually wanted to persist only when there is a overflow of data from heap. The XSD does not talk about "overflow". Is there any way with which we can persist only when over flow from heap to off heap and from off heap to disk.


Ehcache, for a long time, does not have an overflow model with regards to the disk.
See https://github.com/ehcache/ehcache3/wiki/design.tiering for a detailed description of the current tiering model

~Like coherence supports filters (com.tangosol.util.Filter), do we have any such api in EHCache/JSR107? with which we can workout the same.

I am not familiar with Coherence filters, but this looks like it is linked to a search API. By design Ehcache 3 will not have a search API. 

Karunesh Y

unread,
Oct 14, 2015, 2:09:21 AM10/14/15
to ehcache-users
Hi Louis,  Thanks for the reply.

    ~Please update with location to pick as the SNAPSHOT versions is built for the fix.

    ~Using JSR 107 and EHCache, is there any way for me to setup second level caching using Hibernate, please point me to the link if available.

Thanks & Regards,
Karunesh.Y
Reply all
Reply to author
Forward
0 new messages