Looks like you have intermittent DB communication issue. Is the issue reproducible every time you create a template? Do you have DB server behind firewall or on a different network?
... 58 more Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure The last packet successfully received from the server was 203 608 milliseconds ago. The last packet sent successfully to the server was 0 milliseconds ago.