The Banu Abbas were extremely disconcerted when they come to know that al-Ma'mun was planning to marry his daughter to Imam Muhammad al-Jawad. A delegation of some leading persons waited on him in order to dissuade him from his intention. But al- Ma`mun continued to admire the learning and excellence of the Imam. He would say that though Imam Muhammad al-Jawad was still young, yet he was a true successor to his father in all his virtues and that the profoundest scholars of the Islamic world could not compete with him" when the `Abbasides noticed that al-Ma'mun attributed the Imam's superiority to his learning they chose Yahya ibn Aktham, the greatest scholar and jurist of Baghdad, to contend with him.
Al-Ma'mun issued a proclamation and organized a grand meeting for the contest which resulted in huge gathering of people from all parts of the kingdom. apart from noble and high officials, there were as many as nine hundred chairs reserved for scholars and learned men only. The world wondered how a young child could contest with the veteran judge in religious laws (qadi'l-qudat) and the greatest scholar of Iraq. Imam Muhammad al-Jawad was seated beside al-Ma'mun on his throne face to face with Yahya ibn Aktham, who addressed the Imam thus:
"Do you permit me to ask you a Question?"
"Ask me whatever you wish," said the Imam in the typical tone of his ancestors.
Yahya then asked the Imam, O what is your verdict about a man who indulges in hunting while he is in the state of Ehram." (In the code of religious law hunting is supposed to be forbidden for a pilgrim.)
The Imam at once replied, "Your question is vague and misleading.
You should have definitely mentioned whether he hunted within the jurisdiction of the Ka`bah or outside; whether he was literate of illiterate;
whether he was a slave of a free citizen;
whether he was a minor or a major;
whether it was for the first time of he had done it previously;
also whether, that victim was a bird or some other creature;
whether the prey was small or big;
whether he hunted in the day or at night;
whether the hunter repented for his action of persisted in it ;
whether he hunted secretly of openly ;
Whether the Ehram was for `umrah of for hajj. Unless all these points are explained no specific answer can be given to this question." al-Qadi Yahya was staggered in listening to these words of the Imam and the entire gathering was dumbfounded.
There was no limit to al-Ma'mun's pleasure. He expressed his sentiments of joy and admiration thus, "Bravo! Well done! O Abu Ja`far! (Ahsanta, ahsanta ya Aba Ja`far ), your learning and attainments are beyond all praises." As al-Ma'mun wanted that the Imam's opponent be fully exposed, he said to the Imam, "You may also put some question to Yahya ibn Aktham." Then Yahya also reluctantly said to the Imam, "Yes, you may ask me some questions. If I know the answer, I will tell you; otherwise, I shall request you to give its answer." Thereupon, the Imam asked a Question to which Yahya could not reply. Eventually, the Imam answered his question.
Then al--Ma'mun addressed the audience thus: Did I not say that the Imam comes of a family which has been chosen by Allah as the repository of knowledge and learning? Is there any one in the world who can match even the children of this family? "All of them shouted," Undoubtedly there in no one parallel to Muhammad ibn ` Ali al-Jawad." In the some assemble al-Ma'mun wedded his daughter ummu 'l-Fadl to the Imam and liberally distributed charity and gifts among his subjects as a mark of rejoicing. One year after his marriage the Imam returned to Medina from Baghdad with his wife and there he set about preaching the commandments of Allah.