I am trying to reproduce the simple ColorsCache distributed EhCache sample
with the Terracota Server Array for a much simpler console application of my own
to experiment with the system and libraries.
I 've built my own Ant build.xml file to run the script. The thing is, the
code fails at the invocation of new CacheManager() below:
Code:
public class TranslationCache {
private static final CacheManager cacheManager = new CacheManager();
private static final TranslationDatabase translationDatabase = new TranslationDatabase();
(...)
... and the stack trace is complaining about a MBeanTrustPermission
(full trace attached as a file) although I've explicitly
granted that permission. I suspect it's got to do something with
the evaluation version of enterprise Terracotta I'm using.
Here's my Ant <java> task:
Code:
<java classname ="${project.MainClass.name}">
<permissions>
<grant class="javax.management.MBeanTrustPermission" name="register"/>
<grant class="java.security.AllPermission"/>
</permissions>
<classpath refid="run.classpath"/>
</java>
and my ehcache.xml:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<ehcache name="ColorCache">
<defaultCache
maxElementsInMemory="10000"
eternal="false"
timeToIdleSeconds="120"
timeToLiveSeconds="120"
overflowToDisk="true"
diskSpoolBufferSizeMB="30"
maxElementsOnDisk="10000000"
diskPersistent="false"
diskExpiryThreadIntervalSeconds="120"
memoryStoreEvictionPolicy="LRU"/>
<cache name="colors"
maxElementsInMemory="100"
maxElementsOnDisk="0"
eternal="false"
timeToIdleSeconds="120"
timeToLiveSeconds="0"
memoryStoreEvictionPolicy="LFU">
<terracotta/>
</cache>
<terracottaConfig url="localhost:9510"/>
</ehcache>
Do I have to configure a security policy of some kind somewhere?
I suspect it's related to the trial version / licence-key.
Full stack trace is attached.