I found out that this has nothing to do with the commonj jar. If anyone can give some hint about why I am facing this error will be of great help. This error is only surfacing with coherence 12c version.
Well....The same behaviour which is working in 3.7.1 but not working in 12c. I would explain the problem a bit more.
We wanted to create workmanger in various nodes except the client node which will only dispatch the work and refrain from participating in the work processing .Hence when are trying to create workmanger in the client node with 0 number of threads(for a client only purpose), it is throwing the above exception. Strangely it is no complaining if we create the workmanager with >0 number of threads. I checked the documentation and it says nothing about this changed behaviour. Looks like a bug to me in coherence.
Can anyone please explain this behaviour to me.
I think it is a bug. Doing something like this seems to help:
Cluster c = CacheFactory.getCluster();
c.getMemberSet(); // this call seems to initialize the members
Member localmember = c.getLocalMember();
WorkManager mgr = new WorkManager("myManager", 1); // pretend that we are running a compute server and not a client
mgr.disableServer(localmember); // immediately disable calculations on this server