In 990 CE, King
Dharmawangsa of Java launched a naval invasion against Srivijaya and attempted to capture the capital Kedah. The news of Javanese invasion of Srivijaya was recorded in Chinese sources from Song period. In 988, a Srivijayan envoy was sent to Chinese court in Guangzhou. After sojourned for about two years in China, the envoy learned that his country has been attacked by
She-po (Java) thus made him unable to return home. In 992 the envoy from
She-po (Java) arrived in Chinese court and explaining that their country has involved in continuous war with
San-fo-qi (Srivijaya). In 999 the Srivijayan envoy sailed from China to Champa in an attempt to return home, however he received no news about the condition of his country. The Srivijayan envoy then sailed back to China and appealed Chinese Emperor for the protection of China against Javanese invaders. Dharmawangsa's invasion led Cudamani Warmadewa to seek protection from China. In the midst of crisis brought by Javanese invasion, he secured Chinese political support by appeasing the Chinese Emperor. In 1003, a Song historical record reported that the envoy of
San-fo-qi was dispatched by the king
Shi-li-zhu-luo-wu-ni-fo-ma-tiao-hua (Sri Cudamani Warmadewa). The Srivijayan envoy told Chinese court that in their country a Buddhist temple had been erected to pray for the long life of Chinese Emperor, thus asked the emperor to give the name and the bell for this temple which was built in his honor. Rejoiced, the Chinese Emperor named the temple ''Ch'eng-t'en-wan-shou'' ('ten thousand years of receiving blessing from heaven, which is China) and a bell was immediately cast and sent to Srivijaya to be installed in the temple. By 1005, Srivijaya started to appear victoriously. In 1006 CE, Srivijaya's alliance proved its resilience by successfully repelling the Javanese invasion, subsequently the Javanese invasion was ultimately unsuccessful. This attack has opened the eyes of Srivijayan Maharaja of how dangerous Javanese Mataram Kingdom could be, and further contemplate, patiently laid a plan and effort to destroy his Javanese nemesis. King Cudamani died circa 1008, He was succeeded by his heir,
Sri Maravijayottungavarman. ==Retaliation==