This paper addresses the problem of adaptive beamforming for target localization by active cognitive multiple-input multiple-output (MIMO) sonar in a shallow water waveguide. Recently, a sequential waveform design approach for estimation of parameters of a linear system was proposed. In this approach, at each step, the transmit beampattern is determined based on previous observations. The criterion used for waveform design is the Bayesian Cramér-Rao bound (BCRB) for estimation of the unknown system parameters. In this paper, this method is used for target localization in a shallow water waveguide, and it is extended to account for environmental uncertainties which are typical to underwater acoustic environments. The simulations show the sensitivity of the localization performance of the method at different environmental prior uncertainties.