Imaam Ahmad bin Hanbal (died 241H, may Allaah’s mercy be upon him) was beaten and jailed by four consecutive kings. Despite that, he viewed revolt to be unlawful against those who violated the Islaamic belief and punished him for not agreeing with them. Hanbal bin Ishaaq said:
“During the rule of Waathiq, the jurists of Baghdad gathered in front of Ahmad bin Hanbal. They included Aboo Bakr bin ʿUbayd, Ibraaheem bin ʿAlee al-Matbakhee and Fadl bin ʿAasim. So they came to Ahmad bin Hanbal so I gave them permission.
They said to him, ‘This affair (i.e. the inquisition) has become aggravated and elevated.’ They were referring to the ruler making manifest the issue of the Qur’aan being created and other than that. So Ahmad bin Hanbal said to them, ‘So what is it that you want?’
They said: ‘We want you to join us in saying that we are not pleased with his rule and leadership.’
So Ahmad bin Hanbal debated with them for an hour and he said to them: ‘Keep opposing [the false belief itself] with your statements but do not remove your hands from obedience and do not encourage the Muslims to rebel and do not spill your blood and the blood of the Muslims along with you. Look to the results of your actions. And remain patient until you are content with a righteous or sinful rule.’” 
Imaam Ibn Taymiyyah (died 728H, may Allaah’s mercy be upon him) stated:
“Ahmad [bin Hanbal] and his like did not declare these rulers to be disbelievers. Rather he believed them to have Imaan and believed in their leadership and he supplicated for them, and he was of the view that they were to be followed in the prayers and Hajj, and military expeditions were to be made with them. He prohibited rebellion against them – and it (i.e. rebellion) was never seen from the likes of him from amongst the scholars. Yet he still opposed whatever they innovated of false statements, since that was major disbelief, even if they did not know it .
He would oppose it and strive to refute it with whatever was possible. So there must be a combination of obeying Allaah and His Messenger in manifesting the Sunnah and Religion and opposing the innovations of the heretical Jahmites , and between protecting the rights of the believers, the rulers and the Ummah, even if they are ignorant innovators and transgressing sinners.” 
 Mihnatul-Imaam Ahmad (p. 70-72); al-Khallaal in as-Sunnah (no. 90) with an authentic chain of narration.
 This is the position of the scholars and jurists of the orthodox Ahlus-Sunnah and Salafism, i.e. that it is possible for a person to commit major disbelief in creed, statement or action, but still remain within the fold of Islaam due to the fact that he was ignorant of the Islamic texts, and had he known of the Islaamic ruling he would immediately correct himself.
 The Jahmites are an early sect that negate or explain away [by the use of metaphors] the Names and Attributes of Allaah, the Most High. They took their teachings from Jahm bin Safwaan (died 128H) who in turn was a disciple of Jaʿd bin Dirham (died 124H) both of whom denied amongst other things that Allaah spoke to the Prophet Moosaa (Moses), that He took Ibraheem (Abraham) as a close friend, that He is the Most High above His creation and distinct from it.
 Majmooʿ al-Fataawaa, 7/507-508