If Spine has a bug where it fails to release the resources for the file properly, that could prevent it from being written. If you close and reopen Spine, does it work then?
Do you have any other software that might have acquired an exclusive lock on the file? It could be a text editor, antivirus, etc.
There are tools like Lock Hunter which can show you what processes are locking a file.
If it's not locking, it could be file permissions are set so Spine can't write it. Are you able to edit the JSON file with another program, like Notepad?
If you have a directory named class_soldier.json
it could cause problems when Spine tries to write a file there. I believe Spine handles that though and shows an appropriate error message.