Let me add something to anna v's answer.
The classical model of blackbody radiation is based on:
- an exact recasting of the Maxwell equations describing electromagnetic radiation in a cavity, which shows that this physical system can be described as an infinite set of classical harmonic oscillators (normal modes) whose frequencies start from zero and are not upper bounded;
- the hypothesis that there is an effective mechanism which allows thermal equilibrium of the radiation field;
- that statistical mechanics can be applied to such a system to calculate equilibrium properties.
All together, these hypotheses have as a consequence that:
- due to the equipartition theorem, each normal mode should contribute to the internal energy with the same average energy: ( $k_BT$ );
- in a given volume and interval of frequencies $d\nu$, the number of normal modes grows like $\nu^2$;
- therefore the total energy per unit volume diverges, due to the unintegrable growth of normal modes at high frequencies (from here, the name ultraviolet catastrophe).
Up to here, these are the facts textbooks refer to. However, there are a few facts that could be useful to know to put things in the historical perspective and, more important, to learn a lesson which could be useful in other contexts even today.
The actual weight of the ultraviolet catastrophe argument on the historical development of quantum physics is usually over-exagerated. It looks compelling for us, but for contemporaries of Rayleigh and Jeans, it was not a clear indication that something was wrong with classical mechanics. Statistical mechanics was in its infancy and not everybody was convinced of its general validity. Remember that Boltzmann had a hard time convincing the scientific community of the truth of his ideas. In particular, the general validity of equipartition theorem was not acknowledged by everybody.
Somewhat connected with this observation, reading the first paper where Planck derived his distribution makes clear that he was not concerned by any ultraviolet catastrophe (which is not mentioned in any place in his two main contributions to the blackbody radiation). On the contrary, his main concern was the disagreement beteween new experiments by Pringsheim and Lummer and Wien's energy distribution at low frequencies (long wavelengths). A readable account of the real history of Planck's contribution to the blackbody problem can be found in the paper Klein, M. J. (1961). Max Planck and the beginnings of the quantum theory. Archive for History of Exact Sciences, 1(5), 459-479.
A final comment on hypothesis n.2 (see above). 20-th century research on dynamical systems has shown that when oscillators with very different frequencies are weakly coupled, equilibration times could easily exceed any reasonable experimental time. In a way, it has been a lucky circumstance for the birth of Quantum Mechanics that such a result was not clearly known at the beginning of the century.