Spatially, spectrally, and depth-resolved cathodoluminescence (CL) measurements were performed for high-quality thin AlN films grown on Si(111). CL spectra exhibited a sharp peak at 5.960 eV, corresponding to the near-band-edge excitonic emission of AlN. Depth-resolved CL analysis showed that deep level oxygen and carbon impurities are localized primarily at the AlN/Si interface and AlN outer surface. Monochromatic CL imaging of the near-band-edge emission exhibits a spotty pattern, which corresponds to high concentrations of threading dislocations and thermally induced microcracks in the thin layers. We have examined relief of the thermal stress in close proximity to single microcracks and intersecting microcracks. Local CL spectra acquired with a focused e-beam show blue-shifts as large as ;82 meV in the AlN nearband edge excitonic peaks, reflecting defect-induced reductions in the biaxial thermal stress, which has a maximum value of ;47 kbar.