The excitation of nonlinear electrostatic waves, such as shock and solitons, by ultraintense laser interaction with overdense plasmas and related ion acceleration are investigated by numerical simulations. Stability of solitons and formation of shock waves is strongly dependent on the velocity distribution of ions. Monoenergetic components in ion spectra are produced by "pulsed" reflection from solitary waves. Possible relevance to recent experiments on "shock acceleration" is discussed.