By the coincidence, is your batt serial no beginning with BD? If so, look on the battery. Is it swollen a bit? If so - call samsung, they will replace battery free of charge.
If not, try to connect phone to charger, insert battery, go to recovery and make full wipe.
Im digging up this post because this is the same problem i had.
I ended up removing the power button all together, carefully popped it off the motherboard. The phone no longer boots for a couple secs and powers off again so i think the power button was the issue. Now i have the problem of powering on the phone. I tried booting into download mode (to have the reboot option) by holding volume down+home while plugging it in but nothing happens, all i get is the battery charging icon. Ive been into download mode before i removed the button, but like the OP, it would only be a second or 2 before rebooting. Am i doing the correct procedure for download mode? Perhaps my timing is off? Any suggestions?
At least i do get the battery charge and it stays until i unplug the phone, no more boot loop!