The idea of living forever while nursing a broken heart is the crux of James Mangold’s film about the Marvel Comic character with the retractable claws—a mutant who’s sort of a reverse Freddy Krueger, heroic rather than villainous. The grief of Wolverine, aka Logan (Hugh Jackman reprising his breakout role) over the loss of his beloved Jean Grey (Famke Janssen, who appears spectrally every so often to talk with him about things) is so extravagant that at one point in this installment he even undertakes to perform heart surgery on himself—for a reason other than lessening his despair, to be sure, but the symbolism is pretty blatant. (The script by Mark Bomback and Scott Frank, it should be noted, is a reworking of the 1982 miniseries by Chris Claremont and Frank Miller that inaugurated the character’s solo comic career.)

The emphasis makes much of “The Wolverine” a Camille-like exercise in angst and self-flagellation, and that portion of the picture—maybe half the running-time or more—is awfully lugubrious going, with Jackman overdoing the soulful eyes and grim visages. In that respect it’s most reminiscent among comic-book hero movies of “Daredevil,” which had a similarly dour storyline, and “Superman Returns,” which focused on the poignancy of the Man of Steel’s second introduction to earth. But Bryan Singer’s film triumphed with its grace, while Mark Steven Johnson’s simply wallowed in gloom and dystopia. Mangold’s falls between the two, being well-crafted and—until a typically overwrought finale—agreeably reasonable in scale. But ultimately it’s neither exhilarating nor emotionally satisfying enough to justify the combination of brooding melodrama and mindless action.

One thing the script has in its favor is the setting, which is—with one minor exception toward the start—Japan. The choice might have been determined in part by a decision to appeal to viewers abroad—a major financial concern among studios today—but at least it provides a cultural ambience different from most super-hero flicks. The story begins with the dropping of the atomic bomb on Nagasaki in 1945. For some reason Wolverine is a prisoner in a camp there, and he rescues a young Japanese soldier, Yashida (Ken Yamamura). Now, years later, Wolverine is surviving as a recluse in the Canadian mountains, where he takes revenge on a nasty hunter who deposits a poisoned arrow in his best buddy, a grizzly bear. He’s saved from the hunter’s pals by Yukio (Rila Fukushima), a petite martial-arts virtuoso with bright red hair, who’s been sent by the dying Yashida to bring him to Tokyo to say goodbye.

It turns out that Yashida, now played by Hal Yamanouchi, has an ulterior motive. His oncologist, a slinky blonde (Svetlana Khodchenkova) later revealed as a mutant called Viper, has supposedly found a means to transfer Logan’s immortality to Yashida, allowing the fellow to bring a natural end to his unhappy life. Logan refuses, but it turns out that the doctor does something to him that makes him vulnerable to injury and no longer to heal himself. That’s a major problem when Wolverine suddenly finds himself in the middle of an attempt by the yakuza to kidnap Yashida’s lovely granddaughter—and heir—Mariko (Tao Okamoto), something that seems not to bother her father, the scowling Shingen (Hiroyuki Sanada), or her family-picked fiancé, Justice Minister Mori (Brian Tee).

Thus begins the film’s big action sequences, the first the attempted abduction of Mariko at her grandfather’s funeral during which a figure of ambiguous stance intervenes—a master archer named Harada (Will Yun Lee), who is also revealed as Mariko’s youthful boyfriend. There shortly follows a fight aboard a speeding bullet train comparable to the contretemps between Spider-Man and Doc Ock in “Spider-Man 2” and the one between James Bond and the villains at the beginning of “Skyfall.” And at the end, as is mandatory in summer blockbusters nowadays, comes a prolonged, bombastic finale in which Wolverine must face off against a parade of opponents—Harada, Viper, and finally a clunking giant armored samurai that houses the ultimate villain of the piece. I shall not reveal whether he survives the gauntlet.

“The Wolverine” is a picture with a yin and yang quality, or at least with aspirations to have one. On the one hand, a good deal of the running-time is devoted to Logan’s existential crisis, which frankly gets tiresome after awhile. On the other, it periodically shifts into wild action mode. The intention is apparently that the two should complement one another and result in something greater than either alone. It’s a noble hope, but unfortunately the film doesn’t realize it. The angst doesn’t deepen the action, nor does the action energize the melodrama; the film isn’t exciting or insightful enough to work on either level.

Still, Jackman again makes a burly, hirsute hero, and Fukushima an engagingly saucy helpmate. Khodchenkova tries hard to be seductively evil, but comes across too campy for Mangold’s concept, and the Okamoto is decorative if inexpressive. The rest of the Japanese cast does yeoman work, especially the athletic Lee, though Sanada—while handling his martial-arts scenes well—is wearying one-note otherwise. Janssen’s ghostly appearances are embarrassments, though it’s not her fault. Technically the production is first-class, with crisp widescreen cinematography by Ross Emery and a slick production design by Francois Audouy, though the 3D conversion does neither any special service, and the effects are fine until that frantic, rather cheesy final reel. Marco Beltrami’s score is a surprisingly deft blend of eastern and western elements.

“The Wolverine” is certainly a great improvement on Gavin Hood’s awful 2009 “Origins” take on the character, and perhaps it’s the best that can be done with the hairy, haunted fellow. But that’s still not quite good enough.