  We investigate the Josephson effect through a two-level quantum dot with an
exchange coupling between two dot electrons. We compute the superconducting
phase relationship and construct the phase diagram in the superconducting
gap--exchange coupling plane in the regime of the singlet-triplet transition
driven by the exchange coupling. In our study two configurations for the
dot-lead coupling are considered: one where effectively only one channel
couples to the dot, and the other where the two dot orbitals have opposite
parities. Perturbative analysis in the weak-coupling limit reveals that the
system experiences transitions from 0 to $\pi$ (negative critical current)
behavior, depending on the parity of the orbitals and the spin correlation
between dot electrons. The strong coupling regime is tackled with the numerical
renormalization group method, which first characterizes the Kondo correlations
due to the dot-lead coupling and the exchange coupling in the absence of
superconductivity. In the presence of superconductivity, many-body correlations
such as two-stage Kondo effect compete with the superconductivity and the
comparison between the gap and the relevant Kondo temperature scales allows to
predict a rich variety of phase diagrams for the ground state of the system and
for the Josephson current. Numerical calculations predicts that our system can
exhibit Kondo-driven 0-$\pi$-0 or $\pi$-0-$\pi$ double transitions and, more
interestingly, that if proper conditions are met a Kondo-assisted
$\pi$-junction can arise, which is contrary to a common belief that the Kondo
effect opens a resonant level and makes the 0-junction. Our predictions could
be probed experimentally for a buckminster fullerene sandwiched between two
superconductors.
