Hugh Grant, Marisa Tomei, Allison Janney and J.K. Simmons do what they can to enliven Marc Lawrence’s feeble romantic comedy, but “The Rewrite” proves too frail for even such a game cast to invigorate. Mildly amusing at best, this is one of those pictures you’re likely to have forgotten before the credits have ceased to roll.

The picture opens with Grant, as Oscar-winning but now down-on-his-luck screenwriter Keith Michaels, pitching ideas to Hollywood execs and getting repeatedly shot down. The plot kicks in only when his agent (Caroline Aaron), seeking some job that might tide him over, points out an opening for someone with experience to teach a screenwriting class at SUNY Binghamton. Without any other projects on the horizon, financially strapped Michaels agrees to take the gig, though it means travelling across country and doing something he doesn’t want to do.

What follows is a fairly predictable elongated sitcom. Michaels, who holds the view that screenwriting can’t be taught, finds himself in front of a class of quirky students in a soggy comic riff on pictures like “Dead Poets Society” (which is referenced more than once). He has an affair with one of them, Karen (Bella Heathcote), though she’s much younger of course—a circumstance that comes to the attention of rigid ethics committee enforcer Professor Mary Weldon (Janney), whose specialty is Jane Austen, an author he’s already made the mistake of dismissing to her face.

Michaels has better rapport with Jim (Chris Elliott), a good-natured fellow prof impressed by his former success, and Dean Lerner (J.K. Simmons), whose smiling tolerance suggests that there’s no academic impropriety he hasn’t seen before. And though he tries to shirk off his job responsibilities, Michaels actually assists one of his charges sell a script, which makes him reconsider his attitude to the job. He also develops the beginnings of a relationship with Holly Carpenter (Tomei), an older student returning to school. And a final twist that should be obvious from the start not only puts the stamp on Michaels’ redemption as a person, but jumpstarts his career, too.

All of this is pleasant enough, thanks primarily to Grant’s trademark dithering, which allows him to mutter the wan witticisms that Lawrence provides him with ingratiatingly, as though he realized they were second-rate and shouldn’t be italicized. The fact that he and the director have worked together so often (in “Forces of Nature,” “Two Weeks Notice,” “Music and Lyrics” and “Did You Hear About the Morgans?”) seems to have brought an easygoing rapport between them, though it may also help to account for the lack of energy on display here. With the exception of Simmons, who appears to be pleased to be able to sail through a movie without the intensity he was expected to bring to the Sam Raimi Spider-Man movies and “Whiplash,” the rest of the cast fares less well: Janney is reduced to a one-note caricature, and Tomei is given little to work with, though her natural affability comes through nonetheless. Technically the picture is okay, though Jonathan Brown’s cinematography isn’t especially inventive and Ken Eluto’s editing accentuates the sluggishness of the piece rather than ameliorating it.

In sum, “The Rewrite” is an inoffensive but bland and unimaginative romcom sparked only by Grant’s familiar brand of understated charm. Before your memory of the movie fades as the lights come up, though, you might do well to cast your memory back to the first scene, when Michaels’ pitches were continuously dismissed by potential producers. This is one instance in which life probably should have imitated art; whoever greenlit this movie must not have been listening hard enough when Lawrence pitched it to him.