Hello,
I am new to Terracotta, and I am trying to get a simple lock to work with no success - based on the docs I've tried doing:
Code:
ClusteringToolkit toolkit = new TerracottaClient("localhost:9510").getToolkit();
ReadWriteLock rwLock = toolkit.getReadWriteLock("foo");
Lock lock = rwLock.readLock();
lock.unlock();
With TC server up it connects successfully (I'm using no config file), but then when calling unlock() the following exception is thrown:
Code:
Exception in thread "main" java.lang.IllegalMonitorStateException
at java.util.concurrent.locks.ReentrantReadWriteLock$Sync.tryReleaseShared(ReentrantReadWriteLock.java:363)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.releaseShared(AbstractQueuedSynchronizer.java:1317)
at java.util.concurrent.locks.ReentrantReadWriteLock$ReadLock.unlock(ReentrantReadWriteLock.java:745)
at org.terracotta.locking.TerracottaReadWriteLock$ReadLock.unlock(TerracottaReadWriteLock.java:284)
at com.xxxx.services.terracotta.TerracottaLock.main(TerracottaLock.java:41)
Also the client logs don't show anything special AFAICT.
Is there any configuration I need to make in order for this to run? I've also tried using a Terracotta EE server / jars but got the exact same message.
Thanks,
Victor