Regarding the zombie apocalypse, it would require some equipment and munition changes, but I am fairly certain the military could adapt to it.

A lot of damage from artillery and mortars comes from shrapnel and not the actual explosion, because it’s the most efficient when it comes to regular warfare, but changing the ratio would not be particularly difficult. Not to mention that – to a person/zombie standing upright – the shrapnel damage is not insignificant (even if the only meaningful damage is completely disabling a limb or head trauma). However, delivering shrapnel is much more efficient in terms of grenade size, so I think we’d see a shift towards larger caliber artillery.
Bear in mind that as we speak, more effective types of explosives are being researched, partially driven by the need(/wish) to deliver them by drones. While they are more expensive, they are also expected to deliver up to 10 times the power/volume. This research could potentially become much more relevant in the zombie scenario, and it would radically increase the effectiveness of any indirect weapon system.

Thermobaric weaponry (fuel-air explosives) would probably work very well, as they deliver a larger shock wave than normal munitions. While the zombies would be indifferent to the rarefaction (creation of a vacuum which ruptures the lungs), the high temperatures and burning could potentially be significant as well.

IEDs and similar would also prove very effective if zombies could be herded or lured into appropriate areas. The real limit to explosive force is usually in the delivery method – you have to somehow propel it towards the target, and/or hide where you place from the enemy. With zombies neither is an issue, so the only limit to the size of your IED is the time available for digging and the amount of explosives at hand.

Finally, the zombies lack a real answer to even lightly armoured, tracked vehicles. I imagine existing vehicles could be adapted to simply run over a large amount of zombies with little to no threat to themselves – even if they’re stuck, they can realistically stay holed up inside the vehicle for days while awaiting rescue.
Consider something like a mine flail. An armoured vehicle with a spinning wheel of chains with fist-sized iron balls at the ends would probably make short work of a large amount of zombies if employed correctly. A main battle tank might even be better employed simply running zombies over than actually firing.

My initial reaction is I wouldn’t even bother with melee weapons at all. Unless the zombies are somehow sneakier than expected, or much faster than a human being, I simply don’t see large-scale melee combat breaking out. Small arms would probably see a shift towards higher caliber rounds with more kinetic energy delivered (so even if you don’t hit it in the head and kill it, you at least stop it momentarily, knock it down for a second or destroy a limb), but they’d still be much more relevant than duking it out face to face.

It is probably true that for a high enough ratio of zombies-to-soldiers, especially if preparation time is limited or non-existent, there’s a point where everyone gets overrun, but it requires a very specific scenario to get to that point I would say. I guess some sort of dormant virus that zombifies a huge part of the population at once. Anything less, or if it is isolated to a specific state or country, I think it would be possible to buy enough time to tailor a response.

Source: I’m an army officer and – believe me – it’s a regular debate at the office :P