 In the 11th century, trade slowly recovered as the cities started to grow again.The Papacy regained its authority, and undertook a long struggle against the Holy Roman Empire.The Investiture controversy, a conflict over two radically different views of whether secular authorities such as kings, counts, or dukes, had any legitimate role in appointments to ecclesiastical offices such as bishoprics, was finally resolved by the Concordat of Worms in 1122, although problems continued in many areas of Europe until the end of the medieval era.