2 Chronicles 34:28

Behold, I will gather thee to thy fathers, and thou shalt be gathered to thy grave in peace, neither shall thine eyes see all the evil that I will bring upon this place, and upon the inhabitants of the same. So they brought the king word again.

The promise came after the book of the law was found and read to Josiah, because his heart was tender and he humbled himself before God when he heard the words written against Jerusalem. He tore his clothes and wept, repented of Israel's departure from the statutes, and was quick to seek forgiveness and mercy. He made a covenant to obey the commandments with his whole heart and soul, and God heard him.

His repentance was carried out in putting down idolatry, reopening the temple, and re-establishing the offerings. He had the book of the covenant read, removed the abominations, so that Israel served the Lord all his days, and his reform was accepted by God.

God promised to gather him to his fathers and to his grave in peace, so that his eyes would not see all the evil to be brought upon the place and its inhabitants, Jerusalem and its people.

The ruin of Jerusalem and its punishment could not be averted or escaped even if the people humbled themselves. Long sinning had deadened their senses so that without judgment they would soon return to the same sinful course, the provocation had been too great for punishment to be averted, and Josiah had to leave future events with God because he could not change them.

Josiah's later death from archers' wounds in battle at Megiddo does not charge God with denying His word of peace. God gave no order for Josiah to make war on Necho king of Egypt, and Necho's ambassadors warned him from the mouth of God to forbear meddling with him because God had commanded Necho to make haste. Josiah would not turn back but disguised himself to fight and did not heed that warning. He congratulated himself that no word had come directly to him and was unwilling to face the humiliation of turning back his army. Made self-confident by the good things spoken in his favor, he went against the word of God and chose his own way in a battle he should have had nothing to do with, and God could not shield him from the consequences of his act.

The reading of the law in Josiah's day was followed by deep repentance and return to God, representing the kind of response John expected his own message to produce.