Share your experience!
If while it's off the phone charge correctly and when it's on it does not chances are that you have an app that is maintaining the CPU usage over safe levels. When this happen.. is your phone hot on the back? If the answer yes then that's the issue and also mind that when the CPU get high temperatures there are more chances that the software "thermal" protection will disable the charge exactly for that reason. Beware, this is mainly an android/hardware feature to avoid damaging your device.
If you have a stuck app you may want to either repair your phone using the Sony PC Companion app (but this is really a drastic measure, read my note at the end of this comment) or you could start your phone in safe mode and trying to charge it and see if it charge normally. If after starting the phone in safe mode the phone charge correctly then you may try uninstalling one by one apps to see which ones are maintaing the CPU usage high. (CPU usage high or maintaining your device "awake")...
Note: After software updates/upgrades some system apps/modules may be the problem and if that is the case only a software repair will fix the issue.
have purchased this mobile in Dec 15 ,it was working fine till 1st week of April' 17 even after changing battery twice at service centre ,this problem has not gone ,depressed ,what to do next ,I love this mobile .