The economies of China and Japan are different. Both are large exporters, but China does not have to import as much as Japan. It has vast natural resources and a huge manufacturing capacity, so it can supply goods to the rest of the world. These goods are also bought by China's large middle class.
Japan lacks these attributes, but nonetheless, its trade deficit is growing. There may be something for China to learn from that.