I don't know what to tell you. Yes, famously, huge volumes of literature were written about the war that the world knew was coming during the 1900 - 1910 period and it was almost universally seen as inevitable. It was pretty brazenly obvious. Europe was a tinderbox, the arms race was on steroids, and each country was vying for diplomatic leverage over the alliance posturing of the major powers - which, as I hope you know, is how the entire continent got dragged into the war even though almost none of them had any kind of stake in Serbian independence.
It WASN'T the assassination in and of itself, that was a really minor aspect of how the war started and one of the reasons why World War 1 was so shocking to people at the time - an Austrian Duke gets shot and now every young man in Sc**thorpe died on the same day in the Somme? That just doesn't make sense! And it WASN'T the real reason. It was the activation of interlocking alliance systems that were negotiated without control during peacetime, in preparation for the major conflict that they all knew would start soon.
I'm only going to say this once, and then just walk away: World War 2 had fewer people predicting it directly as compared to World War 1. It wasn't quite as obvious. You still had people predicting it. Famously, John Meynard Keynes predicted it to within pretty chilling accuracy as early as 1919. But the waters were a little bit muddier for people who were discounting the possibility that Hitler and Mussolini would ever ally (because remember, publicly, they SAID they didn't want to, despite their ideological similarities). THAT's what I said.
But, look, war isn't just about surprise attacks and mobs of soldiers opening fire one sudden morning; it's about logistics, it's about diplomatic partnerships, it's about selling it to public opinion and to your own cabinet (unless you're an autocrat)... the actual opportunities to cross the alps with your elephants when your enemies aren't expecting it are not that common in history! Of course everyone WANTS to pull the surprise move off but it is mostly a fantasy. The effort it takes to beef up your soldier personnel AND put them through basic training AND move them to where you want the fighting to be is something that is really difficult to hide and tends to get noticed even by people who don't even work in espionage.