In this paper, we demonstrate how solar p-mode energy can be resonantly absorbed by coupling to localized Alfvén waves in the chromosphere. Nonuniformity in the magnetic field, plasma density, and temperature in the solar atmosphere give rise to a continuous spectrum of resonant frequencies. P-modes with characteristic frequencies within the range of the continuous spectrum may resonantly couple to localized Alfvén and slow magnetohydrodynamic (MHD) waves, and hence heat the chromospheric plasma. In dissipative MHD, these p-modes are recovered as eigenmodes with a damping rate that becomes independent of the dissipation mechanism in the limit of vanishing dissipation. An analytical solution of these p-modes is found in the dissipative layer embracing the resonant magnetic surface. Using the analytical solution to cross the quasi-singular dissipative layer, the required numerical effort is limited to the integration of the ideal MHD equations away from any singularity. This results in a powerful tool for investigating in a mathematically consistent way the damping by resonant absorption and the frequency shifts of the solar oscillations arising from the presence of an overlying magnetic atmosphere in combination with the resonant absorption process. The outcome is that the mechanism of resonant absorption might be responsible for the damping of solar oscillations and should be taken into account in producing a definite solar model reproducing the observed frequencies of the global solar oscillations to within the limit of observational uncertainties.