Plaintiff has sued defendants for $2325.90 which he claims is the amount still due and owing on the total bill of $4810.90 for construction services provided to defendants between June 27, 1981, and November 5, 1981. Defendants filed preliminary objections in the form of a demurrer to plaintiff’s complaint. These preliminary objections contain factual averments and were served upon plaintiff’s attorney with a notice to plead on May 9, 1984. The demurrer states that plaintiff sued these defendants on exactly this same claim before District Justice Estep in York County Magisterial District 19-3-09 by complaint Docket no. TA0046-83-309 dated March 3, 1983. . . . The demurrer further avers that District Justice Estep entered judgment against defendant F. Douglas Simpson and in favor of plaintiff in the amount of $535.60 dated April 29, 1983, and that no appeals were filed by any party. . . . Defendants’ demurrer is based upon a claim of res judicata. No answer was filed to the factual averments which were made in the preliminary objections.
We would note initially that defendants have improperly raised the defense of res judicata by preliminary objection. This defense is to be pled in new *6matter pursuant to Pa. R.C.P. 1030. However, the Pennsylvania Supreme Court in Duquesne Slag Products Co. v. Lench, 490 Pa. 102, 415 A.2d 53 (1980), has held:
“[A]ppellee raised res judicata in preliminary objections. We have held that res judicata must be raised as a new matter and not in preliminary objections. Callery v. Blythe Township Municipal Authority, 432 Pa. 307, 243 A.2d 385 (1968). In Rufo v. The Bastian Blessing Co., 417 Pa. 107, 207 A.2d 823 (1965), we have held that where the Statute of Limitations was raised in a preliminary objection rather than in answer with new matter, the plaintiff was required to file a preliminary objection to defendant’s preliminary objection and raise the procedural defect. By fading to do so, the plaintiff waived the right to object to defendant’s form of pleading. Commonwealth Court made a similar ruling in a case involving res judicata. Commonwealth ex rel. Milk Marketing Board v. Sunnybrook Dairies, Inc., 32 Pa. Commw. 313, 379 A.2d 330 (1977). In the instant case, appellant did not file the required objection to appellee’s preliminary objection. It therefore waived its claim that res judicata was raised in an improper manner. ”
Since the factual averments in defendants’ preliminary objections have not been denied they are admitted pursuant to Pa.R.C.P. 1029(d). Plaintiff in his brief before this court further concedes the factual averments in defendants’ preliminary objections but claims that the doctrine of res judicata does not apply because the judgment of the district justice has not been entered upon the docket of a court of common pleas. While it is correct that for res judicata to apply a final and valid judgment must have been entered. Philadelphia Marine Trade Association v. International Longshoremen’s Asso*7ciation, 453 Pa. 43, 308 A.2d 98 (1973); Bearoff v. Bearoff Brothers, Inc., 458 Pa. 494, 327 A.2d 72 (1974), such a judgment has been entered in this case.
For the defense of res judicata to prevail there must be a concurrence of four conditions: (1) identity of the thing sued upon; (2) identity of the cause of action; (3) identity of persons and parties to the action; and (4) identity of the quality or capacity of the parties suing or sued. Stahl v. Hilderhoff, 432 Pa. 179, 247 A.2d 582 (1968). The court in Stahl held that if these conditions are met . . . “the fact that the prior judgment was entered in an action before a justice of the peace does not preclude invocation of the doctrine of res judicata.”
In this case all four conditions for res judicata to apply have been met. The district justice had jurisdiction to entertain a complaint in assumpsit for $2325.90 pursuant to 42 Pa.C.S. § 1515(a)(3). The method of entering judgment by a district justice is set forth in Rule 322 of the Rules of Conduct, Office Standards and Civil Procedure for District Justices:
“Judgment shall be given at the conclusion of the hearing or within five (5) days thereafter and shall be entered on the complaint form ...”
Rule 1022 provides that an appeal from a judgment entered before a district justice must be made within thirty days “of the judgment.” An appeal is to be taken to the court of common pleas in the judicial district in which the district justice is located, 42 Pa.C.S. §932, which in this case would be York County.
Pennsylvania Rule of Civil Procedure governing action and proceedings before District Justices Rule 402A provides that: “Execution of a judgment for *8payment of money rendered by a district justice may be ordered by a district justice in whose office the judgment was rendered or entered ...” (Emphasis added.) Rule 402D provides that a plaintiff “may,” not “shall,” enter the judgment obtained before a district justice in a court of common pleas of any county after thirty days from the date of the judgment. These rules make it absolutely clear that a district justice shall enter judgment and it is not necessary to file proof of same in any court of common pleas before that judgment is final. Furthermore, the Judicial Code, 42 Pa.C.S. § 1516, provides that:
“A judgment of a district justice shall not operate as a lien on real property until a transcript of the record showing a final judgment of a district justice has been filed in the manner prescribed by general rules in the office of the clerk of the court of common pleas of the county where the property is situated, or in the office of the clerk of the branch of the court of common pleas embracing such county. (Emphasis added.)
This rule is referring to a judgment already properly entered before a district justice. If plaintiff wants the judgment to operate as a lien against defendants’ real estate he may file the judgment in a county court. If not, he can execute on the personal property of a defendant without ever proceeding outside of the jurisdiction of the district justice.
Litigation on the merits of the present case ended when there was no appeal filed in the Court of Common Pleas of York County within 30 days of the judgment entered by District Justice Estep on April 29, 1983. Accordingly, we find that plaintiff’s claim is barred by the doctrine of res judicata.
*9ORDER OF COURT
And now, this September 18, 1984, defendants’ preliminary objection in the form of a demurrer to plaintiffs complaint is sustained. Plaintiff’s complaint is dismissed.