[3] The Javanese northern coastal region – also known as the Pasisir – contained many trading towns, such as Surabaya (already taken by Trunajaya before Gegodog), Tuban, Juwana, Pati, Jepara, Semarang and Kendal.
The rebels defeated the Mataram forces and created an opportunity to capture Surabaya, a coastal city in East Java.
In response to the rebellion, Amangkurat had installed a military man, Angabei Wangsadipa as governor in Jepara overseeing the entire northern coast.
[2] Jepara's defender also had help from a Dutch East India Company (VOC) force of 200 men, who were reinforced by sea "just in time".
[12][3][10] After failing to take Jepara, Trunajaya's captains – whose forces were augmented by Javanese defectors eager for booty – attacked other towns along the coast.