
720 S.W.2d 412 (1986)
Mark MOLASKY, Appellant,
v.
Thomas BROWN, III and Richard G. Callahan, Respondents.
No. WD 37871.
Missouri Court of Appeals, Western District.
November 25, 1986.
*413 Mark Molasky, pro. se.
Richard G. Callahan, Asst. Pros. Atty., Jefferson City, for respondents.
Before CLARK, C.J., and SHANGLER and NUGENT, JJ.
CLARK, Chief Judge.
This suit for declaratory judgment was commenced pro se by appellant, an inmate in the custody of the Missouri Department of Corrections. The named defendants are prosecuting attorneys in Cole County. The appeal is from an order by the trial court dismissing the petition.
At the outset, we note that disposition of this case has been rendered unusually difficult, first because appellant's pro se pleadings in the trial court and his brief here are the unlettered efforts of a layman. Additional and equally confounding elements are the absence of any record explaining the basis for the trial court's orders and the failure of respondents to make any argument or file any brief in this court suggesting grounds on which the judgment could be affirmed. In the face of these difficulties, we are obliged to conclude from the record which was made that the trial court has not yet exhausted its jurisdiction and that the appeal must be dismissed.
Commencing with a review of plaintiff's apparent four count petition, as best the allegations may be construed with the favorable intendments accorded the pleader on a motion to dismiss, it appears the complaints are as follows. Appellant says respondents interfered with his access to a witness in another case, they intimidated the witness, they caused appellant to be transferred to segregated custody and they filed spurious charges against him. Whether the claims have any merit is not considered. The petition allegations are summarized only to describe the subjects of the several petition counts.
Respondents were served with summons on May 23, 1985, and responded six days later by moving to quash the summons on the ground appellant was not a poor person. That motion was overruled by the court, but not until December 10, 1985. In the meantime, appellant sought leave to take depositions of respondents and other parties, issued notices for depositions and filed various other motions, none of which were ruled by the court until the December hearing. According to appellant's pleadings, which are not otherwise refuted in this record, the witnesses noticed by appellant for depositions did not appear and respondents ignored appellant's interrogatories. Sanctions were sought but were summarily denied.
At the hearing on December 10, 1985, the court announced that it would take care of all pending matters in the case at one time. The court then proceeded to overrule the motion to quash summons, it denied appellant's motion for sanctions and also overruled appellant's motion for judgment, stating no grounds for any of those rulings. It then took up a motion respondents had filed one week before and dismissed appellant's case. This appeal was prosecuted from that order.
*414 At the threshold of appellate review, the court must determine sua sponte whether jurisdiction lies to entertain the appeal. Wentzville Public School District v. Paulson, 699 S.W.2d 132, 133 (Mo.App. 1985). To this end, we look to the court's order of dismissal and the motion upon which it was based. The order in its entirety reads as follows: "Defts Motion to Dismiss presented to ct. and sustained." No reference was made to the separate counts of the petition which were separately treated in respondents' motion as is discussed below. Because the court stated no reasons for its ruling, it must be assumed on appeal that the grounds for the ruling are those set out in respondents' motion. Missouri Department of Social Services v. Agi-Bloomfield, 682 S.W.2d 166, 167-68 (Mo.App.1984). It also follows, of necessity, that if the motion stated no ground on which a dismissal of any of the petition counts could be predicated or if the motion did not seek that relief, then the dismissal was not effective as to those counts.
The motion filed by respondents December 3, 1985, was in three parts. In the first, respondents moved for dismissal of the first and second counts of appellant's petition. The alleged ground for dismissal was the failure of the petition to state any cause of action on which the court could grant relief. To the extent of these two counts, the dismissal order was consistent with and appropriate to the motion and procedurally satisfactory. The same may not be said of the third and fourth counts which, as the following discussion explains, cannot be considered to have been ruled by the perfunctory order of December 10, 1985.
The second part of respondents' motion was directed to the fourth petition count. Respondents there asserted that appellant was not entitled to recover because the acts of which appellant complained were performed by respondents as county prosecutors and they were therefore shielded from liability under the doctrine of official immunity. The defense of immunity is not, subject to the qualification hereafter noted, a defense which may be asserted by motion. It is instead an affirmative defense to be pleaded and proved. Rule 55.08. The exception, which does not apply in this case and which subjects a petition to dismissal, is where the petition shows on its face the applicability of the affirmative defense. For that result to occur, the defense must be irrefutably established by the plaintiff's pleading. Sampson v. W.F. Enterprises, Inc., 611 S.W.2d 333, 337 (Mo.App.1980).
The allegations of appellant's petition in the fourth count are certainly not models of clarity, but they cannot be said to show irrefutably that the only complaint made is as to official acts by respondents as prosecutors. Because the motion for dismissal as to this count relied only on the ground of immunity and that was not a basis for dismissal of the petition count to which that portion of the motion was directed but was a defense to be pleaded, the assumption must be that the dismissal order was inoperative as to the fourth petition count. Any other construction of the judgment would convict the trial court of error solely on inference. The fourth petition count must therefore be construed to be unresolved.
As to the third petition count, respondents' motion did not ask for dismissal. In that part of respondents' motion, they moved for summary judgment and undertook to support the motion by attachment of a copy of a hospital record which purported to show that respondents were not involved with the incidents about which appellant's petition complained.
A motion for summary judgment and a motion to dismiss for failure to state a claim are quite different. Summary judgment is a judgment on the merits with res judicata effect between the parties in which the movant has an extremely high burden of proof. A motion to dismiss for failure to state a claim is a motion which raises the issue of the power of the court to act on the subject. Dismissal for failure to state a cause of action on which relief may be granted is not a decision on the merits *415 with res judicata effect and the movant has a lower burden of proof. Parmer v. Bean, 636 S.W.2d 691, 695 (Mo.App.1982). A summary judgment is appropriate only if the record shows that no genuine issue as to any material fact exists and that the opposing party is entitled to judgment as a matter of law. Kilgore v. Kilgore, 666 S.W.2d 923, 928 (Mo.App.1984).
Other considerations aside, the order entered in this case may not be construed as an order granting summary judgment because it did not set out the findings necessary to rendition of summary judgment, it gives no indication that the court found no genuine issue of fact to exist and it does not recite that respondents are entitled to judgment as a matter of law. There is no basis at all to argue that the court's order sustained respondents' motion for summary judgment as to the third count of the petition. If that be so, as we conclude, then that count also remains pending.
The only remaining possibility which could be argued is that the court dismissed appellant's petition in its entirety for failure to state claims on which relief could be granted. A court may raise the issue of sufficiency of a petition sua sponte because such a defect is jurisdictional. Commercial Bank of St. Louis County v. James, 658 S.W.2d 17, 21 (Mo. banc 1983). That argument is not available here, however, because the court's order expressly states that the dismissal is based on respondents' motion. The motion supports dismissal of only two of the four complaints presented in appellant's petition leaving two counts unresolved.
For a decision to be appealable it must be final, § 512.020, RSMo. 1978. In order for a judgment to be final it must dispose of all issues and all the parties. Finality is required to prevent piecemeal litigation or presentment of cases on appeal. Harting v. Stout, 690 S.W.2d 458, 459 (Mo.App.1985). The order of December 10, 1985 did not rule respondents' motion for summary judgment, it did not rule nor was the issue of official immunity appropriately presented and the judgment is therefore not final or appealable.
The appeal is dismissed.
All concur.
