Could be something wrong with the usb port on the bottom of the phone.
Maybe bend pins, damaged ones or lots of dirt up in there.
Did you try plugging it in to another computer to see if that one detects it? Just to rule out its not that particular computer.
I have not tried with other computers because i don't have any other available at the moment. Will try with one of my other computers tomorrow.
The phone does charge when i connect it. If i try to close iTunes, iTunes chrases and don't close until i disconnect my phone.
Could it be something installed in Cydia that causes this?