(Bamidbar 27:12) "And the L-rd said to Moses: Go up to this Mount Avarim": This is the inheritance of the children of Reuven. When Moses entered the (prospective) inheritance of the children of Reuven and the children of Gad, he rejoiced, thinking "It seems to me that He has revoked His decree" (against my entering Eretz Yisrael) — whereupon he poured out supplication before the King. An analogy: A king decreed against his son that he not enter the doors of his palace.

He came to the gate and left it behind him; to the storage room, and left it behind him. As he was about to enter the inner chamber, he said to him "My son, from here on, you are forbidden." Likewise, when Moses entered the inheritance of the children of Gad and the children of Reuven, he rejoiced, thinking "It seems to me that He has revoked His decree," whereupon he began to pour out supplication before the L-rd.

Now does this not follow a fortiori, viz.: If Moses, the great sage, the father of the sages and the father of the prophets, even though he knew that a decree had gone forth against him, did not keep himself from supplication, how much more so should this hold true for other men!