Plaintiff Weston Funding Corporation (Weston) appeals from a judgment entered March 11, 1976 in the Southern District of New York, Robert L. Carter,
District Judge,
I. FACTS
Weston is a New York corporation. It is licensed as a real estate broker in New York but not in New Jersey. Lafayette is a New Jersey corporation. Its sole shareholder is Peck, a New Jersey resident.
Weston originally commenced a diversity action against Lafayette and Peck in the District Court for the District of New Jersey on May 21, 1974. Weston alleged that Lafayette and Peck owed Weston brokerage commissions for its services in helping Lafayette obtain a bank commitment for loans for the financing of Lafayette Towers. Weston and defendants on November 1, 1973 had entered into an agreement which gave Weston the exclusive right and authorization for a period of seven days to obtain such loans. The agreement was extended orally at the end of the seven day period. After Weston obtained a written construction loan commitment from the First National State Bank of New Jersey, the parties signed a memorandum confirming Weston’s right to a commission in amount of $191,250. After making a partial payment of $25,000 when the confirmatory memorandum was signed, defendants made no further payments. Weston alleged that defendants subsequently used the loan commitment it had obtained for them to obtain loans from other sources. Weston sued to recover the balance of the sum stated in the confirmatory memorandum.
Weston’s complaint in the New Jersey federal court was dismissed on November 6, 1974 by James A. Coolahan,
District Judge,
*712
on defendants’ motion for summary judgment. The ground of this decision was that New Jersey had closed the doors of its courts to suits for commissions by real estate brokers not licensed in New Jersey.
1
Weston, concededly. not so licensed, was held to be precluded from suing in the New Jersey federal court.
Woods v. Interstate Realty Co.,
After filing a notice of appeal from the dismissal of its New Jersey action and then stipulating to a dismissal of its appeal (without any reservation of rights), Weston commenced a new action in the District Court for the Southern District of New York on March 17, 1975, alleging substantially the same causes of action as in the prior New Jersey action. In dismissing the complaint in the instant Southern District action, after answers had been filed, Judge Carter held that the prior judgment in the New Jersey federal court was a bar to the second action on the ground of res judicata. He also held that the doctrine of collateral estoppel would bar Weston from relitigat-ing the question of the applicability of New Jersey’s “door-closing” statute even if Weston were not barred by res judicata from maintaining the second action in the Southern District.
Weston appeals from the judgment entered pursuant to Judge Carter’s opinion, claiming (1) that its Southern District action is not barred on the ground of res judicata; (2) that Weston is not barred by collateral estoppel from claiming that N.J. S.A. § 45:15-3 does not close the doors of a New York federal court; and (3) that, even if Weston is barred from suing on its contract claim, it still has a good cause of action in quantum meruit.
Since we find no merit in any of these claims and we agree with Judge Carter’s decision, we affirm.
II. RES JUDICATA
Weston advances two arguments to avoid the res judicata effect of the prior judgment. First, it argues that the instant action is based on the agreement of November 1, 1973 which was executed in New York, whereas the New Jersey action was based on the subsequent memorandum signed by Peck on behalf of himself and Lafayette at a meeting in New Jersey. 2 Weston maintains that the two agreements give rise to completely independent causes of action. In its brief before us Weston points out that the November 1 contract “which was extended by the oral agreement of the parties was not before the court in the New Jersey action” and that the recovery sought in the earlier action was based on the confirmatory memorandum which, unlike the November 1 agreement, did not “constitute a contract”. The district court below correctly rejected this attempt to convert components of one agreement into separate agreements on which separate causes of action could be based:
“It is clear that the letter of February 25, 1974 merely provided a precise calculation for the formula already agreed upon, as evidenced by the agreement of November 1, 1973. Regardless of whether plaintiff chooses to sue with respect to a document that sets forth the precise terms of his agreement with the defendants, or with respect to a later executed document which reflects in dollar figures the same terms as were initially agreed upon, plaintiff’s cause of action remains the same.”410 F.Supp. at 983 n.4.
Second, Weston argues that the prior adjudication was not “on the merits” and
*713
therefore cannot be res judicata. We agree with the district court that the New Jersey judgment was an adjudication on the merits.
3
It would serve no useful purpose to catalogue the types of judgments that have been considered to be “on the merits” or otherwise. The American Law Institute has abandoned use of the term “because of its possibly misleading connotations,” Restatement (Second) of the Law of Judgments § 48, at 36 (Tent. Draft No. 1, 1973). The general rule under the traditional terminology is that a judgment is on the merits if it completely disposes of the underlying cause of action,
Cromwell v. County of Sac,
The more modern view, as expressed in the Tentative Draft of Restatement (Second), supra, and the Federal Rules of Civil Procedure, expands the category of judgments that will be considered res judi-cata to include dismissals on other than traditionally “substantive” grounds. See Fed.R.Civ.P. 41(b); Reporter’s Note, Restatement (Second), supra, § 48, at 42-43. This view reverses the presumption that a judgment for the defendant on a demurrer or motion to dismiss normally does not bar a second action on the same claim. Rule 41 provides that such a judgment in a federal court, unless within one of the enumerated exceptions to the Rule, operates as an adjudication on the merits unless otherwise specified. 4
It is true that summary judgment was granted in the New Jersey action necessarily before “the defendant [had to] incur the inconvenience of preparing to meet the merits” of Weston’s claim at trial.
Costello v. United States,
But there are other critical factors to consider in determining whether a dismissal is on the merits. The primary one here is whether the court’s reason for dismissal was that plaintiff had no cause of action. In
Costello
the dismissal was for failure of the government to file an affidavit of good cause in a denaturalization proceeding; that failure did not destroy the underlying cause of action but simply constituted non-fulfillment of a prerequisite to the initiation of the proceedings.
*714
In contrast, N.J.S.A. § 45:15-3 is intended to bar creation of the debt, not merely to create a precondition to suit.
5
It is not a jurisdictional or procedural provision, see
Szantay v. Beech Aircraft Corp.,
“It is evident . . . from the legislative language and its construction by the courts of New Jersey, that the Act is a strong expression of public policy. It comes well within a reasonable exercise of the police power of the State to protect the public from fraud, misrepresentation, incompetence and sharp practice.”
Id. at 669.
The provision is part of a regulatory scheme that makes it illegal to engage in any unlicensed brokerage activity in New Jersey. 6
There may be a distinction between the question on the one hand whether a state statute is “substantive” and therefore to be applied by a federal court in a diversity action and on the other hand the question whether a judgment based on that statute is “on the merits” for res judicata purposes. In this case we believe the two concepts coincide. Since N.J.S.A. § 45:15-3 is part of the substantive law of New Jersey, it would be followed in state or federal courts outside of New Jersey if the court in the other state found the transaction such that the forum state’s conflicts principles dictated the application of New Jersey law. See
Backar v. Western States Producing Co.,
The New Jersey statute does not close only some of the courts in New Jersey or even all of the courts in New Jersey; rather, its effect is to void the underlying cause of action. Indeed it is not accurate to say that the court denies enforcement of an otherwise valid agreement, as with the statute of frauds, for the New Jersey courts have distinguished the licensing act from the statute of frauds on the basis of the underlying illegality of conduct in violation of the former.
Tanenbaum v. Sylvan Builders, Inc.,
Finally, the Supreme Court has made clear that “[i]t is a misconception of res judicata to assume that the doctrine does not come into operation if a court has not passed on the ‘merits’ in the sense of the ultimate substantive issues of a litigation.”
Angel v. Bullington, supra,
*715 “It is well settled that the failure to state a proper cause of action calls for a judgment on the merits .... Whether the complaint states a cause of action on which relief could be granted is a question of law and just as issues of fact it must be decided after and not before the court has assumed jurisdiction over the controversy. If the court does later exercise its jurisdiction, to determine that the allegations in the complaint do not state a ground for relief, then dismissal of the case would be on the merits, not for want of jurisdiction.” (emphasis added).
See generally
The Exchange National Bank of Chicago v. Touche Ross & Co.,
Even if the dismissal had not been based, as we believe it was, on a ground that could be characterized for
Erie
purposes as “the substantive right or obligation at issue,”
Szantay v. Beech Aircraft Corp., supra,
We hold that the prior judgment against Weston in the District Court for the District of New Jersey bars the instant action on the ground of res judicata.
III. ESTOPPEL
In view of our holding above, it is unnecessary for us to reach Weston’s claim that it should not be collaterally estopped from urging a choice of law other than that of New Jersey. Since this claim is pressed, however, we hold that, even if Weston were not barred from maintaining a new action in the New York federal court, it would be estopped from challenging Judge Coola-han’s choice of New Jersey law.
The estoppel actually would be direct, not collateral. See Restatement of the Law of Judgments, supra, § 49, comment b at 195 (Restatement (Second), supra, § 68, comment b at 146). If Weston were not precluded from maintaining a new action, it still would be “precluded from relitigating the very question which was litigated in the prior action.” Restatement of the Law of Judgments, supra, § 49, comment b at 195. The choice of New Jersey law issue is res judicata between the parties since it actually was litigated and decided. Id.
Moreover, it is hard to see what Weston hoped to gain by relitigating the choice of law question in the New York federal court. New York applies the “center of gravity” conflict of laws test,
Auten v. Auten,
IV. QUANTUM MERUIT
Finally, we need not tarry with Weston’s claim that, even if it is barred by res judicata or estoppel from relitigating its contract cause of action, it nevertheless
*716
should be permitted to maintain its quantum meruit cause of action. Suffice it to say that Weston asserted its quantum me-ruit cause of action in the New Jersey federal court as it did in the New York federal court. The gravamen of the holding of the New Jersey federal court was that Weston’s failure to obtain a New Jersey broker’s license precluded it from suing to recover a commission. This holding was required by the New Jersey statute, N.J.S.A. §§ 45:15-1 and 45:15-3, and is supported by New Jersey decisional law.
Tanenbaum v. Sylvan Builders, Inc., supra,
50 N.J.Super, at 355,
Affirmed.
Notes
. N.J.S.A. § 45:15-3 (1963) in relevant part provides:
“No person, firm, partnership, association or corporation shall bring or maintain any action in the courts of this State for the collection of compensation for the performance of any of the acts mentioned in this article without alleging and proving that he was a duly licensed real estate broker at the time the alleged cause of action arose.”
. That the extension of the original agreement was not in writing does not present a problem. New York exempts real estate brokerage agreements from the statute of frauds. N.Y.Gen. Oblig.Law § 5-701(10) (McKinney 1964).
. We assume without deciding that federal law governs the res judicata effect of the prior judgment in the New Jersey federal court, including the determination of whether the judgment was “on the merits." See
Kern
v.
Het-tinger,
. Comment d to § 48 of the Restatement (Second), supra at 42, explains the departure from the first Restatement’s position in § 50 that “a judgment for defendant on demurrer or motion to dismiss for failure to state a claim had only direct estoppel effect.” The comment goes on to point out that even under the earlier provision, “the granting of such a motion not because of a technical defect in the complaint or the inadvertent omission of critical allegations, but because of 'an entire failure to state a cause of action,’ would effectively bar a second action because of the scope of the issue determined in the first proceeding.” Id. That is the case here.
. Even if it were merely a precondition to suit, it would be a precondition Weston never could fulfill. Becoming a licensed broker in New Jersey at any time after the alleged cause of action arose would not enable Weston to fulfill the requirements of N.J.S.A. § 45:15-3. Compare Restatement (Second), supra, § 48.1(2) and comment k at 46, 52-53.
. N.J.S.A. § 45:15-1 (1963) in relevant part provides:
“No person shall engage either directly or indirectly in the business of a real estate broker or salesman, temporarily or otherwise without' being licensed so to do
The provision is “regulatory and not merely revenue producing, and a contract made in violation of [the provision is] illegal and void.”
Saks Theatrical Agency v. Mentine,
. In
Woods v. Interstate Realty Co., supra,
the Court interpreted its decision in
Guaranty Trust Co. v. York,
