A market with defaultable bonds where the bond dynamics is in a Heath-Jarrow-Morton setting and the forward rates are driven by an infinite number of Lévy factors is considered. The setting includes rating migrations driven by a Markov chain. All basic types of recovery are investigated. We formulate necessary and sufficient conditions (generalized HJM conditions) under which the market is arbitrage-free. Connections with consistency conditions are discussed.