Concerned Citizens of Kimball County, Inc., filed an action under the Uniform Declaratory Judgments Act, Neb. Rev. Stat. §§ 25-21,149 to 25-21,164 (Reissue 1989), challenging the Nebraska Department of Environmental Control’s issuance of a permit to build a hazardous waste incinerator.
On October 27, 1987, Waste-Tech Services, Inc. (Waste-Tech), filed a permit application with the Nebraska Department of Environmental Control (Department), seeking a permit to build and operate a hazardous waste incineration and storage facility in Kimball County. The application listed Waste-Tech as the operator of the facility and Thermal, Inc. (Thermal), as the owner of the real estate on which the facility was to be built. During the public comment period before *154 issuance of the permit, Waste-Tech requested that the final permit designate Gus Koustas and George Koustas as owners of the Kimball facility. The Koustases were the officers and sole shareholders of Thermal. On November 17, 1988, the Department issued the final permit, which listed Waste-Tech as operator and the Koustases as owners.
On November 30, 1988, Amoco Oil Holding Company (Amoco), Waste-Tech’s corporate parent, purchased the Koustases’ interest in the Kimball facility. Subsequently, Amoco transferred its interest to Waste-Tech, making Waste-Tech both owner and operator of the facility. In a letter dated December 6,1988, Waste-Tech informed the Department that it had acquired title to the property.
On December 3, 1990, Concerned Citizens of Kimball County, Inc. (Concerned Citizens), filed a petition for declaratory relief in the district court for Lancaster County. In its petition, Concerned Citizens alleged that its members are Kimball County residents and landowners with interests in real estate in close proximity to the site of the proposed facility and that its members will suffer diminished real estate values and potential health hazards if the facility is built. The amended petition further contended that the Department’s issuance of the permit was unlawful because the Department had no authority to issue the permit to the Koustases as owners when the application had been filed by Waste-Tech. Therefore, the petition sought a declaration that the permit was void at its inception and could not legally be transferred to Amoco or Waste-Tech and that there is currently no valid permit for the Kimball facility.
The Department filed a demurrer to Concerned Citizens’ petition on the grounds that the district court had no subject matter jurisdiction and that Concerned Citizens was not a proper plaintiff. Waste-Tech filed a motion for summary judgment. The district court sustained the Department’s demurrer on both grounds mentioned in the demurrer and dismissed the action against the Department. The court also granted Waste-Tech’s summary judgment motion and dismissed the action with prejudice because (1) no genuine issues of material fact existed, (2) Concerned Citizens’ action *155 was an improper collateral attack on the decision of an administrative agency, and (3) Concerned Citizens had no standing.
Concerned Citizens contends that the district court erred in (1) sustaining the Department’s demurrer to Concerned Citizens’ petition, (2) granting Waste-Tech’s motion for summary judgment, and (3) dismissing Concerned Citizens’ petition with prejudice.
Concerned Citizens contends that the district court erred in holding that the Department was immune from this declaratory judgment action because of the state’s sovereign immunity. The district court sustained the Department’s demurrer because the state’s sovereign immunity meant that the court had no subject matter jurisdiction.
Lack of subject matter jurisdiction is a proper ground for a demurrer to a petition. Neb. Rev. Stat. § 25-806 (Reissue 1989);
Knapp v. City of Omaha,
Article V, § 22, of the Nebraska Constitution provides: “The state may sue and be sued, and the Legislature shall provide by law in what manner and in what courts suits shall be brought.” Article V, § 22, is not self-executing. Legislative action is necessary to waive the state’s sovereign immunity. See
Gentry
v.
State,
*156
Moreover, for purposes of applying the doctrine of sovereign immunity, a suit against an agency of the state is the same as a suit against the state. See,
Beatrice Manor
v.
Department of Health, supra; State, ex rel. Walker, v. Board of Commissioners,
However, a declaratory or other equitable action against a state officer or agent to obtain relief from an invalid act or from an abuse of authority by the officer or agent is not a suit against the state and is not prohibited by the general principles governing the immunity of the state from suit. See,
Bartels v. Lutjeharms,
Concerned Citizens’ petition indicates that this action was brought pursuant to the Uniform Declaratory Judgments Act, §§ 25-21,149 to 25-21,164. As the Department correctly points out, this court, in
Offutt Housing Co.
v.
County of Sarpy,
*157 “Generally, an action for a declaratory judgment cannot be maintained against the state without its consent, the state’s immunity from suit being held unaffected by declaratory judgment statutes; but such an action may be maintained under statutes permitting various actions against the state.” 81 C. J. S., States, § 214, p. 1304, and authorities cited.
Hence, the current version of Nebraska’s Uniform Declaratory Judgments Act does not waive the State of Nebraska’s sovereign immunity.
Although Concerned Citizens could have sued the director of the Department pursuant to the Uniform Declaratory Judgments Act, see Rein v. Johnson, supra, Concerned Citizens may not rely on the Uniform Declaratory Judgments Act as a basis for declaratory relief against the State of Nebraska or a state agency. Consequently, if Concerned Citizens is to obtain declaratory relief against the Department, it must do so in accordance with statutory authority and a procedure other than the Uniform Declaratory Judgments Act.
Concerned Citizens argues that this declaratory action is authorized by Neb. Rev. Stat. § 25-21,206 (Reissue 1989), which provides in part: “The state may be sued in the district court of the county wherein the capital is situated in any matter founded upon or growing out of a contract, express or implied, originally authorized or subsequently ratified by the Legislature, or founded upon any law of the state.” Thus, by its plain terms, § 25-21,206 applies only to actions based on a contract. However, this court has held that permits or licenses are not contracts. See,
Bosselman, Inc.
v.
State,
We also consider whether Neb. Rev. Stat. § 84-911 (Reissue 1987), a part of Nebraska’s Administrative Procedure Act, waives the state’s sovereign immunity and authorizes the district cour t’s j urisdiction in this suit. Section § 84-911(1) states:
The validity of any rule or regulation may be determined upon a petition for a declaratory judgment thereon addressed to the district court of Lancaster County if it appears that the rule or regulation or its threatened application interferes with or impairs or threatens to interfere with or impair the legal rights or privileges of the petitioner. The agency shall be made a party to the proceeding. The declaratory judgment may be rendered whether or not the petitioner has first requested the agency to pass upon the validity of the rule or regulation in question.
Neb. Rev. Stat. § 84-901 (Reissue 1987) does not include an agency permit within the definition of a “rule or regulation” which is reviewable under the Administrative Procedure Act. Because the permit issued to Waste-Tech by the Department is not a rule or regulation for purposes of the Administrative Procedure Act, § 84-911 does not waive the state’s sovereign immunity so as to authorize Concerned Citizens’ declaratory judgment action.
As noted above, the State of Nebraska and its agencies are immune from a declaratory judgment action unless specifically authorized by a statute. Concerned Citizens has not referred this court to any statute that authorizes this action against the state, nor has our independent research located such a statute authorizing a declaratory judgment action under the circumstances. Therefore, we hold that the district court did not err in sustaining the Department’s demurrer because of lack of subject matter jurisdiction.
Concerned Citizens also contends that the district court erred in granting Waste-Tech’s motion for summary judgment. However, because we have determined that the district court correctly sustained the Department’s demurrer, we now hold *159 that the action could not continue against Waste-Tech alone because the director of the Department is a necessary party.
Section 25-21,159 provides in part: “When declaratory relief is sought, all persons shall be made parties who have or claim any interest which would be affected by the declaration, and no declaration shall prejudice the rights of persons not parties to the proceeding.”
This court has held on numerous occasions that the statute authorizing declaratory judgments is applicable only where all interested and necessary persons are made parties to the proceeding. See,
Omaha Pub. Power Dist. v. Nuclear Elec. Ins. Ltd., 229
Neb. 740,
Concerned Citizens challenges the validity of the permit granted Waste-Tech by the director of the Department. This challenge necessarily raises the question whether the director of the Department acted within his statutory and regulatory powers. Since the director’s actions are being questioned, the director is an interested and necessary party in this declaratory judgment action. Therefore, the district court was without jurisdiction to consider the declaratory judgment action against *160 Waste-Tech alone and did not err in granting Waste-Tech’s summary judgment motion.
Concerned Citizens maintains that the district court erred in dismissing its petition against Waste-Tech and the Department with prejudice, thereby denying Concerned Citizens the opportunity to replead and remedy any defects in its petition.
Neb. Rev. Stat. § 25-852 (Reissue 1989) states:
The court may, either before or after judgment, in furtherance of justice, and on such terms as may be proper, amend any pleading, process or proceeding, by adding or striking out the name of any party or by correcting a mistake in the name of the party, or a mistake in any other respect, or by inserting other allegations material to the case .... Whenever any proceeding taken by a party fails to conform, in any respect, to the provisions of this code, the court may permit the same to be made conformable thereto by amendment.
Neb. Rev. Stat. § 25-854 (Reissue 1989) provides: “If the demurrer be sustained, the adverse party may amend, if the defect can be remedied by way of amendment, with or without costs, as the court in its discretion shall direct.”
A trial court’s decision regarding amendments to the pleadings will be not be reversed on appeal absent an abuse of discretion. See
St. Paul Fire & Marine Ins. Co. v. Touche Ross &
Co.,
When a demurrer to a petition is sustained, a court must grant a plaintiff leave to amend the petition unless it is clear that no reasonable possibility exists that repleading will correct the defective petition. After the demurrer has been sustained, but where there is a reasonable possibility that the defective petition may be cured by amendment, denying the plaintiff the opportunity to replead is an abuse of discretion.
Wichman
v.
Naylor,
Moreover, a summary judgment motion based on jurisdictional grounds is treated as and serves the same purpose
*161
as a demurrer on jurisdictional grounds. See,
Kerndt
v.
Ronan,
In the present case, it is necessary to determine whether there is a reasonable possibility that Concerned Citizens could amend its petition to cure the defect or defects in its petition and state a valid cause of action. Certainly, the defect relating to sovereign immunity of the state may be cured by making the director of the Department a party to the action. In addition, any defect regarding Concerned Citizens’ standing to sue on behalf of its members is curable. See,
Nebraska Seedsmen Assn.
v.
Department of Agriculture & Inspection,
Moreover, this action is not an improper collateral attack on the judgment of an administrative agency because neither Concerned Citizens nor its members were parties to the agency decision or in privity to a party to the agency action. See,
Krohn
v.
Gardner,
Therefore, there is a reasonable possibility that Concerned Citizens could cure the jurisdictional defects and state a valid cause of action, alleging a violation of 128 Neb. Admin. Code, ch. 16, § 009.02L3 (1988), which states in part: “The permit is not transferable to any person, except in the case of treatment and storage facilities, after notice to the Director.” See, also, 40 C.ER. § 270.40 (1988) (changes in ownership or operational control of a facility operating under a Resource Conservation and Recovery Act permit require prior written notice). Consequently, the district court abused its discretion in dismissing Concerned Citizens’ petition with prejudice.
The district court’s judgments sustaining the demurrer of the Department and granting Waste-Tech a summary judgment on jurisdictional grounds are affirmed. However, the court’s order dismissing Concerned Citizens’ petition with prejudice is reversed, and this cause is remanded to the district court for further proceedings.
Affirmed in part, and in part reversed and REMANDED FOR FURTHER PROCEEDINGS.
