Josephson current for a system consisting of an Anderson impurity weakly co
upled to two unconventional superconductors is studied and shown to be driv
en by a surface zero energy (midgap) bound state. The repulsive Coulomb int
eraction in the dot can turn a pi junction into a 0 junction. This effect i
s more pronounced in p-wave superconductors while in high-temperature super
conductors with d(x2-y2) symmetry it can exist for rather large artificial
centers at which tunneling occurs within a finite region.