ColdFusion 9, Caching, IP_ADD_MEMBERSHIP Error

I ran into a truly weird error today. I was building a very simple test script to load up my cache system with a lot of crap. This was the script I used:

<cfloop index="x" from="1" to="3000"> <cfset id = "cache_#x#"> <cfset cached = cacheGet(id)> <cfif isNull(cached)> <cfset value = createUUID() & createUUID() & createUUID() & repeatString("foo", 250)> <cfset cachePut(id, value)> </cfif> </cfloop>

Nothing crazy there, right? Well upon running this code I immediately got:

IP_ADD_MEMBERSHIP failed (out of hardware filters?)
net.sf.ehcache.CacheException: IP_ADD_MEMBERSHIP failed (out of hardware filters?)
at
net.sf.ehcache.distribution.MulticastRMICacheManagerPeerProvider.init(MulticastRMICacheManagerPeerProvider.java:93)
at net.sf.ehcache.CacheManager.init(CacheManager.java:241)
at net.sf.ehcache.CacheManager.(CacheManager.java:221)

I googled - and ran across a few things, but nothing made sense until Brian Kotek pointed out the following URL:

Error on MulticastSocket.joinGroup()

This led to the following Microsoft Tech Note:

How to disable the Media Sensing feature for TCP/IP in Windows

And that did the trick. This "Media Sense" feature (which by the way impacted my Windows machine but not a coworker) was the culprit. As soon as I did the regedit (wow, it's been a long time since I did one of those) and rebooted, everything worked perfectly.

Archived Comments

Comment 1 by Raymond Camden posted on 9/7/2010 at 10:27 PM

For those who run into this and the above link does not work (it worked for me the first time on a laptop, but not on my new Win7 desktop), try this suggestion from Pete Freitag:

You could try removing these lines from the ehcache.xml file:

<cacheManagerPeerProviderFactory
class="net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory"
properties="peerDiscovery=automatic,
multicastGroupAddress=230.0.0.1,
multicastGroupPort=4446, timeToLive=1"
propertySeparator=","
/>

<cacheManagerPeerListenerFactory
class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory"/>

It worked for me.