The battery could be bad. If it is an after market one they can be hit or miss. It also could be that the problem is the charger and the battery together.
Try charging it when the laptop is turned off. If it will charge then, the charger is probably the issue. If it still won't charge, no matter if turned off or on, then I would be looking at it being a defective battery.