Chinese resisting the Western powers and imperialism

Why were the Chinese were not able to resist the Western powers and imperialism? In what ways were they different than the Japanese?