  We consider two protoplanets gravitationally interacting with each other and
a protoplanetary disc. The two planets orbit interior to a tidally maintained
disc cavity while the disc interaction indices inward migration. When the
migration is slow enough, the more rapidly migrating outer protoplanet
approaches and becomes locked in a 2:1 commensurability with the inner one.
This is maintained in subsequent evolution. We study this evolution using a
simple anaytic model, full hydrodynamic 2D simulations of the disc planet
system and longer time N body integrations incorporating simple prescriptions
for the effect of the disc on the planet orbits. The eccentricity of the
protoplanets are found to be determined by the migration rate induced in the
outer planet orbit by the external disc. We apply our results to the recently
discovered resonant planets around GJ876. Simulation shows that a disc with
parameters expected for protoplanetary discs causes trapping in the 2:1
commensurability when the planets orbit in an inner cavity and that
eccentricities in the observed range may be obtained.
