OPINION
McKEE, Circuit Judge.Petitioners Fraser and Hernandez filed petitions pursuant to 28 U.S.C. § 2241 to collaterally attack their sentences. Both petitions were dismissed based on the courts’ determination that they could not petition under section 2241 and must instead pursue second petitions under 28 U.S.C. § 2255. The petitioners appealed. They argue that the length of their sentences is illegal and they can collaterally attack them sentences under section 2241 because they meet the criteria for the safety-valve provision of section 2255. We will affirm.1
I.
Because we write only for the parties, it is not necessary to recite the facts of either case in detail. Rather, we need only briefly outline the facts relevant to each appeal.
A. Donald William Fraser
In 1991, Fraser was convicted of five counts of an indictment, including three counts of being a convicted felon possessing a firearm in violation of 18 U.S.C. § 922(g). Fraser’s pre-sentence report noted that the sentencing guidelines imposed a range of 70-87 months of imprisonment for these offenses. However, the government had given Fraser notice that it would seek the enhanced penalty for armed career criminals under 18 U.S.C. § 924(e) due to his criminal record.
Using section 924(e), the district court sentenced Fraser to 300 months for the three counts of possessing firearms as a convicted felon, and Fraser appealed. In July 1992, he wrote to his appellate counsel that he believed his civil rights had been restored for the 1979 convictions. His counsel replied, stating that he and Fraser had already discussed this issue and determined that his civil rights were not restored for those or any other convictions, and that this would not be included in his appeal unless Fraser could provide further evidence to the contrary. The Fourth Circuit then affirmed Fraser’s conviction and sentence without this issue being raised. United States v. Fraser, 989 F.2d 496 (4th Cir.1993).
In 1997, Fraser hired an attorney who filed a motion for enlargement of time to file a section 2255 petition in the District of Maryland, where Fraser had been convicted and sentenced. The enlargement of time motion was denied because it was filed outside the one-year statute of limitations. A subsequent section 2255 petition was also dismissed as untimely and Court of Appeals for the Fourth Circuit affirmed that decision. United States v. Fraser, 188 F.3d 504 (4th Cir.1999).
In July 2000, Fraser filed the instant petition pursuant to 28 U.S.C. § 22412 in the Middle District of Pennsylvania. He argued that the enhancement of his sentence was illegal because he does not meet the definition of an armed career criminal under section 924(e). The district court found that he should not have filed under section 2241 but under section 2255, and *430therefore dismissed his petition “without prejudice to any right Fraser may have to file a 2255 motion in the United States District Court for the District of Maryland.” Fraser appealed, and his case was consolidated with Hernandez’s appeal.
B. Alejandro Dejesus Hernandez
In 1992, Hernandez was convicted of one count of drug possession in violation of 21 U.S.C. § 841 in the Eastern District of Virginia. Neither his indictment nor the guilty verdict against him specified the identity or quantity of the drugs involved in his conviction. However, the sentencing court determined that the crime involved 5 kilograms of cocaine, and sentenced Hernandez to 324 months in prison. That sentence was affirmed on appeal. United States v. Hernandez, 977 F.2d 574, 1992 WL 250056 at *4-5 (4th Cir.1992). Hernandez then filed for relief under 28 U.S.C. § 2255. The trial court denied his petition and the Fourth Circuit dismissed his appeal. United States v. Hernandez, 1998 U.S.App. LEXIS 15286, 1998 WL 333407 (4th Cir. Jun. 9, 1998).
In 2000, the Supreme Court decided Ap-prendi v. New Jersey, 530 U.S. 466, 120 S.Ct. 2348, 147 L.Ed.2d 435 (2000). Hernandez, who was then imprisoned at FCI-Allenwood, filed the instant petition pursuant to 28 U.S.C. § 2241. He argued that his 1992 sentence was invalid because the drug identity and quantity involved had not been determined by a factfinder beyond a reasonable doubt as required by Apprendi. The district court dismissed his petition, and Hernandez filed the instant appeal.
II.
Section 2255 is the primary means for collateral attack on convictions and/or sentences by federal prisoners.3 Federal prisoners can seek relief pursuant to section 2241(c)(3) only when Section 2255 is inadequate to remedy a miscarriage of justice. In re Dorsainvil, 119 F.3d 245, 250 (3d Cir.1997) (quoting Davis v. United States, 417 U.S. 333, 94 S.Ct. 2298, 41 L.Ed.2d 109 (1974)). If a petitioner improperly challenges a federal conviction or sentence under section 2241, his or her petition must be dismissed for lack of jurisdiction. Application of Galante, 437 F.2d 1164, 1165 (3d Cir.1971).
The petitioners have already been denied relief under section 2255, and have filed a first petition under section 22414 rather than attempting a second petition under Section 2255. They argue that they should be able to do so because they meet the standards for relief under section 2241(c)(3), but cannot meet the standards *431required to file a second petition under section 2255.
The Antiterrorism and Effective Death Penalty Act of 1996 (“AEDPA”) narrowed the circumstances in which a second or successive motion is allowed under section 2255. It added the following language to that section:
A second or successive petition must be certified as provided in section 2244 by a panel of the appropriate court of appeals to contain — (1) newly discovered evidence that, if proven and viewed in the light of the evidence as a whole, would be sufficient to establish by clear and convincing evidence that no reasonable factfinder would have found the movant guilty of the offense; or (2) a new rule of constitutional law, made retroactive to cases on collateral review by the Supreme Court, that was previously unavailable.
The question presented by these petitions is whether the petitioners can seek habeas corpus relief under 28 U.S.C. § 2241 pursuant to the safety-valve provision in 28 U.S.C. § 2255. We exercise plenary review over the district court’s legal conclusions. Cradle v. United States ex rel Miner, 290 F.3d 536, 537 (3d Cir. 2002).
Hernandez does not rely upon newly discovered evidence. Rather, his claim for relief rests upon a purported “new rule of law”... made retroactive to cases on collateral review by the Supreme Court ... ”. However, we recently ruled that the rule of Apprendi is not retroactive. United States v. Swinton, 333 F.3d 481, 485 (3d Cir.2003), and United States v. Jenkins, 333 F.3d 151, 153-54 (3d Cir.2003).5
Therefore, Hernandez can not now file a second section- 2255 motion. See also, In re Turner, 267 F.3d 225, 227, 231 (3d Cir.2001).
As noted supra, section 2255 is generally the exclusive means by which a federal prisoner can collaterally attack his or her sentence. However, there is an exception:
An application for a writ of habeas corpus in behalf of a prisoner who is authorized to apply for relief by motion pursuant to this section, shall not be entertained if it appears that the applicant has failed to apply for relief, by motion, to the court which sentenced him, or that such court has denied him relief, unless it also appears that the remedy by motion is inadequate or ineffective to test the legality of his detention.
28 U.S.C. § 2255 (emphasis added).
The last phrase has been called the “safety-valve” clause and refers to the power of the federal courts to grant writs of habeas corpus pursuant to section 2241. Dorsainvil, 119 F.3d at 249. It provides for traditional habeas corpus relief when the section 2255 procedure is inadequate to test the legality of a prisoner’s detention. See id. at 251; see also United States v. Hayman, 342 U.S. 205, 223, 72 S.Ct. 263, 96 L.Ed. 232 (1952). However, courts construe this exception narrowly in order to prevent section 2241 from devouring the restrictions on successive 2255 petitions. Dorsainvil, 119 F.3d at 251.
We have previously summarized the operation of the safety-valve clause.
It has long been the rule in this circuit that the remedy by motion under § 2255 can be inadequate or ineffective to test the legality of detention only if it can be shown that some limitations of scope or procedure would prevent a section 2255 proceeding from affording the prisoner a *432full hearing and adjudication of his claim of wrongful detention.
United States v. Brooks, 245 F.3d 291 (3d Cir.2001) (citing United, States ex rel. Leguillou v. Davis, 212 F.2d 681, 684 (3d Cir.1954)). Cf. United States v. Baptiste, 223 F.3d 188, 189-90 (3d Cir.2000).6
A petition under section 2255 does not become “inadequate or ineffective” merely because a petitioner cannot meet the gatekeeping provisions for a second or successive petition; otherwise, the gatekeeping provisions enacted by Congress become meaningless. Brooks, 230 F.3d at 648 (citing United States v. Barrett, 178 F.3d 34, 50 (1st Cir.1999)). The petitioners here argue that their petitions meet the “inadequate or ineffective” standard because the section 2255 procedure, with its restriction on second petitions, does not allow them to raise issues regarding their allegedly illegal sentences.
As discussed above we have already held that Apprendi does not apply retroactively. See Swinton, 333 F.3d at 487-91; Jenkins, 333 F.3d at 153-54. Thus, even if Hernandez was able to petition under section 2241, he could not get relief. However, it is clear that the section 2255 procedure effectively and adequately tests the legality of Hernandez’s detention.
As the district court aptly said:
The fact that the appeals court determines that the new rule of constitutional law has not been made retroactive to cases on collateral review does not mean that the § 2255 remedy is “inadequate” or “ineffective.” It simply means that a new rule of constitutional law is not of such extraordinary importance as to have prompted the Supreme Court to determine (directly or by inescapable logical application of prior precedent) that the finality of a conviction or sentence should yield to another round of litigation. In this event, the defendant’s detention under precedent pre-existing the new rule is simply not wrongful.
Brown v. Mendez, 167 F.Supp.2d, 723, 729 (M.D.Pa.2001) (cited in the district court’s order dismissing the petition). Therefore, Hernandez does not qualify for the “safety valve” of section 2241.
Fraser’s claim is no stronger. He argues that he is being punished “for an act that the law does not make criminal” because he was sentenced under section 924(e) although he does not meet its definition of an armed career criminal. Thus, argues Fraser, unless he can file a section 2241 petition, this injustice will go uncorrected.
However, Fraser could have raised this on direct appeal. He could also have raised it under section 2255. He was prevented from doing so not by any ineffectiveness of these procedures, but by an alleged ineffectiveness of prior counsel.
Nonetheless, the remedy afforded by section 2255 would have allowed Fraser to raise the issue regarding section 924(e) but for the alleged ineffectiveness of his for*433mer counsel. Fraser can only qualify for the benefit of the safety valve due to “problems with the efficacy of the remedy” under section 2255, “not a personal inability to utilize it....” See Garris v. Lindsay, 794 F.2d 722, 727 (D.C.Cir.1986).
Accordingly, we will affirm the district courts’ dismissals of these petitions and dismiss the motion for summary affir-mance in Hernandez as moot.
. These two cases have been consolidated for appeal.
. He also petitioned for a writ of coram nobis in the alternative, but he does not pursue that on appeal.
. In 1948, by enacting Section 2255, which channels collateral attacks by federal prisoners to the sentencing court rather than to the court in the district of confinement so that they can be addressed more efficiently, Congress restricted but did not eliminate the right of federal prisoners to proceed under Section 2241(c)(3). See United States v. Hayman, 342 U.S. 205, 210-19, 72 S.Ct. 263, 96 L.Ed. 232 (1952) (detailing the history and purpose of section 2255). Section 2255 was not intended to limit the collateral rights of federal detainees, it was designed to serve as a convenient substitute for the traditional habeas corpus remedy. See id. at 219.
. Neither petitioner has sought relief under Section 2241 before. Therefore these petitions are treated as each petitioner's first ha-beas petition. Since sections 2255 and 2241 address different types of claims, filing a section 2241 petition after filing a section 2255 petition does not trigger the gatekeeping provisions of section 2244 discussed below. See Triestman v. United States, 124 F.3d 361, 373 n. 17 (2d Cir.1997) (internal citations omitted).
. The docket shows that Hernandez’s brief and appendix were filed on July 2, 2003. Jenkins was decided on June 18, 2003 and Swinton was decided on June 23, 2003.
. Baptiste considered whether a petitioner could seek a writ of coram nobis using the safety-valve provision, and concluded:
... The procedural barriers erected by AEDPA are not sufficient to enable a petitioner to resort to coram nobis merely because he/she is unable to meet AEDPA’s gatekeeping requirements. The safety valve provided under 28 U.S.C. § 2255 is narrow. We explained in In re Dorsainvil, 119 F.3d 245 (3d Cir.1997), that it is a complete miscarriage of justice when the AEDPA prohibition against successive section 2255 motions makes this collateral remedy unavailable altogether to someone with no earlier opportunity to bring his/her claim. Id. at 251. That is not Baptiste’s situation. He had an earlier opportunity to raise all of his claims (including the Amendment 487 claim) in his 1997 section 2255 motion.