Well, strictly speaking there's no such island as Japan, one say "на Хоккайдо" but "в Японии". So there's no more mystery in that in, say, "на Бали" ad opposed to "в Индонезии".
With Фиджи it's slightly more complicated. While there's no such island as well, the whole archipelago is called Fiji, so you can say "в Фиджи" when you refer to it as a country or "на Фиджи" when you think about it as a group of islands. In colloquial speech this is used quite often interchangeably.
So, generally speaking when you refer to a destination as a state, you use "в" (like in "в Шри-Ланке"), you use "на" when you talk about an island (like in "на Шри-Ланке").
There are some notable exceptions though - Ирландия, Исландия, (and Великобритания by the way) are islands but "на"-firm is never used. This exceptions are important and the only thing can be done - is to memorize them.