It has happen to me too often that a script runs well at the command line when you test it but when you schedule it through cron it fails. After some troubleshooting I realize that it is caused by missing environment variable like PATH or JAVA_HOME.
After searching on the topic for a few minutes this morning I saw a recommendation that I adapted.
Before the script in crontab I just added:
source /home/user/.bashrc
This runs the .bashrc content and all my expected environment variables are there for the script to run the same way in cron as it does at the command line.
The entire cron line would look something like this:
50 3 * * * source /home/user/.bashrc; /path/to/script 1>>/tmp/logfile.log 2>>/tmp/logfile.log