I have a JD 317 that experienced the same problem. I thought it was the switch (because you had to play with the PTO switch if the ignition didn't want to work) so I replaced it. Still would not work. Finally I decided I should check the electrical clutch. I can't remember exactly what I checked for, but the readings from my digital VOM lead me to believe that the clutch was shot. I bought a new one (wasn't cheap...don't recall the cost) and put it in. Solved the problem.
Sadly I had one of those old 17 hp Kolhers and blew a hole in the engine a year later. It is sitting now until I have time to put a newer (pressurized lubrication) motor in it (1500USD). Got a good deal on a JD 445 to replace it...although the old 317 still handles tall grass better...that is why I want to get it going again and it was worth more to me than what I could get on trade.