Crystal cavity resonance for hard x rays: A diffraction experiment