Why were warriors despised in China but glorified in Japan despite both being Confucian societies?

同为儒家社会,为什么中国鄙视武士而日本赞美武士?