In 1582, the conversion of Gebhard Truchsess von Waldburg, the Archbishop of Cologne to Lutheranism led to a war between Gebhard, who refused to give up his Archdiocese and Duke Ernest of Bavaria, who had been elected as his successor. Gebhard tried to convert the archdiocese to Lutheranism and allied himself with the beautiful Countess Agnes von Mansfeld-Eisleben. James fought in this war under the Spanish general Alexander Farnese, Duke of Parma. He later served under the Catholic Duke Charles III of Lorraine.