Cavities involving metamaterials with an uncountable set of resonant frequencies