  Based on the Bogoliubov-de Gennes equations, we provide an exact numerical
solution for the critical current of Josephson junctions with a composite
ferromagnetic bilayer. We demonstrate that for the antiparallel orientation of
the magnetic moments of the bilayer, the presence of a potential barrier at the
bilayer interface results in large oscillations of the critical current as a
function of ferromagnet thickness and/or exchange field. Because of this, and
remarkably, in the range of small exchange field and thicknesses, the magnetism
leads to the increase of the critical current. This effect is well pronounced
at low temperature but disappears near $T_c$. If the potential barrier is
replaced by a spin-active barrier at the bilayer interface the conventional
0-$\pi$ transition, similar to the case of an uniform ferromagnetic Josephson
junction, is observed. Strikingly, for a parallel orientation of the magnetic
moments of the bilayer, the presence of the spin-active barrier restores the
anomalous behavior---potential barrier in the antiparallel case. These
behaviors result from the resonant tunneling of Cooper pairs across the
composite barrier---an effect related to the spin-dependent Fermi vector in the
presence of the ferromagnets' exchange field.
